/* boxprep.app veebileht. Sama keel mis äpis (mobiiliapp/app/src/theme/index.ts):
   valge ja #F5F5F7, tekst #1D1D1F, üks sinine #0071E3, pillinupud, süsteemifont.
   Väliseid fonte ega CDN-e pole. Kontrastid vähemalt 4,5:1. */

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;
  --fill: #e8e8ed;
  --line: #d2d2d7;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --tint: #0071e3;
  --tint-hover: #0062c4;
  --link: #0066cc;
  --night: #000000;
  --night-surface: #1d1d1f;
  --night-muted: #a1a1a6;
  --link-dark: #2997ff;
  --wait-bg: #fff2e0;
  --wait-fg: #8f4000;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 980px;
  --wide: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 64px; }
[id] { scroll-margin-top: 12px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Tekstisisesed lingid eristuvad allkriipsuga, mitte ainult värviga (WCAG 1.4.1). */
main a:not(.btn), .lede a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 980px;
}
.skip:focus { top: 12px; text-decoration: none; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: calc(var(--wide) + var(--gutter) * 2); }

/* Ülariba */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 19px; letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav-links a { color: var(--ink-2); padding: 12px 0; }
.nav-links a.btn { padding: 7px 16px; white-space: nowrap; }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-links a.btn, .nav-links a.btn:hover { color: #fff; text-decoration: none; }
/* Keelelüliti EST | ENG (A114): praegune keel paksult, teine link. Lühike nupusilt kitsal ekraanil. */
.lang { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; letter-spacing: 0.02em; }
.nav-links .lang a { padding: 12px 2px; }
.nav-links .lang a[aria-current="true"] { color: var(--ink); font-weight: 600; }
.lang-sep { color: var(--line); }
.nav-short { display: none; }
@media (max-width: 640px) { .nav-links .nav-hide { display: none; } .nav-links { gap: 16px; } }
@media (max-width: 480px) { .nav-long { display: none; } .nav-short { display: inline; } .nav-links { gap: 14px; } }
@media (max-width: 360px) { .lang a[aria-current="true"], .lang a[aria-current="true"] + .lang-sep, .lang-sep:has(+ a[aria-current="true"]) { display: none; } }
@media (max-width: 360px) { .brand { font-size: 17px; } .brand img { width: 24px; height: 24px; } .nav-links { gap: 12px; } .nav-links a.btn { padding: 7px 12px; } }

/* Nupud */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border-radius: 980px;
  font-size: 17px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2;
  background: var(--tint); color: #fff; border: 0; cursor: pointer;
}
.btn:hover { background: var(--tint-hover); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
.btn-ghost:hover { background: rgba(0, 102, 204, 0.06); }
.btn-small { min-height: 36px; padding: 7px 16px; font-size: 14px; }
.night .btn-ghost { color: var(--link-dark); box-shadow: inset 0 0 0 1px var(--link-dark); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.center .actions { justify-content: center; }

.pill {
  display: inline-block; padding: 5px 12px; border-radius: 980px;
  background: var(--fill); color: var(--ink-2); font-size: 13px; font-weight: 500; letter-spacing: 0;
}
.pill-wait { background: var(--wait-bg); color: var(--wait-fg); }

/* Tüpograafia */
h1, h2, h3 { margin: 0; color: inherit; font-weight: 700; }
.display { font-size: clamp(52px, 10.5vw, 112px); line-height: 1.02; letter-spacing: -0.045em; }
.h2 { font-size: clamp(36px, 6vw, 64px); line-height: 1.06; letter-spacing: -0.035em; }
.h3 { font-size: clamp(21px, 2.4vw, 24px); line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; }
.lede { font-size: clamp(19px, 2.4vw, 24px); line-height: 1.38; letter-spacing: -0.02em; color: var(--muted); font-weight: 400; max-width: 34em; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.43; letter-spacing: -0.01em; }

/* Lõigud */
.section { padding: clamp(72px, 11vw, 140px) 0; }
.section-tight { padding: clamp(56px, 8vw, 96px) 0; }
.surface { background: var(--surface); }
.night { background: var(--night); color: #f5f5f7; }
.night .lede, .night .muted { color: var(--night-muted); }
.night a { color: var(--link-dark); }

/* Avaosa */
.hero { padding-top: clamp(48px, 9vw, 112px); overflow: hidden; }
.hero .pill { margin-bottom: 22px; }
.hero .lede { margin-top: 22px; }
.hero .actions { margin-top: 32px; }
.hero-phone { margin: clamp(48px, 8vw, 88px) auto 0; width: min(330px, 78vw); }
.hero-phone .phone { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
.hero-phone .phone .screen { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.hero-crop { max-height: clamp(420px, 62vw, 560px); overflow: hidden; }

/* Telefon CSS-iga: must raam, ümarad nurgad, ekraanipilt sees */
.phone {
  position: relative;
  background: #1d1d1f;
  border-radius: 52px;
  padding: 11px;
  box-shadow: 0 0 0 2px #3a3a3c, 0 30px 60px -20px rgba(0, 0, 0, 0.28);
}
.phone .screen { border-radius: 42px; overflow: hidden; background: #fff; aspect-ratio: 390 / 844; padding-top: 11.3%; }
.phone .screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone::before {
  content: ""; position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  width: 31%; height: 26px; border-radius: 20px; background: #000; z-index: 1;
}
.night .phone { box-shadow: 0 0 0 2px #48484a, 0 30px 80px -20px rgba(41, 151, 255, 0.18); }

/* Kuidas töötab */
.steps-grid { display: grid; gap: 56px; align-items: center; margin-top: clamp(40px, 6vw, 72px); }
@media (min-width: 900px) { .steps-grid { grid-template-columns: 1fr 1.05fr; gap: 72px; } }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 36px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 0 18px; }
.steps li::before {
  content: counter(s);
  grid-row: 1 / span 3; grid-column: 1;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint); color: #fff; font-weight: 600; font-size: 19px; letter-spacing: 0;
}
.steps li > * { grid-column: 2; }
.steps p { margin: 6px 0 0; color: var(--ink-2); }
.phones-pair { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: clamp(14px, 3vw, 28px); max-width: 560px; margin: 0 auto; width: 100%; }
.phones-pair figure:last-child { margin-top: clamp(24px, 5vw, 56px); }
.phones-pair .phone { border-radius: clamp(28px, 5vw, 44px); padding: clamp(6px, 1.2vw, 9px); }
.phones-pair .phone .screen { border-radius: clamp(22px, 4vw, 36px); }
.phones-pair .phone::before { top: clamp(12px, 2.2vw, 18px); height: clamp(14px, 2.4vw, 20px); }
.swipe-hint { display: none; margin: 14px 0 0; }
/* Mobiilis üks ekraan korraga: külgsuunas libistatav rida, teine ekraan paistab servast. */
@media (max-width: 560px) {
  .phones-pair {
    display: flex; gap: 16px; max-width: none; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 4px var(--gutter) 24px; margin: 0 calc(var(--gutter) * -1); width: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .phones-pair::-webkit-scrollbar { display: none; }
  .phones-pair figure { flex: 0 0 min(280px, 76vw); scroll-snap-align: center; }
  .phones-pair figure:last-child { margin-top: 0; }
  .phones-pair .phone { border-radius: 44px; padding: 9px; }
  .phones-pair .phone .screen { border-radius: 36px; }
  .phones-pair .phone::before { top: 18px; height: 20px; }
  .swipe-hint { display: block; }
}
.duo { display: grid; gap: 16px; margin-top: clamp(40px, 6vw, 64px); }
@media (min-width: 760px) { .duo { grid-template-columns: 1fr 1fr; gap: 20px; } }
.duo > div { background: var(--bg); border-radius: 24px; padding: 28px; }
.duo p { margin: 8px 0 0; color: var(--ink-2); }
figure { margin: 0; }
figcaption { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; letter-spacing: -0.01em; }
.night figcaption { color: var(--night-muted); }

/* Treener */
.coach { display: grid; gap: 56px; align-items: center; }
@media (min-width: 900px) { .coach { grid-template-columns: 1.1fr 0.9fr; gap: 80px; } }
.coach .lede { margin-top: 22px; }
.coach-phone { width: min(320px, 76vw); margin: 0 auto; }
.facts { list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 18px; }
.facts li { padding-top: 18px; border-top: 1px solid #333336; }
.facts b { display: block; font-size: 19px; font-weight: 600; color: #f5f5f7; letter-spacing: -0.02em; }
.facts span { color: var(--night-muted); }

/* Privaatsus */
.trio { display: grid; gap: 16px; margin-top: clamp(40px, 6vw, 64px); }
@media (min-width: 760px) { .trio { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.trio > div { background: var(--bg); border-radius: 24px; padding: 32px 28px 34px; }
.trio .big { font-size: clamp(40px, 5vw, 56px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.trio h3 { margin-top: 14px; }
.trio p { margin: 8px 0 0; color: var(--ink-2); }
.after { margin-top: 32px; }

/* Lõpp */
.cta .lede { margin-top: 18px; }
.cta .actions { margin-top: 32px; }

/* Jalus */
.foot { background: var(--surface); color: var(--muted); font-size: 14px; line-height: 1.5; letter-spacing: -0.01em; padding: 28px 0 40px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; }
.foot a { color: var(--ink-2); }
.foot-in > p { align-self: center; }
.foot p { margin: 0; }

/* Tekstilehed (privaatsus, tingimused, tugi) */
.doc-head { padding: clamp(48px, 8vw, 88px) 0 clamp(28px, 4vw, 40px); }
.doc-head .wrap { max-width: calc(720px + var(--gutter) * 2); }
.doc-head .pill { margin-bottom: 18px; }
.doc-head .lede { margin-top: 16px; }
.doc-head h1 { overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 360px) { .doc-head h1.h2 { font-size: 30px; } }
.doc { overflow-wrap: break-word; max-width: calc(720px + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter) clamp(72px, 10vw, 120px); }
.doc h2 { font-size: clamp(26px, 3.4vw, 32px); line-height: 1.15; letter-spacing: -0.03em; margin: 56px 0 14px; }
.doc h3 { font-size: 21px; line-height: 1.24; letter-spacing: -0.02em; font-weight: 600; margin: 36px 0 10px; }
.doc h4 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; }
.doc p, .doc ul, .doc ol { margin: 0 0 16px; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: 6px 0; }
.doc li > ul, .doc li > ol { margin: 6px 0 0; }
.doc blockquote { margin: 0 0 20px; padding: 18px 22px; background: var(--surface); border-radius: 18px; color: var(--ink-2); }
.doc blockquote p:last-child { margin-bottom: 0; }
.doc code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.86em; background: var(--surface); padding: 1px 6px; border-radius: 6px; letter-spacing: 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.doc a { text-decoration: underline; text-underline-offset: 2px; }
.table-scroll {
  overflow-x: auto; margin: 0 0 20px; -webkit-overflow-scrolling: touch;
  /* Kerimise vihje: parem serv tumeneb, kui tabel jätkub. */
  background: linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left / 24px 100% no-repeat local,
    linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.16), transparent) right / 12px 100% no-repeat scroll;
}
.table-hint { display: none; margin: 0 0 6px; }
@media (max-width: 640px) { .table-hint { display: block; } }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; letter-spacing: -0.01em; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; background: var(--surface); }
.doc th:first-child, .doc td:first-child { padding-left: 0; }
.doc th:first-child { padding-left: 12px; }
@media (max-width: 640px) { .doc table { min-width: 560px; } }

/* Täpsustamisel: nurksulgudes kohatäited mustandis, nähtavad, mitte peidetud */
mark.tbd {
  background: var(--wait-bg); color: var(--wait-fg);
  border-radius: 6px; padding: 1px 6px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  font-weight: 500;
}
.notice { display: block; background: var(--wait-bg); color: var(--wait-fg); border-radius: 18px; padding: 16px 20px; margin: 0 0 28px; font-size: 15px; line-height: 1.45; }
.notice b { color: var(--wait-fg); }
.toc { background: var(--surface); border-radius: 18px; padding: 20px 24px; margin: 0 0 32px; font-size: 15px; }
.toc ul { list-style: none; margin: 8px 0 0; padding-left: 0; columns: 2 220px; column-gap: 28px; }
.toc li { margin: 4px 0; break-inside: avoid; }

/* Tugi */
.faq { margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 36px 20px 0; position: relative;
  font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq .answer { padding: 0 0 22px; color: var(--ink-2); }
.faq .answer p { margin: 0 0 12px; }
.faq .answer ol, .faq .answer ul { margin: 0 0 12px; padding-left: 1.3em; }
.contact-card { background: var(--surface); border-radius: 24px; padding: 28px; margin: 8px 0 8px; }
.contact-card .h3 { margin: 0 0 6px; }
.contact-card p:last-child { margin-bottom: 0; }
.contact-card a.mail { font-size: clamp(22px, 3vw, 28px); font-weight: 600; letter-spacing: -0.03em; }

/* Tagasiside vorm tugilehel (A129). Kiibid nagu äpis: hall täide, valitud sinine. */
[hidden] { display: none !important; }
.fb-card { scroll-margin-top: 72px; }
.fb { margin-top: 18px; }
.fb-kinds { border: 0; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fb-label { display: block; width: 100%; font-size: 17px; font-weight: 600; color: var(--ink); margin: 0 0 8px; padding: 0; letter-spacing: -0.01em; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 980px;
  background: var(--fill); color: var(--ink); font-size: 17px; font-weight: 500; cursor: pointer; letter-spacing: -0.01em;
}
.chip input:checked + span { background: var(--tint); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--tint); outline-offset: 3px; }
.fb textarea {
  display: block; width: 100%; min-height: 160px; resize: vertical; box-sizing: border-box;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink);
  font: inherit; font-size: 17px; line-height: 1.47;
}
.fb textarea:focus-visible { outline: 3px solid var(--tint); outline-offset: 1px; border-color: var(--tint); }
.fb textarea[aria-invalid="true"] { border-color: #d70015; }
.fb-help { margin: 8px 0 16px; }
.fb-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fb .btn[disabled] { opacity: 0.55; cursor: default; }
.fb-status { min-height: 1.4em; margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.fb-status.fb-error { color: #d70015; }
.fb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fb-done { margin-top: 18px; outline: none; }
.fb-done-title { font-size: clamp(22px, 3vw, 28px); font-weight: 600; letter-spacing: -0.03em; margin: 0 0 6px; color: var(--ink); }
.fb-nojs { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .nav, .foot, .skip { display: none; }
  mark.tbd { border: 1px solid currentColor; }
}
