/* MathsTutors.Online brand colours. */
:root {
  --navy: #041f60;          /* dark blue */
  --cyan: #4de4ff;          /* bright blue */
  --dusky: #3bb5d9;         /* dusky blue */
  --lilac: #a6b6f8;         /* light purple */
  --purple: #5b5299;        /* dark purple */
  --white: #ffffff;

  --fg: var(--navy);
  --muted: #4a5578;
  --bg: #f3f5fe;            /* very light tint of light purple */
  --card: var(--white);
  --accent-soft: #e6ebfe;   /* light purple tint */
  --link: var(--purple);
  --border: #dde3fb;
  --error: #b91c1c;
  --good: #116149;
  --good-soft: #d9f5ec;
  --warn: #8a4b00;
  --warn-soft: #fff1d6;
  --bad: #a21c2c;
  --bad-soft: #fde4e7;
  --radius: 16px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--fg); background: var(--bg); -webkit-text-size-adjust: 100%; }
body.has-tabs { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 1rem); }
main { max-width: 36rem; margin: 0 auto; padding: 1rem 1rem 2rem; }
h1 { font-size: 1.5rem; margin: .25rem 0 .75rem; }
h2 { font-size: 1.125rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .25rem; }
a { color: var(--link); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--error); }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: .75rem 1rem; font-weight: 600; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: .875rem max(1rem, calc((100% - 34rem) / 2)); padding-top: max(.875rem, env(safe-area-inset-top)); background: var(--navy); color: var(--white); border-bottom: 4px solid var(--cyan); }
.brand { font-weight: 800; letter-spacing: .01em; }
.brand-accent { color: var(--cyan); }
.link-button { background: none; border: 0; padding: .25rem; color: var(--white); font: inherit; cursor: pointer; text-decoration: underline; width: auto; margin: 0; }

/* bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; background: var(--white); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(4, 31, 96, .06); }
.tab-button { flex: 1; max-width: 12rem; height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: 0; color: var(--muted); font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer; border-radius: 0; margin: 0; padding: 0; width: auto; }
.tab-button .icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab-button.active { color: var(--navy); }
.tab-button.active .icon { stroke: var(--purple); }
.tab-button.active span { border-bottom: 3px solid var(--cyan); }

/* child switcher + student line */
.switcher { display: flex; gap: .5rem; overflow-x: auto; margin-bottom: .5rem; }
.chip { width: auto; margin: 0; padding: .5rem 1.125rem; color: var(--navy); background: var(--white); border: 1px solid var(--border); border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
.chip.active { color: var(--white); background: var(--purple); border-color: var(--purple); }
.student-line { margin: 0 0 1rem; }

/* cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.card > h2 { padding-left: .625rem; border-left: 4px solid var(--dusky); }

/* buttons */
.actions { display: grid; gap: .5rem; margin-top: 1rem; }
.actions.single { grid-template-columns: 1fr; margin-top: .5rem; }
@media (min-width: 30rem) { .actions:not(.single) { grid-template-columns: 1fr 1fr; } .actions:not(.single) > :only-child { grid-column: 1 / -1; } }
.button, button { display: block; width: 100%; padding: .9rem 1rem; font: inherit; font-weight: 700; text-align: center; text-decoration: none; color: var(--white); background: var(--navy); border: 0; border-radius: 10px; cursor: pointer; }
.button.secondary { color: var(--navy); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--lilac); }
.button.join.today { background: var(--purple); font-size: 1.0625rem; padding: 1.05rem 1rem; }
button:disabled { opacity: .6; cursor: default; }
.button:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--dusky); outline-offset: 2px; }

/* home: next session hero */
.hero { border-top: 6px solid var(--dusky); }
.hero-today { border-top-color: var(--cyan); box-shadow: 0 6px 24px rgba(4, 31, 96, .10); }
.eyebrow { margin: 0; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--purple); }
.hero-when { margin: .25rem 0 0; font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.hero-time { font-weight: 600; white-space: nowrap; }
.hero-meta { margin: .375rem 0 0; color: var(--muted); }
.meet-pending { margin: .75rem 0 0; font-size: .9375rem; color: var(--muted); }

.block-progress { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.block-label { margin: 0 0 .5rem; font-size: .9375rem; }
.dots { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--lilac); background: var(--white); }
.dot-yes { background: var(--good); border-color: var(--good); }
.dot-late { background: #e9a23b; border-color: #e9a23b; }
.dot-no { background: var(--bad); border-color: var(--bad); }
.dot-na, .dot-unknown { background: var(--accent-soft); }
.dot-next { border: 3px solid var(--cyan); box-shadow: 0 0 0 2px var(--navy); }

.coming-up { margin-top: 1rem; }
.coming-up h3 { font-size: .9375rem; margin-bottom: .375rem; }
.coming-up ul { list-style: none; padding: 0; margin: 0; }
.coming-up li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.coming-up li:last-child { border-bottom: 0; }
.cu-date { font-weight: 600; }
.cu-holiday { color: var(--warn); }
.payment { margin: 0; }

/* progress */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.stat { background: var(--bg); border-radius: 10px; padding: .625rem .75rem; }
.stat-label { display: block; font-size: .8125rem; color: var(--muted); }
.stat-value { font-size: 1.25rem; font-weight: 800; }
.on-target { margin: .75rem 0 0; font-weight: 700; color: var(--good); }

.topic-card h3 { font-size: 1.0625rem; }
.block-date { margin: 0 0 .75rem; font-size: .875rem; }
.result { margin-top: .625rem; }
.result-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .9375rem; }
.result.pending .result-head strong { color: var(--muted); font-weight: 600; }
.bar { height: 10px; margin-top: .25rem; background: var(--accent-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--dusky), var(--cyan)); border-radius: 999px; }
.result:first-of-type .bar-fill { background: var(--lilac); }
.change { margin: .75rem 0 0; font-weight: 700; color: var(--good); }

.attendance { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .375rem; }
.att { border-radius: 8px; padding: .375rem .5rem; background: var(--bg); font-size: .8125rem; }
.att-week { display: block; color: var(--muted); }
.att-value { display: block; font-weight: 700; }
.att-yes { background: var(--good-soft); color: var(--good); }
.att-late { background: var(--warn-soft); color: var(--warn); }
.att-no { background: var(--bad-soft); color: var(--bad); }
.att-yes .att-week, .att-late .att-week, .att-no .att-week { color: inherit; opacity: .8; }

.review { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.review p { margin: 0; font-size: .9375rem; }
.show-more { margin-bottom: 1rem; }

/* info */
.holiday-list { list-style: none; padding: 0; margin: 0; }
.holiday-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.holiday-list li:last-child { border-bottom: 0; }
.note { margin: .75rem 0 0; padding: .75rem; background: var(--accent-soft); border-radius: 10px; font-weight: 600; }
.faq { border-top: 1px solid var(--border); }
.faq:first-of-type { border-top: 0; }
.faq summary { cursor: pointer; padding: .875rem 0; font-weight: 700; list-style-position: outside; }
.faq-body p { margin: 0 0 .875rem; }

.footer { margin-top: 1.5rem; font-size: .875rem; text-align: center; }
.footer p { margin: .25rem 0; }

/* login page */
label { display: block; font-weight: 600; margin-bottom: .25rem; }
input[type="email"] { width: 100%; padding: .75rem; font: inherit; border: 1px solid var(--border); border-radius: 10px; }
form button, #confirm button { margin-top: 1rem; }
