/*
  The design is a 720 x 1219 phone composition. Every size below is written in design pixels
  through --u, so the page keeps the design's proportions on any phone width.
*/

@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-text.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo Display';
  src: url('/fonts/archivo-display-italic.woff2') format('woff2');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo Button';
  src: url('/fonts/archivo-button.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --w: 100vw;
  --u: calc(var(--w) / 720);

  --navy: #263068;
  --red: #e51b1b;
  --placeholder: rgba(38, 48, 104, 0.4);
  --brown-shadow: rgba(120, 16, 16, 0.44);
  --field-shadow: 0 calc(var(--u) * 33) calc(var(--u) * 38) var(--brown-shadow);
  --radius: calc(var(--u) * 20);
}

/* On larger screens the phone composition sits in a centred column */
@media (min-width: 600px) {
  :root {
    --w: 480px;
  }

  @supports (height: 100dvh) {
    :root {
      /* 0.486 = 720 / 1482, the height of the form with its checkboxes and legal line, so it fits without scrolling */
      --w: max(360px, min(480px, calc(100dvh * 0.486)));
    }
  }

  body::before {
    content: '';
    position: fixed;
    inset: -60px;
    z-index: -2;
    background: #b98f10 url('/img/bg-main.jpg') center / cover no-repeat;
    filter: blur(40px) brightness(0.72);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: #b98f10;
}

html.is-locked,
html.is-locked body {
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--navy);
  font-family: 'Archivo', Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: calc(var(--u) * 23);
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.nowrap {
  white-space: nowrap;
}

/* Background: fixed behind the page, cropped the way the design crops it */
.bg {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: -1;
  width: var(--w);
  height: 100vh;
  transform: translateX(-50%);
}

@supports (height: 100lvh) {
  .bg {
    height: 100lvh;
  }
}

.bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 61%;
}

/* Page */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: var(--w);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--u) * 36) 0 0;
}

@supports (height: 100dvh) {
  .stage {
    min-height: 100dvh;
  }
}

.logo {
  display: block;
  flex: none;
  width: calc(var(--u) * 216);
  height: calc(var(--u) * 60);
  margin-left: calc(var(--u) * 259);
}

/* Heavy red italic used by the headline and the sheet titles */
.display {
  margin: 0;
  color: var(--red);
  font-family: 'Archivo Display', 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0;
  text-transform: uppercase;
  --o: calc(var(--u) * 0.9);
  text-shadow:
    var(--o) 0 0 rgba(255, 255, 255, 0.72),
    calc(var(--o) * -1) 0 0 rgba(255, 255, 255, 0.72),
    0 var(--o) 0 rgba(255, 255, 255, 0.72),
    0 calc(var(--o) * -1) 0 rgba(255, 255, 255, 0.72),
    calc(var(--o) * 0.8) calc(var(--o) * 0.8) 0 rgba(255, 255, 255, 0.72),
    calc(var(--o) * -0.8) calc(var(--o) * 0.8) 0 rgba(255, 255, 255, 0.72),
    calc(var(--o) * 0.8) calc(var(--o) * -0.8) 0 rgba(255, 255, 255, 0.72),
    calc(var(--o) * -0.8) calc(var(--o) * -0.8) 0 rgba(255, 255, 255, 0.72),
    0 calc(var(--u) * 2) calc(var(--u) * 3) rgba(88, 52, 0, 0.5);
}

.headline {
  flex: none;
  margin-top: calc(var(--u) * 41);
  font-size: calc(var(--u) * 32.4);
  line-height: calc(var(--u) * 36);
  text-align: center;
}

.headline span {
  display: block;
  white-space: nowrap;
}

/* Form */
.form {
  flex: none;
  position: relative;
  width: calc(var(--u) * 550);
  margin: calc(var(--u) * 37) 0 0 calc(var(--u) * 85);
}

.question {
  position: relative;
  margin-bottom: calc(var(--u) * 30.5);
}

.question-label {
  display: block;
  margin: 0 0 calc(var(--u) * 9);
  padding-left: calc(var(--u) * 5);
  color: #fff;
  font-size: calc(var(--u) * 22.4);
  line-height: calc(var(--u) * 24);
  white-space: nowrap;
  text-shadow: 0 calc(var(--u) * 1.5) calc(var(--u) * 2) rgba(88, 52, 0, 0.45);
}

.identity {
  margin-top: calc(var(--u) * 57);
}

.identity .field + .field {
  margin-top: calc(var(--u) * 15.5);
}

/* White rounded field: shape, bottom edge and warm shadow measured from the exports */
.field,
.select-head {
  position: relative;
  display: block;
  width: 100%;
  height: calc(var(--u) * 80);
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  box-shadow:
    inset 0 calc(var(--u) * -1) 0 #cbcac9,
    inset 0 calc(var(--u) * -2) 0 #e7e6e6,
    var(--field-shadow);
}

.field input {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 calc(var(--u) * 28) calc(var(--u) * 2) calc(var(--u) * 30);
  border: 0;
  border-radius: inherit;
  outline: 0;
  background: transparent;
  color: var(--navy);
  font-size: calc(var(--u) * 24);
  appearance: none;
  -webkit-appearance: none;
}

.field input::placeholder {
  color: var(--placeholder);
  opacity: 1;
  font-size: calc(var(--u) * 22.9);
}

/* Label inside the field acts as the placeholder, because of the red asterisk */
.field label {
  position: absolute;
  top: 50%;
  left: calc(var(--u) * 30);
  color: var(--navy);
  font-size: calc(var(--u) * 22.4);
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.req {
  color: var(--red);
}

/* On the photo the red star gets a white halo, like the headline */
.question-label .req,
.check .req {
  font-weight: 700;
  text-shadow:
    0 0 calc(var(--u) * 2) #fff,
    0 0 calc(var(--u) * 2) #fff,
    0 0 calc(var(--u) * 3) #fff;
}

.field input:not(:placeholder-shown) + label {
  display: none;
}

.field:focus-within,
.select-head:focus-visible {
  outline: calc(var(--u) * 4) solid rgba(38, 48, 104, 0.55);
  outline-offset: 0;
}

.field.is-invalid,
.is-invalid .select-head {
  outline: calc(var(--u) * 4) solid var(--red);
  outline-offset: 0;
}

/* Keep fields white when the browser autofills them */
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--navy);
  box-shadow: inset 0 0 0 100px #fff;
  caret-color: var(--navy);
}

/* Dropdowns */
.select {
  position: relative;
}

.select.is-open {
  z-index: 20;
}

.select-head {
  z-index: 2;
  padding: 0 calc(var(--u) * 28) calc(var(--u) * 2) calc(var(--u) * 30);
  text-align: left;
  outline-offset: 0;
}

.select.is-open .select-head {
  box-shadow:
    inset 0 calc(var(--u) * -1) 0 #e3e0df,
    0 calc(var(--u) * 4) calc(var(--u) * 12) rgba(120, 16, 16, 0.1);
}

.select-value {
  display: block;
  overflow: hidden;
  padding-right: calc(var(--u) * 30);
  font-size: calc(var(--u) * 24);
  line-height: calc(var(--u) * 28);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.select-value.is-placeholder {
  color: var(--placeholder);
  font-size: calc(var(--u) * 22.9);
}

.select-arrow {
  position: absolute;
  top: calc(var(--u) * 38);
  right: calc(var(--u) * 27);
  width: calc(var(--u) * 15);
  height: calc(var(--u) * 8);
  fill: var(--navy);
}

.select.is-open .select-arrow {
  transform: scaleY(-1);
}

.select-list {
  position: absolute;
  top: calc(var(--u) * 60);
  left: 0;
  z-index: 1;
  overflow: hidden;
  width: 100%;
  margin: 0;
  padding: calc(var(--u) * 21) 0 0;
  border-radius: 0 0 var(--radius) var(--radius);
  outline: 0;
  background: #fff;
  box-shadow: var(--field-shadow);
  list-style: none;
}

.select-list li {
  display: flex;
  align-items: center;
  height: calc(var(--u) * 82);
  padding: 0 calc(var(--u) * 30);
  font-size: calc(var(--u) * 24);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.select-list li:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

.select-list li[aria-selected='true'],
.select-list li.is-active,
.select-list li:active {
  background: var(--red);
  color: #fff;
}

@media (hover: hover) {
  .select-list li:hover {
    background: var(--red);
    color: #fff;
  }

  /* Only the row under the pointer stays red while the pointer is over the list */
  .select-list:hover li:not(:hover) {
    background: transparent;
    color: var(--navy);
  }
}

/* An open list ends halfway across the next field: hide that field's text instead of cutting it in two */
.form:has([data-field='store'].is-open) #phone,
.form:has([data-field='store'].is-open) #phone + label,
.form:has([data-field='motto'].is-open) #fullName,
.form:has([data-field='motto'].is-open) #fullName + label {
  visibility: hidden;
}

/* Checkboxes: the real input sits invisibly on top of the drawn box, so it stays clickable and focusable */
.checks {
  margin-top: calc(var(--u) * 36);
}

.check {
  position: relative;
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 18);
  padding-left: calc(var(--u) * 5);
  color: #fff;
  font-size: calc(var(--u) * 22.4);
  line-height: calc(var(--u) * 28);
  text-shadow:
    0 0 calc(var(--u) * 4) rgba(40, 16, 0, 0.75),
    0 calc(var(--u) * 1.5) calc(var(--u) * 2) rgba(40, 16, 0, 0.75);
  cursor: pointer;
}

.check + .check {
  margin-top: calc(var(--u) * 20);
}

.check input {
  position: absolute;
  top: 50%;
  left: calc(var(--u) * 5);
  width: calc(var(--u) * 40);
  height: calc(var(--u) * 40);
  margin: calc(var(--u) * -20) 0 0;
  opacity: 0;
  cursor: pointer;
}

.check-box {
  position: relative;
  flex: none;
  width: calc(var(--u) * 40);
  height: calc(var(--u) * 40);
  border-radius: calc(var(--u) * 10);
  background: #fff;
  box-shadow:
    inset 0 calc(var(--u) * -1) 0 #cbcac9,
    inset 0 calc(var(--u) * -2) 0 #e7e6e6,
    0 calc(var(--u) * 10) calc(var(--u) * 16) var(--brown-shadow);
}

.check input:checked + .check-box::after {
  content: '';
  position: absolute;
  top: calc(var(--u) * 6);
  left: calc(var(--u) * 14);
  width: calc(var(--u) * 12);
  height: calc(var(--u) * 21);
  border: solid var(--red);
  border-width: 0 calc(var(--u) * 5) calc(var(--u) * 5) 0;
  transform: rotate(45deg);
}

.check input:focus-visible + .check-box {
  outline: calc(var(--u) * 4) solid rgba(38, 48, 104, 0.55);
}

.check.is-invalid .check-box {
  outline: calc(var(--u) * 4) solid var(--red);
}

.check a[href] {
  color: inherit;
  text-decoration: underline;
}

/* Bots only */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Red button: same shape, bevel and shadow as the export, with real text so it stays sharp */
.btn {
  position: relative;
  display: block;
  width: 100%;
  height: calc(var(--u) * 82);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-family: 'Archivo Button', 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  font-size: calc(var(--u) * 21.2);
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 calc(var(--u) * 1) calc(var(--u) * 1) rgba(120, 16, 16, 0.5);
  box-shadow:
    inset 0 calc(var(--u) * 1) 0 #e94141,
    inset 0 calc(var(--u) * 2) 0 #ed6464,
    inset 0 calc(var(--u) * -1) 0 #b61515,
    inset 0 calc(var(--u) * -2) 0 #cf1818,
    var(--field-shadow);
  transition: transform 0.08s ease-out, filter 0.08s ease-out;
}

.btn:active {
  transform: translateY(calc(var(--u) * 2));
  filter: brightness(0.95);
}

.btn:focus-visible {
  outline: calc(var(--u) * 4) solid var(--navy);
  outline-offset: calc(var(--u) * 2);
}

.btn[disabled] {
  cursor: default;
  filter: saturate(0.75);
}

.btn.is-loading {
  color: transparent;
  text-shadow: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--u) * 34);
  height: calc(var(--u) * 34);
  margin: calc(var(--u) * -17) 0 0 calc(var(--u) * -17);
  border: calc(var(--u) * 4) solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* The gap holds the validation message, which can run to two lines */
.form > .btn {
  margin-top: calc(var(--u) * 74);
}

/* Validation message, in the gap above the button */
.form-error {
  position: absolute;
  right: 0;
  bottom: calc(var(--u) * 92);
  left: 0;
  margin: 0;
  color: #fff;
  font-size: calc(var(--u) * 22);
  font-weight: 700;
  line-height: calc(var(--u) * 26);
  text-align: center;
  text-shadow:
    0 0 calc(var(--u) * 5) rgba(120, 16, 16, 0.9),
    0 calc(var(--u) * 1) calc(var(--u) * 2) rgba(120, 16, 16, 0.9);
}

/* Legal line under the button */
.form-note {
  flex: none;
  width: calc(var(--u) * 550);
  margin: calc(var(--u) * 28) 0 0 calc(var(--u) * 85);
  color: #fff;
  font-size: calc(var(--u) * 20);
  line-height: calc(var(--u) * 25);
  text-align: center;
  text-shadow:
    0 0 calc(var(--u) * 4) rgba(40, 16, 0, 0.95),
    0 calc(var(--u) * 1) calc(var(--u) * 2) rgba(40, 16, 0, 0.95);
}

/* Small text link: cookie preferences stay reachable from every screen */
.link-btn {
  display: block;
  flex: none;
  margin: 0 auto;
  padding: calc(var(--u) * 10) calc(var(--u) * 20);
  border: 0;
  background: none;
  color: var(--navy);
  font-size: calc(var(--u) * 19);
  line-height: calc(var(--u) * 24);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.link-btn.on-photo {
  height: calc(var(--u) * 70);
  padding-top: calc(var(--u) * 26);
  color: #fff;
  text-shadow:
    0 0 calc(var(--u) * 4) rgba(40, 16, 0, 0.95),
    0 calc(var(--u) * 1) calc(var(--u) * 2) rgba(40, 16, 0, 0.95);
}

/* Terms and thank-you screen, fully covering the form as in the design */
.screen {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--w);
  transform: translateX(-50%);
}

/* The form is hidden behind the terms screen, its scroll position stays in place */
.stage.is-covered {
  visibility: hidden;
}

.screen > .logo {
  margin-top: calc(var(--u) * 36);
  animation: fade-in 0.25s ease-out both;
}

.sheet {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-top: calc(var(--u) * 28);
  border-radius: calc(var(--u) * 58) calc(var(--u) * 58) 0 0;
  background: #fff;
  box-shadow: 0 0 calc(var(--u) * 62) rgba(120, 16, 16, 0.39);
  animation: sheet-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes sheet-up {
  from {
    transform: translateY(35%);
    opacity: 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.sheet-close {
  position: absolute;
  top: calc(var(--u) * 14);
  right: calc(var(--u) * 26);
  z-index: 2;
  width: calc(var(--u) * 60);
  height: calc(var(--u) * 60);
  padding: calc(var(--u) * 18);
  border: 0;
  background: none;
}

.sheet-close svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--navy);
  stroke-width: 2.4;
  stroke-linecap: round;
}

.sheet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--u) * 64) calc(var(--u) * 89) calc(var(--u) * 12) calc(var(--u) * 87);
}

.sheet-title {
  margin-left: calc(var(--u) * -3);
  font-size: calc(var(--u) * 32.4);
  line-height: calc(var(--u) * 36);
  outline: 0;
  white-space: nowrap;
}

.legal {
  margin-top: calc(var(--u) * 24);
  color: var(--navy);
  font-size: calc(var(--u) * 23);
  line-height: calc(var(--u) * 27.6);
}

.legal p {
  margin: 0 0 calc(var(--u) * 15.5);
}

.legal p.after-blank {
  margin-top: calc(var(--u) * 27.6);
}

.legal ul {
  margin: 0 0 calc(var(--u) * 15.5);
  padding: 0;
  list-style: none;
}

.legal li {
  position: relative;
  margin-bottom: calc(var(--u) * 14.5);
  padding-left: calc(var(--u) * 27);
}

.legal li:last-child {
  margin-bottom: 0;
}

.legal li::before {
  content: '';
  position: absolute;
  top: calc(var(--u) * 11);
  left: calc(var(--u) * 2);
  width: calc(var(--u) * 6);
  height: calc(var(--u) * 6);
  border-radius: 50%;
  background: var(--navy);
}

.legal strong {
  font-weight: 700;
}

.legal a[href],
.consent a[href] {
  color: inherit;
  text-decoration: underline;
}

.sheet-actions {
  position: relative;
  flex: none;
  padding: 0 calc(var(--u) * 85);
}

.sheet-error {
  margin: 0;
  color: var(--red);
  font-size: calc(var(--u) * 22);
  font-weight: 700;
  line-height: calc(var(--u) * 27);
  text-align: center;
}

.sheet-error:not(:empty) {
  margin-bottom: calc(var(--u) * 14);
}

.sheet .link-btn {
  height: calc(var(--u) * 70);
  padding-top: calc(var(--u) * 26);
}

.sheet-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: calc(var(--u) * 110);
  text-align: center;
}

.sheet-thanks .sheet-title {
  margin-left: 0;
  font-size: calc(var(--u) * 52);
  line-height: calc(var(--u) * 60);
}

.sheet-thanks .legal {
  margin-top: calc(var(--u) * 28);
  font-size: calc(var(--u) * 27);
  line-height: calc(var(--u) * 35);
}

.thanks-actions {
  width: 100%;
  margin-top: calc(var(--u) * 32);
}

.share-status {
  margin: calc(var(--u) * 14) 0 0;
  color: var(--navy);
  font-size: calc(var(--u) * 22);
  font-weight: 700;
  line-height: calc(var(--u) * 27);
}

.share-status:empty {
  display: none;
}

.site-link {
  display: block;
  margin-top: calc(var(--u) * 28);
  padding: calc(var(--u) * 10) 0;
  color: var(--navy);
  font-size: calc(var(--u) * 23);
  line-height: calc(var(--u) * 28);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Cookie consent */
.consent {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(38, 20, 0, 0.45);
  animation: fade-in 0.2s ease-out both;
}

.consent-card {
  width: var(--w);
  max-height: 100%;
  overflow-y: auto;
  padding: calc(var(--u) * 48) calc(var(--u) * 60) calc(var(--u) * 52);
  border-radius: calc(var(--u) * 58) calc(var(--u) * 58) 0 0;
  background: #fff;
  box-shadow: 0 0 calc(var(--u) * 62) rgba(120, 16, 16, 0.39);
  animation: sheet-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.consent-title {
  font-size: calc(var(--u) * 32.4);
  line-height: calc(var(--u) * 36);
  outline: 0;
}

.consent p {
  margin: calc(var(--u) * 20) 0 0;
  color: var(--navy);
  font-size: calc(var(--u) * 23);
  line-height: calc(var(--u) * 29);
}

.consent a:not([href]) {
  display: none;
}

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--u) * 20);
  margin-top: calc(var(--u) * 34);
}

.consent .btn {
  box-shadow:
    inset 0 calc(var(--u) * 1) 0 #e94141,
    inset 0 calc(var(--u) * 2) 0 #ed6464,
    inset 0 calc(var(--u) * -1) 0 #b61515,
    inset 0 calc(var(--u) * -2) 0 #cf1818;
}

.noscript {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  margin: 0;
  padding: 12px 16px;
  background: #fff;
  color: var(--navy);
  font-size: 15px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .sheet,
  .consent,
  .consent-card,
  .screen > .logo {
    animation: none;
  }

  .btn {
    transition: none;
  }
}
