/*
Colors and other variables
*/

:root {
  --white: #fff;
  --black: #000;
  --transparent: rgba(255, 255, 255, 0);

  --golden-yellow: #ffce4b;
  --orange: #f78f31;
  --light-green: #edfff5;
  --contrast-green: #3bb54a;
  --logo-green: #0b9a33;

  --lighter-gray: #f4f4f4;
  --medium-gray: #bbbbbb;
  --dark-gray: #505050;

  --blue: #0b8ce9;
  --dark-blue: #2b5399;

  --text-color: rgb(29, 29, 29);
  --link-color: var(--logo-green);
  --link-focus-color: var(--blue);
  --header-color-primary: var(--black);

  --font-family: 'Roboto', sans-serif;
  --font-family-headline: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --color-text: var(--text-color);
  --color-primary: rgb(82, 84, 188);
  --color-background: var(--white);
  --color-link: var(--logo-green);
  --color-success: rgb(214, 250, 214);
  --color-info: rgb(243, 238, 194);
  --color-warning: var(--golden-yellow);
  --color-danger: var(--orange);
  --color-required-label: red;
  --color-tr-background: white;
  --color-tr-alternate-background: rgb(248, 247, 247);
  --margin-bottom: 1rem;
  --margin-bottom-small: 0.3rem;
  --border-radius: 5px;
  --border: 1px solid rgb(209, 209, 209);
  --padding-base: 10px;
  --outline-input: 2px solid rgb(89, 0, 255);
}

/*
Font scale from Utopia
@link https://utopia.fyi/type/calculator?c=320,17,1.2,1240,20,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12
*/

:root {
  /* Step -2: 12.64px → 12.50px */
  --step--2: clamp(0.7813rem, 0.793rem + -0.0152vw, 0.79rem);

  /* Step -1: 14.22px → 15.00px */
  --step--1: clamp(0.8888rem, 0.8718rem + 0.0848vw, 0.9375rem);

  /* Step 0: 16.00px → 18.00px */
  --step-0: clamp(1rem, 0.9565rem + 0.2174vw, 1.125rem);

  /* Step 1: 18.00px → 21.60px */
  --step-1: clamp(1.125rem, 1.0467rem + 0.3913vw, 1.35rem);

  /* Step 2: 20.25px → 25.92px */
  --step-2: clamp(1.2656rem, 1.1424rem + 0.6163vw, 1.62rem);

  /* Step 3: 22.78px → 31.10px */
  --step-3: clamp(1.4238rem, 1.2429rem + 0.9043vw, 1.9438rem);

  /* Step 4: 25.63px → 37.32px */
  --step-4: clamp(1.6019rem, 1.3477rem + 1.2707vw, 2.3325rem);

  /* Step 5: 28.83px → 44.79px */
  --step-5: clamp(1.8019rem, 1.4549rem + 1.7348vw, 2.7994rem);
}

/*
Minimal CSS reset
https://www.joshwcomeau.com/css/custom-css-reset/
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  line-height: 1.5;
  display: grid;
}

img,
picture,
video,
canvas,
svg {
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

#root,
#__next {
  isolation: isolate;
}

/*
Base styles
*/

html {
  background-color: var(--color-background);
  font-family: var(--font-family);
  font-size: var(--step-0);
  color: var(--color-text);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-headline);
  color: var(--header-color-primary);
  font-weight: 700;
}

h1 {
  font-size: var(--step-3);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: var(--step-2);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

h3 {
  font-size: var(--step-1);
  margin-top: 2rem;
  margin-bottom: var(--margin-bottom);
}

h4 {
  font-size: var(--step-0);
  margin-bottom: var(--margin-bottom);
}

h5 {
  font-size: var(--step-0);
  margin-bottom: var(--margin-bottom);
}

h6 {
  font-size: var(--step-0);
  margin-bottom: var(--margin-bottom);
}

small {
  font-size: 0.75rem;
  line-height: 1.125rem;
}

strong {
  font-weight: 500;
}

a,
a:visited {
  color: var(--color-link);
}

/* Forms */

input,
textarea,
button {
  border-radius: var(--border-radius);
  border: var(--border);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: var(--outline-input);
}

input,
textarea {
  padding: 0.3rem 0.75rem 0.3rem 0.75rem;
}

textarea {
  width: 100%;
}

.required label:after {
  content: ' *';
  color: var(--color-required-label);
}

input,
textarea,
button[type='submit'] {
  margin-bottom: var(--margin-bottom);
}

form ul.errorlist {
  list-style-type: none;
  padding-left: 0;
  margin-left: 0;
}

form ul.errorlist li {
  color: red;
  margin-left: 0;
  margin-bottom: var(--margin-bottom-small);
}

form ul.errorlist.nonfield li {
  margin-bottom: var(--margin-bottom);
}

/* || BUTTONS AND LINKS */

.button-link {
  color: var(--link-color);
}

.button-link:hover,
.button-link:focus {
  color: var(--link-focus-color);
}

.button {
  border-radius: 4px;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.6875rem;
  padding-block: 12px;
  padding-inline: 24px;
  text-align: center;
  cursor: pointer;
}

.button-outline {
  background-color: var(--transparent);
  border: 2px solid var(--logo-green);
  color: var(--logo-green);
}

.button-outline:hover,
.button-outline:focus {
  background-color: var(--logo-green);
  color: var(--white);
}

.button:is(a) {
  text-decoration: none;
  display: inline-block;
}

.button:not(.button-outline) {
  background: var(--logo-green);
  border: 2px solid transparent;
  color: var(--white);
}

.button:not(.button-outline):hover,
.button:not(.button-outline):focus {
  background-color: var(--transparent);
  border: 2px solid var(--logo-green);
  color: var(--logo-green);
}

.button:disabled {
  opacity: 0.6;
  pointer-events: none; /* disable hovering, clicking, etc */
}

.button-link {
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
  padding: 0;
  text-decoration: underline;
}

input[type='checkbox'] {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  border-radius: var(--border-radius);
  -moz-border-radius: var(--border-radius);
  -webkit-border-radius: var(--border-radius);
  accent-color: var(--color-primary);
  margin-bottom: var(--margin-bottom-small);
}

input[type='checkbox']:focus {
  outline: 0px;
}

input[type='checkbox'] + label {
  display: inline-block;
  cursor: pointer;
  margin-bottom: var(--margin-bottom);
}

/* Tables */

table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--margin-bottom);
}

th,
td {
  padding: var(--padding-base) 0;
}

tr {
  background-color: var(--color-tr-background);
}

thead tr {
  border-bottom: 1px dotted var(--color-primary);
}

/* Components */

.project-name {
  font-size: var(--step--1);
  text-align: right;
  color: rgb(126, 126, 126);
  margin-top: 0;
}

.project-name a {
  color: rgb(212, 212, 212);
  text-decoration: none;
}

.notification {
  display: block;
  margin-bottom: var(--margin-bottom);
}

.notification__message {
  display: inline-block;
  padding: var(--padding-base);
  border-radius: var(--border-radius);
  -moz-border-radius: var(--border-radius);
  -webkit-border-radius: var(--border-radius);
}

.notification__message.info {
  background-color: var(--color-info);
}

.notification__message.success {
  background-color: var(--color-success);
}

.notification__message.warning {
  background-color: var(--color-warning);
}

.notification__message.error {
  background-color: var(--color-danger);
}

.notification__message.debug {
  background-color: var(--color-danger);
}

.page {
  min-width: 270px;
  max-width: 600px;
  width: calc(100% - 20px);
  margin-top: 5px;
  margin-right: auto;
  margin-left: auto;
  margin-bottom: 40px;
  min-height: 70vh;
}

.page--wide {
  max-width: 800px;
}

.avatar {
  width: 200px;
  margin-bottom: var(--margin-bottom);
}

.section-development-only {
  margin-top: var(--margin-bottom);
  border: 1px solid var(--color-danger);
  border-radius: var(--border-radius);
  padding: var(--padding-base);
}

.hero-image {
  float: left;
  max-width: 300px;
  padding-right: 20px;
}

/* Temp new stuff - some we might keep when we replace this base.css */
fieldset {
  border: none;
  padding-left: 0;
}

p {
  margin: 0 0 1.5em;
}
label {
  font-size: var(--step-0);
}

p.tagline {
  font-size: var(--step-2);
}

.endnote {
  font-size: 80%;
}

.helptext {
  font-size: var(--step--1);
  font-style: italic;
}

.radiogrid {
  display: flex;
  align-items: center;
  gap: 1rem; /* Probably make this the same as horizontal padding */
  padding: 0.5rem 1rem; /* make sure this matches the checked style */
  cursor: pointer;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--medium-gray);
  /* Use half of the available width (minus the gap)
   * so they're in rows of 2 */
  width: calc(50% - 0.25rem);
  height: 7rem;
  box-sizing: border-box;
}

input:hover + label.radiogrid {
  background: #eeeeee;
}

input:checked + label.radiogrid {
  background: var(--light-green);
  border: 2px solid var(--color-link);
  /* We're increasing the border by 1px but don't want the layout to shift,
   * so decrease the padding by 1px to make up for it */
  padding: calc(0.5rem - 1px) calc(1rem - 1px);
}

.radiogrid__icon {
  width: 3.5rem;
}

.radiogrid__info {
  flex-direction: column;
  gap: 0.25rem;
  flex-grow: 1;
  width: 100%;
}

.radiogrid__info__title {
  font-weight: 500;
}

.radiogrid__info__help {
  font-size: var(--step--2);
  color: var(--dark-gray);
}

.formstarthidden {
  margin-bottom: 10px;
}

div#datatype_help_grid {
  margin-bottom: 20px;
}

div#datatype_radio_grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
  gap: 0.5rem;
}

.data-dropdowns {
  display: flex;
  gap: 0.3rem;
  margin-bottom: var(--margin-bottom);
}

.with-tooltip {
  position: relative;
}

/* The tooltip box */
.with-tooltip::before {
  content: attr(data-text);
  position: absolute;
  display: none;
  top: 0;
  transform: translate(-50%, calc(-100% - 6px));
  left: 50%;
  padding: 10px 15px;
  background: var(--dark-gray);
  color: #fff;
  min-width: 250px;
  font-size: var(--step--1);
  border-radius: var(--border-radius);
  text-align: left;
}

/* The arrow */
.with-tooltip::after {
  content: '';
  display: none;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -6px);
  border: 5px solid var(--dark-gray);
  border-color: var(--dark-gray) transparent transparent transparent;
}

.with-tooltip:hover::before,
.with-tooltip:hover::after {
  display: block;
}

.nav-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--dark-gray);
}

.nav-bar a {
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  color: inherit;
}

.nav-bar a:hover,
.nav-bar a.active {
  color: var(--color-link);
}

#id_reaction {
  display: flex;
  width: auto;
  position: relative;
}

/* we're hiding the actual radio input */
#id_reaction input[type='radio'] {
  opacity: 0;
  position: absolute;
  bottom: -10px;
}

#id_reaction label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid #aaa;
  cursor: pointer;
}

#id_reaction input[type='radio']:checked + label {
  background: #eee;
}

#id_reaction > div:first-of-type input[type='radio']:checked + label {
  color: var(--logo-green);
}

#id_reaction > div:last-of-type input[type='radio']:checked + label {
  color: darkred;
}

#id_reaction > div:first-of-type label {
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
}

#id_reaction > div:last-of-type label {
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  border-left: 0;
}

select {
  padding: calc(var(--padding-base) / 2);
  border-radius: var(--border-radius);
}

footer {
  margin: 0 auto;
  padding: 4rem 0 1rem;
}

/* mobile styles */
@media (max-width: 600px) {
  label.radiogrid {
    width: 100%;
    height: 6rem;
  }

  .radiogrid__icon {
    width: 2.5rem;
  }

  .data-dropdowns {
    flex-direction: column;
  }

  .hero-image {
    max-width: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 20px;
  }
}

a.icon-link {
  display: flex;
  align-items: center;
  gap: 5px;
}

ul.vertical-list {
  list-style: none;
  padding-left: 0;
}

ul.vertical-list li {
  margin: 0.75rem 0;
}
