/* the fonts load from base.html, as a <link> fetched in parallel with this file */

:root {
  --ink: #1d2433;
  --ink-soft: #55607a;
  --paper: #f3f6fb;
  --surface: #ffffff;
  --kid: #dfe9ff;
  --action: #2f5bea;
  --action-ink: #ffffff;
  --sub-bg: #1d2433;
  --sub-ink: #ffd23f;
  --sub-note: #c9d2e6;
  --line: #d5dceb;
  --danger: #b42318;
  --he: 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  --en: 'Atkinson Hyperlegible', system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ecf5;
    --ink-soft: #a3adc4;
    --paper: #121826;
    --surface: #1c2436;
    --kid: #26345a;
    --action: #6d8cff;
    --action-ink: #0e1422;
    --sub-bg: #05080f;
    --sub-note: #b5bfd6;
    --line: #2c3650;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--he);
}

[lang='en'], [dir='ltr'] { font-family: var(--en); }

a { color: var(--action); }

:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

.page {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3rem;
}

h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 0 0 .5rem; }
h2 small { font-weight: 400; color: var(--ink-soft); font-size: .9rem; }
.lead { color: var(--ink-soft); margin: 0 0 1.75rem; }
.hint { color: var(--ink-soft); font-size: .92rem; margin-top: 0; }

.doors { display: grid; gap: .75rem; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  background: var(--action);
  color: var(--action-ink);
  font: 600 1.05rem/1 var(--he);
  padding: .95rem 1.25rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn-alt { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.link { background: none; border: 0; color: var(--action); font: inherit; cursor: pointer; padding: 0; }

.form { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.form label { display: grid; gap: .35rem; font-weight: 500; }
.form label[hidden] { display: none; }
.form .check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: .7rem .8rem;
  width: 100%;
}
.check input { width: auto; margin-top: .3rem; }

.error {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-radius: 10px;
  padding: .7rem .9rem;
}

.notice-bar {
  background: color-mix(in srgb, var(--sub-ink) 22%, var(--surface));
  border-radius: 10px;
  padding: .7rem .9rem;
}

.bar { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }

.add-sibling summary { cursor: pointer; font-weight: 600; color: var(--action); }

.or { color: var(--ink-soft); margin: 1rem 0 .4rem; }
.btn-google { display: inline-flex; align-items: center; gap: .55rem; }
.add-sibling[open] summary { margin-bottom: .6rem; }

.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 1.1rem 1.1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}

/* the pairing code: shown big, once */
.code {
  font: 700 clamp(1.6rem, 8vw, 2.4rem)/1 var(--en);
  letter-spacing: .15em;
  white-space: nowrap;
  background: var(--sub-bg);
  color: var(--sub-ink);
  border-radius: 10px;
  padding: .8rem 1rem;
  text-align: center;
  margin: .25rem 0 .75rem;
}
.code-input { font: 700 1.6rem/1 var(--en); letter-spacing: .35em; text-align: center; }

/* the correction, shown like a subtitle line under the kid's message */
.subs {
  background: var(--sub-bg);
  color: var(--sub-ink);
  border-radius: 6px;
  padding: .45rem .7rem .5rem;
  font-family: var(--en);
  font-weight: 700;
  font-size: 1rem;
  text-shadow: 0 1px 0 #000;
  animation: subs-in .25s ease-out;
}
.subs + .subs { margin-top: -.15rem; }
.subs .wrong { color: var(--sub-note); font-weight: 400; text-decoration: line-through; text-decoration-thickness: 1px; }
.subs .why {
  display: block;
  font: 400 .85rem/1.4 var(--he);
  color: var(--sub-note);
  text-shadow: none;
  margin-top: .15rem;
}
@keyframes subs-in { from { opacity: 0; transform: translateY(-3px); } }

/* parent: one child's page */
h1 small, h2 small { font-weight: 400; color: var(--ink-soft); font-size: .6em; }
.child-link { color: inherit; text-decoration: none; border-bottom: 2px solid var(--action); }
.alert-bar {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  border-inline-start: 4px solid var(--danger);
  border-radius: 8px;
  padding: .7rem .9rem;
}
section + section { margin-top: 1.75rem; }
.week h2, .last-week h2 { margin-bottom: .75rem; }
/* the week strip: one dot per day, Sunday first; a filled dot is a day of practice */
.strip { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; padding: 0; margin: 0 0 .6rem; }
.strip li { display: grid; justify-items: center; gap: .3rem; }
.strip .dot { width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 2px solid var(--line); background: transparent; }
.strip .done .dot { background: var(--action); border-color: var(--action); }
.strip .future .dot { border-style: dashed; opacity: .55; }
.strip .day { font-size: .85rem; color: var(--ink-soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.numbers { margin: 0; }
.lists { display: grid; gap: 1.1rem; }
.lists h3 { font-size: 1rem; margin: 0 0 .3rem; }
.plain { margin: 0; padding-inline-start: 1.2rem; }
.plain li + li { margin-top: .15rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.chips span { background: var(--kid); border-radius: 999px; padding: .15rem .65rem; font-family: var(--en); font-size: .95rem; }
.chats { list-style: none; padding: 0; margin: 0; }
.chats li + li { border-top: 1px solid var(--line); }
.chats a, .chats .row { display: grid; gap: .1rem; padding: .7rem 0; color: inherit; text-decoration: none; }
.chats a:hover .when, .chats a:focus-visible .when { text-decoration: underline; }
/* a chat the parent can open: a chevron at the row's end says it opens. RTL mirrors '›' (U+203A), so it is drawn
   pointing left, which is forward here */
.chats a { position: relative; padding-inline-end: 1.6rem; }
.chats a::after { content: '›'; position: absolute; inset-inline-end: .2rem; top: 50%; transform: translateY(-55%); font-size: 1.6rem; line-height: 1; color: var(--action); }
.chats .when { font-weight: 600; }
.chats .count { font-size: .9rem; color: var(--ink-soft); }
.chats .line { font-size: .95rem; }
.flag { color: var(--danger); font-weight: 600; }
.device { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .7rem 0; }
.device > span { display: grid; gap: .1rem; }
.open-kid { display: grid; gap: .4rem; margin-top: 1rem; }

/* parent: a read-only conversation */
.transcript { display: flex; flex-direction: column; gap: .9rem; margin-top: 1rem; }
.transcript .msg { max-width: 85%; display: flex; flex-direction: column; gap: .3rem; }
.transcript .msg.kid { align-self: flex-start; }
.transcript .msg.tutor { align-self: flex-end; }
.transcript .bubble { padding: .6rem .85rem; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--en); }
.transcript .bubble.he { font-family: var(--he); }
.transcript .kid .bubble { background: var(--kid); }
.transcript .tutor .bubble { background: var(--surface); border: 1px solid var(--line); }
.transcript .voice-tag { display: block; font: .8rem var(--he); color: var(--ink-soft); }
.transcript .stamp { font-size: .75rem; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* plan 3: the footer with the cancel link, payments and cancellation pages */
.site-foot { max-width: 40rem; margin: 2rem auto 1.5rem; padding: 0 1rem; text-align: center; font-size: .9rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1rem; }
.site-foot a { color: var(--ink-soft); padding: .7rem .25rem; }

/* the legal pages: long text, read top to bottom */
.legal h2 { margin: 2rem 0 .4rem; }
.legal p, .legal ul { margin: 0 0 .75rem; }
.legal ul { padding-inline-start: 1.25rem; }
.legal li { margin-bottom: .35rem; }
.legal .lead { margin-bottom: 1.25rem; }
.quiet { color: var(--ink-soft); font-size: .92rem; margin-inline-start: .5rem; }
.history { width: 100%; border-collapse: collapse; font-size: .95rem; }
.history th, .history td { text-align: start; padding: .45rem .25rem; border-bottom: 1px solid var(--line); }
.history .num { direction: ltr; text-align: end; white-space: nowrap; }
.danger { background: var(--danger); }

/* the public entry: a real exchange from the chat, two doors, and plain explanation pages */
.entry h1 { font-size: 2.1rem; }
.entry h2 { margin: 2rem 0 .6rem; }
.demo { margin: 0 0 1.5rem; padding: 1rem; display: grid; gap: .55rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.demo .msg { display: flex; max-width: 85%; }
.demo .msg.kid { justify-self: start; }   /* RTL: the kid's side is the right, the tutor's the left */
.demo .msg.tutor { justify-self: end; }
.demo .bubble { padding: .6rem .85rem; border-radius: 18px; font-family: var(--en); font-size: 1.05rem; line-height: 1.45; }
.demo .kid .bubble { background: var(--kid); border-start-start-radius: 6px; }
.demo .tutor .bubble { background: var(--paper); border: 1px solid var(--line); border-start-end-radius: 6px; }
.demo .subs { justify-self: start; max-width: 85%; animation: none; }
.demo figcaption { margin: .25rem 0 0; }
.door-group { display: grid; gap: .6rem; padding: 1rem 1.1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.door-group strong { font-size: 1.15rem; }
.door-group span { font-size: .95rem; }
.door-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.door { display: grid; gap: .25rem; text-align: start; line-height: 1.4; padding: 1rem 1.1rem; }
.door strong { font-size: 1.15rem; }
.door span { font-weight: 400; font-size: .95rem; }
.steps { list-style: none; counter-reset: step; margin: 0 0 1rem; padding: 0; display: grid; gap: .9rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: .75rem; align-items: start; }
.steps li::before { content: counter(step); width: 2rem; height: 2rem; border-radius: 50%; background: var(--sub-bg); color: var(--sub-ink); font: 700 1rem/2rem var(--en); text-align: center; }
.see-also { display: flex; flex-wrap: wrap; gap: 0 1rem; margin: 1.5rem 0 0; }
.see-also a { padding: .7rem .25rem; }
.faq details { border-top: 1px solid var(--line); padding: 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; padding: .8rem 0; }
.faq details p { margin: 0 0 .8rem; }
@media (prefers-reduced-motion: reduce) { .subs { animation: none; } }

/* the kid's pairing page: friendly and colourful, the same speech bubble and tiles as the chat intro */
.kid-entry-body { background: #d4f5f0; }
@media (prefers-color-scheme: dark) { .kid-entry-body { background: color-mix(in srgb, #19c3b1 18%, var(--paper)); } }
.kid-entry { display: grid; gap: 1.1rem; }
.kid-entry-bubble { background: #19c3b1; color: #1d2433; border-radius: 28px 28px 28px 8px; padding: 1.4rem 1.4rem 1.5rem; }
.kid-entry-bubble h1 { margin: 0 0 .35rem; font: 700 clamp(2.8rem, 13vw, 3.8rem)/1 'Karantina', var(--he); }
.kid-entry-bubble p { margin: 0; font-size: 1.05rem; }
.kid-code { display: grid; gap: .6rem; background: var(--surface); border-radius: 22px; padding: 1.2rem; }
.kid-code label { font-weight: 700; font-size: 1.1rem; }
.kid-code .hint, .kid-code .error { margin: 0; }
.kid-code .code-input { text-align: center; }
.kid-code .code-input::placeholder { color: var(--ink-soft); opacity: 1; letter-spacing: .15em; }
.kid-code .btn { width: 100%; }
.kid-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.kid-tiles li { display: grid; gap: .3rem; justify-items: center; text-align: center; padding: .8rem .45rem .9rem; border-radius: 18px; color: #1d2433; font-weight: 600; font-size: .9rem; line-height: 1.3; }
.kid-tiles span { font-size: 1.7rem; line-height: 1; }
.kid-tiles .t1 { background: #ffe08a; }
.kid-tiles .t2 { background: #ffc9d6; }
.kid-tiles .t3 { background: #c9e4ff; }
.kid-help { text-align: center; }
.kid-help a { color: var(--ink); text-decoration-color: var(--action); }

/* the parent sends the pairing link: WhatsApp first, then other ways, the code last */
.pair-share { display: grid; gap: .6rem; }
.pair-share p { margin: 0; }
.btn-wa { background: #25d366; color: #0b2e17; }
.pair-more { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.pair-more .link { padding: .4rem 0; overflow-wrap: anywhere; text-align: start; }
.pair-code summary { cursor: pointer; font-weight: 600; color: var(--action); padding: .2rem 0; }
.pair-code[open] { display: grid; gap: .6rem; }

/* a kid whose phone is connected: say so, and keep pairing another phone a quiet link */
.paired { margin: 0 0 .4rem; }
.paired span { color: #12805c; font-weight: 700; }
@media (prefers-color-scheme: dark) { .paired span { color: #4cd39b; } }
.pair-again { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; align-items: baseline; }
.pair-again .link { padding: .35rem 0; }
.to-child { display: inline-block; margin-top: .5rem; padding: .35rem 0; font-weight: 600; }

/* the invite step after adding a child: send the link, then see the kid join */
.invite-added { background: color-mix(in srgb, #19c3b1 22%, var(--surface)); border-radius: 12px; padding: .7rem .9rem; margin: 0 0 1rem; }
.invite .pair-share { margin-bottom: 1rem; }
.invite-wait { color: var(--ink-soft); display: flex; align-items: center; gap: .6rem; }
.invite-wait .dot { width: .7rem; height: .7rem; border-radius: 50%; background: #25d366; flex: none; }
@media (prefers-reduced-motion: no-preference) { .invite-wait .dot { animation: wait-pulse 1.6s ease-in-out infinite; } }
@keyframes wait-pulse { 50% { opacity: .25; } }
.invite-done { font-weight: 700; font-size: 1.1rem; background: color-mix(in srgb, #25d366 20%, var(--surface)); border-radius: 12px; padding: .8rem 1rem; }
.invite-done span { color: #12805c; }
.invite-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1.5rem; }

/* the subscribe page's plan choice: the whole row is the radio's label, the chosen one outlined */
.plans { border: 0; margin: 0; padding: 0; display: grid; gap: .6rem; }
.plans legend { font-weight: 600; padding: 0; margin-bottom: .5rem; }
.form .plan {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: .15rem .7rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: .85rem 1rem;
  font-weight: 400;
  cursor: pointer;
}
.form .plan:has(input:checked) { border-color: var(--action); }
.plan input { width: auto; margin: 0; accent-color: var(--action); }
.plan-name { font-weight: 600; }
.plan-price strong { font-size: 1.1rem; }
.plan-note { grid-column: 2 / -1; color: var(--ink-soft); font-size: .92rem; }
.plans .hint { margin: 0; }
