/* ---------- Tokens (DESIGN.md) ---------- */
:root {
  --color-1: #000000;   /* text primary / page bg */
  --color-2: #999999;   /* text secondary */
  --color-3: #03E95A;   /* accent */
  --color-4: #CCCCCC;   /* text light */
  --color-5: #FFFFFF;   /* text light */
  --color-error: #FF4D4F; /* error (6.5:1 on black) */
  --surface-overlay: rgb(0 0 0 / 0.75); /* color-1 at 75% */

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --text-xs: 12px;
  --text-sm: 16px;
  --text-base: 18px;
  --text-lg: 20px;
  --text-xl: 39px;
  --text-2xl: 48px;

  --lh-2xl: 60px;
  --lh-xl: 48.75px;
  --lh-base: 27px;
  --lh-xs: 18px;
  --lh-sm: 24px;
  --lh-lg: 30px;

  --space-1: 5px;
  --space-2: 6px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 20px;
  --space-7: 24px;
  --space-8: 48px;
  --space-9: 60px;
  --space-10: 111px;

  --radius-sm: 24px 72px 72px 24px;
  --radius-full: 50%;
  --radius-lg: 60px;
  --radius-xl: 116px;

  --transition-fast: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-1);
  color: var(--color-5);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-base);
}

:focus-visible { outline: 3px solid var(--color-3); outline-offset: 3px; }

/* Container: same widths as the reference (Bootstrap 5) */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-4);
}
@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 1000px; } }
@media (min-width: 1200px) { .container { max-width: 1200px; } }
@media (min-width: 1400px) { .container { max-width: 1360px; } }

/* ---------- Nav ---------- */
.nav .container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  padding-top: var(--space-5);
  padding-bottom: var(--space-5);
}
.brand {
  font-size: var(--text-lg);
  line-height: var(--lh-lg);
  font-weight: 700;
  color: var(--color-5);
  text-decoration: none;
}
.brand { display: inline-flex; align-items: center; }
.brand img { display: block; height: 26px; width: auto; }
.counter {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-base);
  line-height: 16px; /* top edge of dot and text lines up with the logo's top */
}
.counter strong { font-weight: 700; }
.dot {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--color-3);
  animation: blink 1s 1s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Main ---------- */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 0 var(--space-3);
}
h1 {
  text-align: center;
  font-size: var(--text-2xl);
  line-height: var(--lh-2xl);
  font-weight: 700;
  margin: 0 0 var(--space-5);
  text-transform: capitalize;
}

/* Hero: photo box with the card in the right half (desktop, >= 992px) */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  aspect-ratio: 4096 / 2341; /* same ratio as the photo, so nothing is cropped */
  border-radius: var(--radius-xl);
  background:
    url("../images/hero.webp") center / cover no-repeat,
    linear-gradient(135deg, var(--color-2), var(--color-1));
}

.hero-photo { display: none; }
html { scroll-behavior: smooth; }

/* Right column = half the box minus 48px left gutter; card is 80% of it, centered */
.card {
  grid-column: 2;
  width: calc((100% - var(--space-8)) * 0.8);
  margin-left: calc(var(--space-8) + (100% - var(--space-8)) * 0.1);
  background: var(--surface-overlay);
  border-radius: var(--radius-sm);
  padding: var(--space-8);
}
.card h2 {
  font-size: var(--text-xl);
  line-height: var(--lh-xl);
  font-weight: 700;
  margin: 0 0 var(--space-6);
}

/* ---------- Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  padding: var(--space-3) var(--space-5);
  background: var(--color-3);
  color: var(--color-1);
  border: 2px solid var(--color-3);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-fast);
}
.btn:hover { background: var(--color-1); color: var(--color-3); }
.btn:active { background: var(--color-5); border-color: var(--color-5); color: var(--color-1); }
.btn[disabled] {
  background: var(--color-2);
  border-color: var(--color-2);
  color: var(--color-1);
  cursor: not-allowed;
}

/* ---------- Signup flow ---------- */
.signup label {
  display: block;
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-6);
  background: var(--color-1);
  color: var(--color-5);
  border: 1px solid var(--color-2);
  border-radius: var(--radius-lg);
  font: inherit;
  font-size: var(--text-sm);
  transition: var(--transition-fast);
}
.input::placeholder { color: var(--color-2); }
.input:hover { border-color: var(--color-4); }
.input:focus-visible { border-color: var(--color-3); outline-offset: 2px; }
.field { position: relative; }
.field .input { padding-right: var(--space-9); }
.check {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%) scale(0.6);
  color: var(--color-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
}
.field.is-valid .check { opacity: 1; transform: translateY(-50%) scale(1); }
.field.is-valid .input { border-color: var(--color-3); }
.input[aria-invalid="true"] { border: 2px solid var(--color-error); }
.input[aria-invalid="true"]:focus-visible { outline-color: var(--color-error); }
.field-msg {
  min-height: var(--lh-xs);
  margin: var(--space-3) var(--space-6) var(--space-4);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  font-weight: 600;
  color: var(--color-error);
}
.consent {
  margin: var(--space-4) 0 0;
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  color: var(--color-2);
}
.card.done h2 { font-size: 28px; line-height: 35px; margin-bottom: var(--space-5); }
.done p { color: var(--color-4); font-size: var(--text-xs); line-height: var(--lh-xs); margin: 0 0 var(--space-4); }
.done strong { color: var(--color-5); word-break: break-all; }
.done:focus { outline: none; }
.done .btn { text-align: center; text-decoration: none; }
.steps {
  margin: 0 0 var(--space-5);
  padding-left: var(--space-5);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}
.steps li { margin-bottom: var(--space-2); }
.steps li::marker { color: var(--color-3); font-weight: 700; }
/* No JS: skip the age button, show the form directly */
.no-js #step-age { display: none; }
.no-js #signup-form { display: block; }

/* ---------- Footer ---------- */
footer {
  margin: var(--space-7) 0;
  padding: var(--space-5) 0;
  text-align: center;
  font-size: 11px;
  line-height: 16px;
  color: var(--color-2);
}
footer p { margin: 0 auto var(--space-5); }
.links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 0 var(--space-5);
  padding: 0;
}
.links a {
  display: block;
  padding: var(--space-2);
  color: var(--color-4);
  text-decoration: none;
  transition: var(--transition-fast);
}
.links a:hover { color: var(--color-3); }

/* ---------- Responsive (same breakpoints as the reference) ---------- */
@media (min-width: 768px) {
  main { padding-bottom: var(--space-8); }
  .hero { margin-bottom: var(--space-8); }
  footer p { max-width: 50%; }
}

/* Tablet & mobile: portrait photo on top (80% wide), card below */
@media (max-width: 991.98px) {
  h1 { font-size: var(--text-xl); line-height: var(--lh-xl); margin: var(--space-6) 0; }
  .hero {
    display: block;
    aspect-ratio: auto;
    border-radius: 0;
    background: none;
  }
  .hero-photo {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 80%;
    aspect-ratio: 4 / 5; /* portrait */
    margin: 0 auto var(--space-5);
    padding-bottom: var(--space-6);
    border-radius: var(--space-7);
    background:
      linear-gradient(172deg, rgb(0 0 0 / 0) 52%, var(--color-1) 97%),
      url("../images/hero-p.webp") center / cover no-repeat,
      linear-gradient(135deg, var(--color-2), var(--color-1));
  }
  .scroll-down { display: block; line-height: 0; border-radius: var(--radius-full); }
  .card {
    width: auto;
    max-width: 80%;
    margin: 0 auto;
    padding: var(--space-8) 0;
  }
}

@media (max-width: 768px) {
  .card { max-width: 100%; }
  .card h2 { text-align: center; }
  .nav .container { flex-direction: column; align-items: center; gap: var(--space-2); }
  .links li { width: 100%; }
}

@media (max-width: 430px) {
  h1 { font-size: 28px; line-height: 35px; margin: var(--space-4) 0; } /* keeps the photo and arrow on the first screen */
  .hero-photo { width: 100%; padding-bottom: var(--space-3); }
  .card { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot { animation: none; }
  * { transition: none !important; }
}
