/* ==========================================================================
   Impruvis campaign landing page
   ========================================================================== */

/* ── Fonts ──────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Aaux Next";
  src: url("../fonts/aauxnextmdwebfont.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Aaux Next";
  src: url("../fonts/aauxnextbdwebfont.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Aaux Next";
  src: url("../fonts/AauxNextBlk.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Myriad Pro Cond";
  src: url("../fonts/MyriadPro-Cond.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */

:root {
  --purple: #8b45a6;
  --purple-dark: #522972;
  --purple-darker: #401f5a;
  --pink: #e31664;

  --ink: var(--purple-dark);
  --placeholder: #b7b0bb;
  --text-on-dark: #fff;

  --font-display: "Aaux Next", "Segoe UI", system-ui, sans-serif;
  --font-myriad:
    "Myriad Pro Cond", "Aaux Next", "Segoe UI", system-ui, sans-serif;

  --page-bg: linear-gradient(180deg, #8b45a6 0%, #7a3b93 100%);
  --disclaimer-bg: #fff;
  --disclaimer-text: #3f2e7c;

  /* Key visual aspect ratios — match your artwork so the buttons stay put. */
  --kv-ratio-desktop: 1280 / 767;
  --kv-ratio-mobile: 428 / 845;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-weight: 500;
  overflow-x: hidden;
  max-width: 100vw;
  background: #fff;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
}

.kv-wrap {
  position: relative;
  width: 100%;
}

.kv {
  position: relative;
  width: 100%;
  aspect-ratio: var(--kv-ratio-desktop);
  background: url("../img/bg-desktop.svg") no-repeat center;
  background-size: cover;
}

/*
 * Invisible click target sitting on top of the artwork. Percentages are relative
 * to .kv, so it tracks the key visual at every breakpoint.
 */
.kv-hotspot {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 10%;
  height: 7%;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.kv-buttons {
  position: absolute;
  bottom: 20%;
  left: 10%;
  display: flex;
  align-items: center;
  gap: 1.5vw;
}

.disclaimer {
  width: 100%;
  padding: 1.6vh 3vw;
  background: var(--disclaimer-bg);
}

.disclaimer p {
  font-family: var(--font-myriad);
  font-size: clamp(11px, 0.8vw, 16px);
  color: var(--disclaimer-text);
  margin: 0;
  line-height: 1.5;
  text-align: justify;
}

/* ── Landing buttons ────────────────────────────────────────────────────── */

.button {
  display: block;
  width: 15vw;
  line-height: 5vh;
  padding: 0;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(14px, 1vw, 18px);
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease-in-out;
}

.button:hover {
  transform: scale(1.05);
}

.button.primary {
  border: 2px solid var(--purple-dark);
  background-color: var(--purple-dark);
  color: var(--text-on-dark);
}

.button.secondary {
  border: 2px solid var(--purple);
  background-color: #fff;
  color: var(--purple-dark);
}

.button.secondary:hover {
  background-color: #faf5fc;
}

/* ── Modal shell ────────────────────────────────────────────────────────── */

/* The modal is a full white page, not a card floating on a scrim. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  padding: 0;
  background: #fff;
}

.modal[hidden] {
  display: none;
}

/*
 * `margin: auto` centres the panel on both axes while still letting a tall form
 * scroll from its top — flex `align-items: center` would clip the overflow.
 */
.modal__content {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  margin: auto;
  padding: 6rem 2rem 4rem;
}

.modal__close {
  position: absolute;
  top: 1.6rem;
  right: 2rem;
  z-index: 2;
  background: none;
  border: none;
  padding: 0.2rem;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--purple-dark);
  cursor: pointer;
}

/* Pin the form's close button to the page corner, not the content column. */
.modal__content > .modal__close {
  position: fixed;
  top: 1.8rem;
  right: 2.5rem;
}

.modal__close--light {
  color: #fff;
}

/* ── Form ───────────────────────────────────────────────────────────────── */

/* Title stays on Aaux Next Black while the form body runs on Myriad Pro. */
.form-title {
  margin: 0 0 2.2rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-align: center;
  text-transform: uppercase;
  color: var(--purple-dark);
}

.step-lead {
  margin: -1.4rem 0 2rem;
  font-family: var(--font-myriad);
  font-size: 15px;
  text-align: center;
  color: var(--purple-dark);
}

.step-panel {
  display: none;
  flex-direction: column;
}

.step-panel.is-active {
  display: flex;
}

.step-panel[hidden] {
  display: none;
}

.form-row {
  display: grid;
  gap: 1rem 2.2rem;
  margin-bottom: 1.4rem;
}

.form-row--two {
  grid-template-columns: 1fr 1fr;
}

.form-row--narrow {
  width: 72%;
  margin-left: auto;
  margin-right: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

/*
 * Only one Myriad weight is supplied, so 700 is a synthesised bold. Nudging the
 * size and tracking keeps the labels reading as heavy as the Aaux originals.
 */
.field label {
  padding-left: 1.2rem;
  font-family: var(--font-myriad);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.015em;
  color: var(--purple-dark);
}

.field input {
  width: 100%;
  padding: 13px 22px;
  border: 3px solid var(--purple);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-myriad);
  font-weight: 400;
  font-size: 15px;
  color: var(--purple-dark);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.field input::placeholder {
  color: var(--placeholder);
  font-weight: 400;
}

.field input:focus {
  border-color: var(--purple-dark);
  box-shadow: 0 0 0 3px rgba(139, 69, 166, 0.15);
}

.field input.error {
  border-color: var(--pink);
}

/* Keep the native date control on the same baseline as the text inputs. */
.field input[type="date"] {
  min-height: 51px;
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}

/* ── Upload ─────────────────────────────────────────────────────────────── */

.upload-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.6rem 0 0.4rem;
}

.file-upload-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

/* The upload button and its fine print stay on Aaux Next. */
#receipt-label {
  font-family: var(--font-display);
}

.upload-hint {
  width: 70%;
  margin: 1rem auto 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.4;
  text-align: center;
  color: var(--purple-dark);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  width: min(360px, 60%);
  padding: 14px 28px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-myriad);
  font-weight: 700;
  font-size: clamp(16px, 1.4vw, 21px);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.btn--primary {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.btn--primary:hover {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
}

.btn--dark {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
  color: #fff;
}

.btn--dark:hover:not(:disabled) {
  background: var(--purple-darker);
  border-color: var(--purple-darker);
}

.btn--ghost {
  background: transparent;
  border-color: var(--purple);
  color: var(--purple-dark);
}

.btn--ghost:hover:not(:disabled) {
  background: rgba(139, 69, 166, 0.08);
}

.btn--submit {
  display: block;
  margin: 2.2rem auto 0;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary.error {
  border-color: var(--pink);
}

.actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.2rem;
}

.actions .btn {
  width: auto;
  min-width: 200px;
}

/* ── Checkboxes ─────────────────────────────────────────────────────────── */

.checks {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 82%;
  margin: 1.8rem auto 0;
}

.check {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 0.9rem;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-myriad);
  font-size: 14px;
  line-height: 1.35;
  color: var(--purple-dark);
}

.check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  position: relative;
  width: 28px;
  height: 28px;
  margin-top: -1px;
  border: 3px solid var(--purple);
  border-radius: 7px;
  flex-shrink: 0;
}

.checkmark::after {
  content: "";
  position: absolute;
  display: none;
  left: 8px;
  top: 2px;
  width: 6px;
  height: 14px;
  border: solid var(--purple-dark);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.check input:checked ~ .checkmark::after {
  display: block;
}

.check a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.check a:hover {
  text-decoration: underline;
}

.check.error .checkmark {
  border-color: var(--pink);
}

/* ── Loader ─────────────────────────────────────────────────────────────── */

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 0 1rem;
  text-align: center;
  font-family: var(--font-myriad);
  font-weight: 700;
  color: var(--purple-dark);
}

.loader[hidden] {
  display: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(139, 69, 166, 0.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 3s;
  }
  .button:hover {
    transform: none;
  }
}

/* ── Result modal ───────────────────────────────────────────────────────── */

.message-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(760px, 94vw);
  min-height: min(470px, 70vh);
  margin: auto;
  padding: 3rem 3.5rem;
  border-radius: 34px;
  text-align: center;
  color: #fff;
  background: var(--purple);
}

.message-card.is-error {
  background: var(--pink);
}

.message-card.is-success {
  background: var(--purple);
}

.message-text {
  margin: 0;
  font-weight: 700;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.5;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 1000px) {
  .kv {
    aspect-ratio: var(--kv-ratio-mobile);
    background-image: url("../img/bg-mobile.svg");
  }

  /*
   * Out of the artwork and into their own strip under it. The strip is white so
   * it reads as one block with the disclaimer below rather than a purple band.
   */
  .kv-wrap {
    background: #fff;
  }

  .kv-buttons {
    position: static;
    flex-direction: column;
    align-items: stretch;
    width: 84%;
    margin: 0 auto;
    padding: 3.5vh 0 1vh;
    gap: 1.6vh;
  }

  .kv-hotspot {
    top: 55%;
    width: 30%;
    height: 5%;
  }

  .button {
    width: 100%;
    font-size: 0.9rem;
  }

  .disclaimer {
    padding: 2.5vh 5vw;
  }

  .disclaimer p {
    font-size: clamp(11px, 3.2vw, 15px);
  }

  .modal__content {
    padding: 5rem 1.5rem 3rem;
  }

  .modal__close,
  .modal__content > .modal__close {
    top: 1.1rem;
    right: 1.2rem;
    font-size: 2.2rem;
  }

  .form-row--two {
    grid-template-columns: 1fr;
  }

  .form-row--narrow,
  .checks,
  .upload-hint {
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .actions .btn {
    width: 100%;
  }

  .message-card {
    width: 92vw;
    min-height: 60vh;
    padding: 2.5rem 1.8rem;
    border-radius: 24px;
  }
}
