/* ==========================================================================
   Fonts — self-hosted, matches capri/frontend/src/assets/fonts
   ========================================================================== */

@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/figtree/Figtree-Regular.woff2") format("woff2"),
       url("../assets/fonts/figtree/Figtree-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/figtree/Figtree-Medium.woff2") format("woff2"),
       url("../assets/fonts/figtree/Figtree-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/figtree/Figtree-SemiBold.woff2") format("woff2"),
       url("../assets/fonts/figtree/Figtree-SemiBold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/figtree/Figtree-Bold.woff2") format("woff2"),
       url("../assets/fonts/figtree/Figtree-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk/SpaceGrotesk-Regular.woff2") format("woff2"),
       url("../assets/fonts/space-grotesk/SpaceGrotesk-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}


:root {
  /* Colour: brand palette (exact matches to _colours.scss) */
  --color-brand-black: #1d1d1d;          /* Ink — body text */
  --color-brand-white: #fffef7;          /* Cream — T&Cs box + card base */
  --color-brand-tangerine-50: #fdf5ee;   /* Light Orange — page background */
  --color-brand-blue-900: #01156b;       /* Navy — headline, checkbox fill, section headers */
  --color-brand-orange-400: #ff4a21;     /* Orange — primary CTA, accent dot */

  /* Colour: new for this page (not yet in _colours.scss) */
  --color-navy-bright: #2538bc;          /* Progress gradient end-stop (blue side) */
  --color-orange-deep: #742519;          /* Reserved for emphasis/warning states */
  --color-blue-pale: #dcd5fc;            /* Scrollbar thumb */
  --color-cta-disabled-bg: #cfcabd;      /* CTA background while locked */

  --gradient-progress: linear-gradient(90deg, var(--color-navy-bright), var(--color-brand-orange-400));

  /* Typography families */
  --font-heading: "Space Grotesk", Arial, sans-serif;
  --font-body: "Figtree", Arial, sans-serif;

  /* Spacing scale ($spacing-* in _spacing.scss) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-4-5: 18px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-12: 48px;

  /* Border radius ($border-radius-* in _spacing.scss) */
  --radius-sm: 4px;
  --radius-lg: 8px;
  --radius-2xl: 16px;

  /* Shadow ($shadow-lg in _effects.scss) */
  --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --content-max-width: 620px;
  --terms-box-height: 340px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-brand-tangerine-50);
  color: var(--color-brand-black);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--color-navy-bright);
  outline-offset: 2px;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
}

.shell {
  width: 100%;
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-8);
}

/* ==========================================================================
   Header / intro
   ========================================================================== */

.brand-row {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.logo { width: 100%; max-width: 320px; height: auto; }

.intro {
  width: 100%;
  padding: 0 var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  text-align: left;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-brand-orange-400);
}

.headline {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--color-brand-blue-900);
}

.lede {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-brand-black);
  opacity: 0.75;
}

/* ==========================================================================
   Card
   ========================================================================== */

.card {
  width: 100%;
  background: var(--color-brand-white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Progress bar */

.progress-track {
  margin: 0 var(--space-1);
  height: 4px;
  background: rgba(1, 21, 107, 0.08);
  border-top-left-radius: var(--radius-2xl);
  border-top-right-radius: var(--radius-2xl);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-progress);
  transition: width 0.1s linear;
  border-top-left-radius: var(--radius-2xl);
  border-top-right-radius: var(--radius-2xl);
}

/* Terms box */

.terms-box {
  height: var(--terms-box-height);
  overflow-y: auto;
  padding: 0; 
  scrollbar-color: var(--color-blue-pale) transparent;
}

.terms-box-inner {
  padding: var(--space-6) var(--space-8) var(--space-3);
}

.terms-temp {
  padding-bottom: var(--space-4);
  font-style: italic;
  color: var(--color-brand-black);
  opacity: 0.5;
}

.section-header {
  margin: var(--space-6) 0 var(--space-2);
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--color-brand-blue-900);
}

.terms-box h3.section-header:first-of-type {
  margin-top: 0;
}

.terms-box p {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--color-brand-black);
}

.terms-list {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--color-brand-black);
}

.terms-list li {
  margin-bottom: var(--space-2);
  padding-left: var(--space-1);
}

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

.terms-list li::marker {
  color: var(--color-brand-blue-900);
}

/* The source document bolds most of its body copy. Weight only — tinting whole
   bolded paragraphs navy would drown the page. */
.terms-box strong {
  font-weight: 600;
}

/* Closing acknowledgement — the line the checkbox below is agreeing to. */
.terms-attestation {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(29, 29, 29, 0.1);
}

/* Divider */

.divider {
  border: none;
  border-top: 1px solid rgba(29, 29, 29, 0.1);
  margin: 0;
}

/* Agree row */

.agree-row {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-8);
  gap: var(--space-2);
  background: #fbfaf5;
}

.agree-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: not-allowed;
}

.agree-label.is-unlocked {
  cursor: pointer;
}

.checkbox-wrap {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.checkbox-wrap input[type="checkbox"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: not-allowed;
}

.checkbox-wrap input[type="checkbox"]:not(:disabled) {
  cursor: pointer;
}

.checkbox-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(29, 29, 29, 0.25);
  background: var(--color-brand-white);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.check-icon {
  width: 12px;
  height: 12px;
  color: var(--color-brand-white);
  opacity: 0;
  transition: opacity 0.1s ease;
}

/* Unlocked (scroll complete) but unchecked: navy border */
.agree-label.is-unlocked .checkbox-visual {
  border-color: var(--color-brand-blue-900);
}

/* Checked state */
.checkbox-wrap input[type="checkbox"]:checked + .checkbox-visual {
  background: var(--color-brand-blue-900);
  border-color: var(--color-brand-blue-900);
}
.checkbox-wrap input[type="checkbox"]:checked + .checkbox-visual .check-icon {
  opacity: 1;
}

.agree-text {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-brand-black);
}

.agree-text strong {
  font-weight: 600;
}

.hint {
  display: inline-block;
  margin: 0 0 0 32px;
  padding: 2px 0;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--color-orange-deep);
}

.hint.is-hidden {
  display: none;
}

/* CTA */

.cta-row {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-6) var(--space-8) var(--space-8);
}

.cta {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--color-brand-white);
  background: var(--color-cta-disabled-bg);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.cta:disabled {
  cursor: not-allowed;
}

.cta.is-active {
  background: var(--color-brand-orange-400);
  cursor: pointer;
}

.cta.is-active:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -4px rgba(255, 74, 33, 0.45);
}

.cta.is-active:active {
  transform: translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.site-footer p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.3;
  color: var(--color-brand-black);
  opacity: 0.45;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
  .page { padding: var(--space-8) var(--space-4); }
  .shell { gap: var(--space-6); }
  .card { gap: 0; }
  .card-body { padding: 0 var(--space-5) var(--space-6); }
  .terms-box-inner { padding: var(--space-5) var(--space-5) 0; }
  .headline { font-size: 26px; }
  .cta-row { justify-content: stretch; }
  .cta { width: 100%; text-align: center; }
  .intro { padding: 0 var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill,
  .checkbox-visual,
  .check-icon,
  .cta {
    transition: none;
  }
}
