/* Child Tracker — public site. Brand values from ios/.../Theme.swift. No external assets. */

:root {
  --bg: #F5F4F0;
  --surface: #FFFFFF;
  --tint: #EAF1EE;          /* soft teal ground for one or two sections */
  --ink: #17211E;
  --muted: #66706B;
  --line: #E6E4DC;
  --teal: #12796B;
  --teal-dark: #0E6055;
  --teal-soft: #E2F0ED;
  --amber: #E4863C;
  --amber-soft: #FBEEDF;
  --danger: #E0474C;
  --danger-soft: #FBE6E6;
  --ok: #2F9E6E;
  --ok-soft: #E3F3EA;
  --bezel: #1E2624;        /* phone body — dark in both themes, like a real device */
  --bezel-edge: rgba(255, 255, 255, 0.10);
  --screen: #F5F4F0;       /* matches the screenshots' own background */
  --r-card: 18px;
  --r-btn: 16px;
  --shadow-sm: 0 1px 2px rgba(23, 33, 30, 0.04), 0 4px 14px rgba(23, 33, 30, 0.05);
  --shadow: 0 1px 2px rgba(23, 33, 30, 0.04), 0 8px 24px rgba(23, 33, 30, 0.07);
  --shadow-phone: 0 2px 4px rgba(23, 33, 30, 0.12), 0 28px 56px -20px rgba(23, 33, 30, 0.40);
  --focus: 0 0 0 3px rgba(18, 121, 107, 0.35);
  --sp-section: clamp(56px, 4vw + 36px, 104px);
  --sp-block: clamp(40px, 3vw + 24px, 72px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --surface: #1C2220;
    --tint: #151C1A;
    --ink: #F2F4F2;
    --muted: #9AA6A1;
    --line: #2A322F;
    --teal: #1E8F7F;
    --teal-dark: #2AA391;
    --teal-soft: #173330;
    --amber-soft: #3A2A1A;
    --danger-soft: #3C1F21;
    --ok-soft: #173327;
    --bezel: #2A3330;
    --bezel-edge: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.30), 0 4px 14px rgba(0, 0, 0, 0.22);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.30), 0 8px 24px rgba(0, 0, 0, 0.28);
    --shadow-phone: 0 2px 4px rgba(0, 0, 0, 0.45), 0 28px 56px -20px rgba(0, 0, 0, 0.75);
    --focus: 0 0 0 3px rgba(30, 143, 127, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

/* Type scale */
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.15rem + 2.6vw, 3.1rem); font-weight: 750; line-height: 1.08; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.6rem, 1.05rem + 1.5vw, 2.3rem); font-weight: 720; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 650; }
h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 650; }
p { margin: 0 0 0.75em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: var(--teal-dark); }
strong { font-weight: 650; }
img { max-width: 100%; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: 20px; }
@media (min-width: 840px) { .wrap { padding-inline: 32px; } }

/* Icons */
.ico { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-tile { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); stroke-width: 1.7; margin-bottom: 14px; }
.ico-danger { background: var(--danger-soft); color: var(--danger); }
.ico-ok { background: var(--ok-soft); color: var(--ok); }
.ico-teal { color: var(--teal); }
.ico-fill { fill: currentColor; stroke: none; }
.brand-mark { width: 28px; height: 28px; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Skip link */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--teal); color: #fff; padding: 10px 14px; border-radius: 12px; text-decoration: none; }
.skip:focus { top: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-header { background: var(--bg); } }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand-name { font-size: 1.05rem; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-row .header-cta { display: none; }
@media (min-width: 560px) { .header-row .header-cta { display: inline-flex; } }

.lang { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.lang-btn { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 600; padding: 6px 9px; border-radius: 9px; cursor: pointer; min-height: 32px; }
.lang-btn[aria-pressed="true"] { background: var(--teal-soft); color: var(--teal); }
.lang-btn:hover { color: var(--ink); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--r-btn); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; padding: 10px 16px; min-height: 44px; transition: background-color .15s ease, color .15s ease, transform .1s ease; }
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: 0.92rem; }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 1px 2px rgba(14, 96, 85, 0.25); }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.65; cursor: not-allowed; }
.btn[aria-busy="true"] .btn-label { display: none; }
.btn[aria-busy="true"] .btn-busy { display: inline; }
.link-btn { appearance: none; background: none; border: 0; padding: 4px 2px; font: inherit; color: var(--teal); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 32px; white-space: nowrap; }
.link-btn:hover { color: var(--teal-dark); }
.link-btn[disabled] { color: var(--muted); text-decoration: none; cursor: default; }

/* Phone frame: CSS only — rounded bezel, subtle edge highlight, soft shadow. No fake status bar. */
.phone-figure { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.phone-figure figcaption { color: var(--muted); font-size: 0.9rem; text-align: center; max-width: 30ch; }
.phone { width: min(100%, 264px); padding: 10px; border-radius: 40px; background: var(--bezel); box-shadow: inset 0 0 0 1px var(--bezel-edge), var(--shadow-phone); }
.phone img { display: block; width: 100%; height: auto; aspect-ratio: 258 / 560; object-fit: contain; border-radius: 30px; background: var(--screen); }

/* Hero */
.hero { padding-block: clamp(36px, 4vw + 16px, 72px) var(--sp-block); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: center; }
@media (min-width: 840px) { .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 56px; } .hero { padding-block: 80px 96px; } }
.hero-phone { justify-self: center; }
.eyebrow { color: var(--teal); font-weight: 700; letter-spacing: 0.01em; margin-bottom: 14px; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 40rem; margin-bottom: 1.5em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .hero-actions .btn { flex: 0 1 auto; } }
.hero-note { color: var(--muted); font-size: 0.92rem; margin-top: 16px; }

/* Sections */
.section { padding-block: var(--sp-section); scroll-margin-top: 64px; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .section-alt { background: #171C1A; } }
.section-tint { background: var(--tint); border-block: 1px solid var(--line); }
.section-alt + .section-tint, .section-tint + .section-alt { border-top: 0; }
.section-lead { color: var(--muted); font-size: 1.06rem; max-width: 44rem; margin-bottom: clamp(28px, 3vw, 44px); }

.cards { display: grid; gap: 14px; }
@media (min-width: 560px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 900px) { .cards-3, .cards-5 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; box-shadow: var(--shadow-sm); }
.section-alt .card { background: var(--bg); box-shadow: none; }
.card p { color: var(--muted); margin: 0; }
.card-sos h3 { color: var(--danger); }
.card-quiet { background: var(--teal-soft); border-color: transparent; box-shadow: none; }
.card-quiet .ico-tile { background: var(--surface); }
.card-quiet p { color: var(--ink); }
@media (prefers-color-scheme: dark) { .card-quiet .ico-tile { background: rgba(255, 255, 255, 0.06); } }

/* Features: claim next to the screen that proves it; alternates left/right on wide screens */
.features { display: grid; gap: clamp(48px, 6vw, 96px); }
.feature { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
@media (min-width: 840px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 56px; }
  .feature:nth-child(even) .feature-copy { order: 2; }
  .feature:nth-child(even) .phone-figure { order: 1; }
}
.feature-copy { max-width: 34rem; }
.feature h3 { font-size: clamp(1.35rem, 1rem + 1.1vw, 1.8rem); font-weight: 720; letter-spacing: -0.02em; margin-bottom: 0.55em; }
.feature p:last-child { margin: 0; color: var(--muted); font-size: 1.04rem; }
.kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-weight: 650; font-size: 0.92rem; margin-bottom: 12px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--teal-soft); }
.kicker .ico { width: 18px; height: 18px; }

/* How it works */
.how-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 840px) { .how-grid { grid-template-columns: 1.1fr 0.9fr; gap: 56px; } }
.steps { display: grid; gap: 14px; margin-top: 28px; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow-sm); }
.step-num { width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.step h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.step p { color: var(--muted); margin: 0; }

/* Trust */
.trust-grid { display: grid; gap: 28px; }
@media (min-width: 840px) { .trust-grid { grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; } }
.trust-grid .section-lead { margin-bottom: 0; }
.trust-list { display: grid; gap: 12px; }
.trust-list li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.trust-list .ico { margin-top: 2px; }

/* Registration */
.reg-wrap { display: grid; gap: 28px; }
@media (min-width: 840px) { .reg-wrap { grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; } }
.reg-intro .section-lead { margin-bottom: 0; }
.reg-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; box-shadow: var(--shadow); }
@media (min-width: 560px) { .reg-card { padding: 28px; } }
.reg-step > :last-child { margin-bottom: 0; }

/* Ijtimoiy kirish: Google tugmasini GIS chizadi (iframe, qat'iy px kenglik, 40px balandlik);
   Apple tugmasi — Apple HIG bo'yicha: qora fon / oq matn (qorong'i temada teskarisi),
   logotip chapda. Ikkalasi bir xil balandlik va burchakda turishi uchun 40px / 4px. */
.social { display: grid; gap: 10px; margin-bottom: 18px; }
.social[aria-busy="true"] .social-google { opacity: 0.6; pointer-events: none; }
.social-google { display: flex; justify-content: center; min-height: 40px; overflow: hidden; }
.social-google > div { max-width: 100%; }
.btn-apple { min-height: 40px; padding: 8px 14px; border-radius: 4px; background: #000; color: #fff; font-weight: 500; font-size: 0.95rem; letter-spacing: 0.01em; }
.btn-apple:hover { background: #1a1a1a; color: #fff; }
.btn-apple .ico { width: 18px; height: 18px; }
@media (prefers-color-scheme: dark) {
  .btn-apple { background: #fff; color: #000; }
  .btn-apple:hover { background: #ececec; color: #000; }
}
.social .form-err { margin: 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.divider::before, .divider::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; font: inherit; font-size: 1.1rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 50px; }
.field input::placeholder { color: var(--muted); opacity: 0.8; }
.field input:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
#code { letter-spacing: 0.25em; font-variant-numeric: tabular-nums; text-align: center; font-size: 1.4rem; }

/* Kod qayerga boradi: SMS / Email — segmentli radio. Radio o'zi ko'zdan yashirin,
   lekin fokus va klaviatura ishlaydi; tanlangan variant oq «tabletka». */
.channel-field { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.channel-field legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.seg-item { display: contents; }
.seg input { position: absolute; width: 1px; height: 1px; margin: -1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.seg label { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 4px 10px; border-radius: 10px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; transition: background-color .15s ease, color .15s ease; }
.seg label .ico { width: 18px; height: 18px; }
.seg label:hover { color: var(--ink); }
.seg input:checked + label { background: var(--surface); color: var(--teal); box-shadow: var(--shadow-sm); }
.seg input:focus-visible + label { box-shadow: var(--focus); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 6px 0 0; }
.hint-center { text-align: center; margin-top: 12px; }
.field-err, .form-err { color: var(--danger); font-size: 0.92rem; margin: 6px 0 0; }
.form-err { background: var(--danger-soft); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.form-err.is-info { background: var(--amber-soft); color: var(--ink); }

.sent-line { margin-bottom: 16px; }
.sent-line strong { display: block; font-size: 1.15rem; margin-top: 2px; overflow-wrap: anywhere; }
.code-form { margin-top: 12px; }
.verify-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; font-size: 0.92rem; color: var(--muted); }
@media (min-width: 480px) { .verify-foot { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; } }
.countdown { margin: 0; }
.countdown strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.countdown.is-expired strong { color: var(--danger); }
.verify-links { display: flex; align-items: center; gap: 8px; }

.success { text-align: center; }
.ico-success { width: 56px; height: 56px; padding: 12px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); stroke-width: 2.2; margin: 4px auto 14px; display: block; }
.ok-id { font-size: 1.3rem; font-weight: 700; margin-bottom: 14px; overflow-wrap: anywhere; }
.store-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.badge-soon { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 0.9rem; margin: 0; }
.badge-soon em { font-style: normal; color: var(--amber); font-weight: 600; }
.badge-soon .ico { width: 18px; height: 18px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding-block: 40px 24px; color: var(--muted); font-size: 0.95rem; }
@media (prefers-color-scheme: dark) { .site-footer { background: #171C1A; } }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-brand strong { color: var(--ink); display: block; margin-bottom: 4px; }
.footer-brand p { margin: 0; }
.footer-col p { margin: 0 0 6px; }
.footer-col a { color: var(--ink); }
.contact-placeholder { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.footer-bottom { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 0.85rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
