/* Shared base for the web form, the final screen and the legal pages (Figma: Form 4054-3329, Info and Legal 4030-2300). */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/manrope-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format('woff2');
}

:root {
  --bg: #0e1830;
  --surface: #14213d;
  --surface-2: #1f3160;
  --surface-3: #2c3d70;
  --accent: #8ca2ff;
  --text: #fff4e0;
  --text-2: #b8c2d9;
  --text-3: #95a1bf;
  --line: #7280a6;
  --check-line: #8390b2;
  --amber: #f2a541;
  --cta-text: #111c35;
  --error: #f0787b;
  --scrim: rgba(10, 14, 24, .72);
  --gutter: max(16px, calc((100% - 448px) / 2));
  --font-display: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg) url(img/doodles.webp) center top / 100% auto no-repeat;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 600px) {
  body { background-size: 600px auto; }
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
svg { display: block; flex: none; }
img { display: block; max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Landing Header */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: calc(4px + env(safe-area-inset-top)) var(--gutter) 4px;
}
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}
.brand-logo img, .info-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-name { font: 600 17px/22px var(--font-display); letter-spacing: -.2px; color: var(--text); }

/* Main Button */
.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8be5e 0%, #e6982f 100%);
  color: var(--cta-text);
  font: 600 16px/21px var(--font-body);
  letter-spacing: -.15px;
  text-align: center;
  text-decoration: none;
  touch-action: manipulation;
  transition: filter .12s ease, transform .12s ease;
}
.cta:active { filter: brightness(.93); transform: scale(.99); }
.cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Full-height screens with the body centred under the header (Loading, Submitted) */
.screen { display: none; flex-direction: column; width: 100%; min-height: 100vh; min-height: 100dvh; }
.screen.is-active { display: flex; }
.center-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 max(24px, calc((100% - 448px) / 2)) max(96px, calc(env(safe-area-inset-bottom) + 72px));
  text-align: center;
}
.center-title { font: 700 28px/34px var(--font-display); letter-spacing: -.4px; color: var(--text); }
.center-sub { font: 400 16px/21px var(--font-body); letter-spacing: -.15px; color: var(--text-2); }

/* Loader */
.loading-body { gap: 24px; }
.loading-text { display: flex; flex-direction: column; gap: 8px; }
.spinner { width: 72px; height: 72px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

/* Legal pages (Info sheet screens rendered as standalone web pages) */
.legal-sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  min-height: calc(100vh - 8px - env(safe-area-inset-top));
  min-height: calc(100dvh - 8px - env(safe-area-inset-top));
  margin: calc(8px + env(safe-area-inset-top)) auto 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
}
/* index.php keeps the brand header above the sheet */
.brand + .legal-sheet {
  min-height: calc(100vh - 48px - env(safe-area-inset-top));
  min-height: calc(100dvh - 48px - env(safe-area-inset-top));
  margin-top: 8px;
}
.legal-head { display: flex; align-items: center; gap: 4px; min-height: 64px; padding: 16px 16px 4px; }
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 22px;
}
.back-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.legal-title { min-width: 0; font: 700 22px/28px var(--font-display); letter-spacing: -.3px; color: var(--text); }
.legal-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 12px 16px max(32px, calc(env(safe-area-inset-bottom) + 16px));
}
.legal-body.is-compact { gap: 16px; }
.legal-block h2 { margin-bottom: 8px; font: 600 17px/22px var(--font-display); letter-spacing: -.2px; color: var(--text); }
.legal-block p,
.legal-block li { font: 400 15px/24px var(--font-body); letter-spacing: -.1px; color: var(--text-2); overflow-wrap: break-word; }
.legal-block p + p,
.legal-block p + ul,
.legal-block ul + p { margin-top: 12px; }
.legal-block ul { padding-left: 22px; }
.legal-block li + li { margin-top: 4px; }
.legal-block strong { font-weight: 700; }
.legal-block a { color: var(--amber); text-decoration: none; overflow-wrap: anywhere; }
.legal-block a:hover { text-decoration: underline; }

.faq-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px max(32px, calc(env(safe-area-inset-bottom) + 16px)); }
.faq-item { border-radius: 12px; background: var(--surface-2); }
.faq-item summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  font: 600 16px/21px var(--font-body);
  letter-spacing: -.15px;
  color: var(--text);
  list-style: none;
  cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.faq-q { flex: 1; min-width: 0; }
.faq-item summary svg { transition: transform .2s ease; }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-a { margin-top: -8px; padding: 0 16px 16px; font: 400 15px/24px var(--font-body); letter-spacing: -.1px; color: var(--text-2); overflow-wrap: break-word; }
.faq-a strong { font-weight: 700; }
.faq-a a { color: var(--amber); text-decoration: none; }
.faq-a a:hover { text-decoration: underline; }

.pinned-cta {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 24px 16px max(16px, calc(env(safe-area-inset-bottom) + 8px));
  background: linear-gradient(180deg, rgba(20, 33, 61, 0) 0, var(--surface) 24px);
}

/* Info page (Figma: Info sheet 4071-4457) */
.info-body { display: flex; flex-direction: column; gap: 8px; padding: 32px 16px max(32px, calc(env(safe-area-inset-bottom) + 16px)); }
.info-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 8px; }
.info-mark { position: relative; width: 120px; height: 96px; }
.info-glow { position: absolute; top: 8px; left: 5px; width: 110px; height: 80px; border-radius: 50%; background: var(--accent); filter: blur(16px); }
.info-logo {
  position: absolute;
  top: 8px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 19.2px;
  overflow: hidden;
  background: var(--surface-2);
}
.info-title { font: 700 22px/28px var(--font-display); letter-spacing: -.3px; color: var(--text); text-align: center; text-wrap: balance; }
.info-list { display: flex; flex-direction: column; gap: 8px; list-style: none; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  font: 400 16px/21px var(--font-body);
  letter-spacing: -.15px;
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.list-row:active { background: var(--surface-3); }
.list-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-tile { display: flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 18px; background: var(--surface-3); }
.list-label { flex: 1; min-width: 0; }
.info-footer { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; }
.star-divider { display: flex; gap: 12px; }
.info-note { font: 400 12px/16px var(--font-body); color: var(--text-3); text-align: center; }
