/* Nola website, account dashboards and admin area. */
:root {
  --brand: #5c1b7c;
  --brand-dark: #44095e;
  --brand-soft: #f5ebf9;
  --green: #029d42;
  --green-soft: #e0f5e8;
  --sun: #fcaf2b;
  --coral: #d00b6e;
  --sky: #38b6e8;
  --ink: #2a1a3a;
  --ink-2: #4c3d5e;
  --muted: #6e6283;
  --line: #ece3f1;
  --bg: #fcf9fd;
  --card: #ffffff;
  --red: #d64545;
  --red-soft: #fdeaea;
  --amber: #b7791f;
  --amber-soft: #fff4dc;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(42, 26, 58, .06), 0 6px 20px rgba(42, 26, 58, .06);
  --heading: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
img { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--heading); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1em; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 520px; }
.mt { margin-top: 1.25rem; }
.mb0 { margin-bottom: 0; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .7em 1.25em; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font: 700 1rem var(--body); text-decoration: none;
  box-shadow: 0 3px 0 var(--brand-dark); transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brand-dark); }
.btn-sm { padding: .45em .95em; font-size: .9rem; box-shadow: 0 2px 0 var(--brand-dark); }
.btn-lg { padding: .9em 1.6em; font-size: 1.1rem; }
.btn-green { background: var(--green); box-shadow: 0 3px 0 #017a33; }
.btn-green:hover { background: #017a33; }
.btn-ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: var(--red); box-shadow: 0 3px 0 #a83232; }
.btn-danger:hover { background: #a83232; }
.btn-white { background: #fff; color: var(--brand); box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.btn-white:hover { background: #f8eefb; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }

/* ---------- Public header / footer ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 66px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--ink); font: 700 1.6rem var(--heading); }
.logo-mark { font-size: 1.6rem; }
.site-nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 700; }
.site-nav a:not(.btn):hover { color: var(--brand); }
@media (max-width: 720px) {
  .site-nav a:not(.btn):not([href*="login"]) { display: none; }
}
.site-footer { background: #2e0b40; color: #e3d3ec; margin-top: 4rem; padding: 2rem 0; }
.footer-row { display: flex; gap: 1rem 2rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.site-footer a { color: #fff; margin-right: 1rem; }

/* ---------- Landing ---------- */
.hero { background: linear-gradient(160deg, #4c0d6a 0%, #5c1b7c 50%, #8a3aa8 100%); color: #fff; padding: 64px 0 80px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -10% -60px -10%; height: 120px; background: var(--bg); border-radius: 50% 50% 0 0; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2rem; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: .35em; }
.hero p.lead { font-size: 1.2rem; opacity: .95; max-width: 34em; }
.hero .motto { letter-spacing: .18em; font-weight: 800; font-size: .85rem; opacity: .9; margin-bottom: 1rem; }
.hero-card { background: #fff; color: var(--ink); border-radius: 28px; padding: 1.4rem; box-shadow: 0 20px 40px rgba(46, 11, 64, .3); transform: rotate(1.5deg); }
.hero-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.hero-tiles div { background: var(--brand-soft); border-radius: 18px; padding: .9rem .4rem; text-align: center; font-weight: 800; font-size: .85rem; }
.hero-tiles span { display: block; font-size: 2rem; margin-bottom: .2rem; }
.hero-owl { font-size: 3.2rem; text-align: center; margin-bottom: .4rem; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-card { transform: none; } }

.section { padding: 56px 0 8px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 2rem; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.feature { background: #fff; border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.feature .f-icon { font-size: 2rem; margin-bottom: .4rem; }
.subject { border-radius: var(--radius); padding: 1.1rem; color: #fff; min-height: 128px; }
.subject h3 { margin-bottom: .25rem; }
.subject span { font-size: 1.9rem; }
.age-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.age-table th, .age-table td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.age-table th { background: var(--brand-soft); font-family: var(--heading); font-weight: 600; }

/* Pricing */
.cycle-toggle { display: inline-flex; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--shadow); margin: 0 auto 1.5rem; }
.cycle-toggle button { border: 0; background: none; padding: .55em 1.2em; border-radius: 999px; font: 700 .95rem var(--body); cursor: pointer; color: var(--ink-2); }
.cycle-toggle button.on { background: var(--brand); color: #fff; }
.cycle-toggle .save { background: var(--sun); color: #4a2c00; border-radius: 999px; padding: .1em .55em; font-size: .75rem; margin-left: .3em; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.2rem; align-items: stretch; }
.plan { background: #fff; border-radius: 22px; padding: 1.6rem; box-shadow: var(--shadow); display: flex; flex-direction: column; border: 2px solid transparent; }
.plan.featured { border-color: var(--brand); position: relative; }
.plan.featured::before { content: "Most popular"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .75rem; font-weight: 800; padding: .2em .8em; border-radius: 999px; }
.plan h3 { font-size: 1.35rem; }
.price { font: 700 2.2rem var(--heading); margin: .3rem 0 0; }
.price small { font: 600 1rem var(--body); color: var(--muted); }
.price-note { color: var(--muted); font-size: .9rem; min-height: 1.4em; }
.plan ul { list-style: none; padding: 0; margin: 1rem 0 1.4rem; flex: 1; }
.plan li { padding: .3rem 0 .3rem 1.6rem; position: relative; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }
[data-cycle-show] { display: none; }
[data-cycle="monthly"] [data-cycle-show="monthly"], [data-cycle="annual"] [data-cycle-show="annual"] { display: revert; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { background: #fff; border-radius: 24px; padding: 2rem; width: min(480px, 100%); box-shadow: var(--shadow); }
.auth-card.wide { width: min(720px, 100%); }
.auth-card h1 { font-size: 1.8rem; }
.auth-foot { text-align: center; margin-top: 1rem; color: var(--muted); }
.type-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 1.2rem; }
.type-choices input { position: absolute; opacity: 0; pointer-events: none; }
.type-choices label { display: block; border: 2px solid var(--line); border-radius: 16px; padding: .9rem .6rem; text-align: center; cursor: pointer; font-weight: 800; font-size: .9rem; height: 100%; }
.type-choices label span { display: block; font-size: 1.8rem; }
.type-choices label small { display: block; font-weight: 600; color: var(--muted); margin-top: .2rem; }
.type-choices input:checked + label { border-color: var(--brand); background: var(--brand-soft); }
.type-choices input:focus-visible + label { outline: 3px solid var(--sky); }
@media (max-width: 560px) { .type-choices { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.field label, .field legend { font-weight: 800; font-size: .92rem; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=search], input[type=color], select, textarea {
  font: inherit; padding: .7em .85em; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%;
}
input[type=color] { padding: .2em; height: 48px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(92, 27, 124, .16); }
.hint { color: var(--muted); font-weight: 600; }
.check { display: flex; gap: .55rem; align-items: flex-start; margin-bottom: 1rem; font-size: .95rem; }
.check input { margin-top: .3rem; width: 18px; height: 18px; flex: 0 0 auto; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
fieldset { border: 0; padding: 0; margin: 0; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: .4rem; }
.avatar-grid input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-grid label { font-size: 1.7rem; text-align: center; border: 2px solid var(--line); border-radius: 12px; padding: .2rem; cursor: pointer; }
.avatar-grid input:checked + label { border-color: var(--brand); background: var(--brand-soft); }
.avatar-grid input:focus-visible + label { outline: 3px solid var(--sky); }
.error-list { background: var(--red-soft); color: #8d2323; border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; font-weight: 700; }

/* ---------- Flash & banners ---------- */
.flash, .banner { padding: .85rem 1.1rem; border-radius: 14px; margin-bottom: 1rem; font-weight: 700; }
.flash-success { background: var(--green-soft); color: #1d6b3d; }
.flash-error { background: var(--red-soft); color: #8d2323; }
.flash-info, .banner-info { background: #e7f5fd; color: #145a7d; }
.banner-warn { background: var(--amber-soft); color: #7a4b00; }
.banner-error { background: var(--red-soft); color: #8d2323; }
.banner a, .flash a { color: inherit; }
.area-public .flash { width: min(1140px, 100% - 32px); margin: 1rem auto; }

/* ---------- App shell (account / admin) ---------- */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #2e0b40; color: #ecdff3; padding: 1.2rem .9rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { color: #fff; padding: 0 .4rem; }
.tenant-logo { max-height: 48px; max-width: 200px; background: #fff; border-radius: 10px; padding: 4px 8px; }
.tenant-name { padding: 0 .5rem; font-weight: 800; color: #fff; line-height: 1.3; }
.tenant-name small { display: block; color: #c3a9d2; font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a, .side-foot a { display: flex; gap: .65rem; align-items: center; padding: .6rem .7rem; border-radius: 12px; color: #ecdff3; text-decoration: none; font-weight: 700; }
.side-nav a:hover, .side-foot a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.on, .side-foot a.on { background: var(--brand); color: #fff; }
.side-nav .play-link { margin-top: .6rem; background: var(--green); color: #fff; }
.side-nav .play-link:hover { background: #017a33; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .1); padding-top: .8rem; }
.side-foot .link-btn { color: #c3a9d2; padding: .3rem .7rem; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.6rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.topbar .page-h { font-size: 1.45rem; margin: 0; flex: 1; min-width: 0; }
.top-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.menu-btn { display: none; border: 0; background: var(--brand-soft); color: var(--brand); font-size: 1.3rem; border-radius: 10px; width: 42px; height: 42px; cursor: pointer; }
.content { padding: 1.6rem; max-width: 1180px; width: 100%; }
.content.wide { max-width: none; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); }
  .menu-btn { display: inline-block; }
  .content { padding: 1rem; }
  .topbar { padding: .8rem 1rem; }
}

/* ---------- Cards, stats, tables ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem; margin-bottom: 1.2rem; }
.card h2 { font-size: 1.2rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; display: flex; gap: .8rem; align-items: center; }
.stat-icon { font-size: 1.7rem; width: 48px; height: 48px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 14px; flex: 0 0 auto; }
.stat-value { font: 700 1.5rem var(--heading); line-height: 1.1; }
.stat-label { color: var(--muted); font-weight: 700; font-size: .88rem; }
.stat-sub { color: var(--muted); font-size: .8rem; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.2rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.data th, table.data td { padding: .65rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data a { font-weight: 700; text-decoration: none; }
table.data .actions { white-space: nowrap; text-align: right; }

.pill { display: inline-block; padding: .15em .7em; border-radius: 999px; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.pill-green { background: var(--green-soft); color: #1d6b3d; }
.pill-amber { background: var(--amber-soft); color: #7a4b00; }
.pill-red { background: var(--red-soft); color: #8d2323; }
.pill-grey { background: #f0ebf2; color: #5a4e66; }
.pill-brand { background: var(--brand-soft); color: var(--brand); }

.bar { height: 10px; background: #f0e6f4; border-radius: 999px; overflow: hidden; min-width: 80px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #5ccf7f); border-radius: 999px; }

.empty { text-align: center; padding: 2.4rem 1rem; color: var(--muted); }
.empty-icon { font-size: 3rem; }
.empty h3 { color: var(--ink); }

.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.kid-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 1.2rem; display: flex; flex-direction: column; gap: .6rem; }
.kid-top { display: flex; gap: .8rem; align-items: center; }
.kid-avatar { font-size: 2.4rem; width: 64px; height: 64px; display: grid; place-items: center; background: var(--brand-soft); border-radius: 20px; flex: 0 0 auto; }
.kid-name { font: 700 1.2rem var(--heading); }
.kid-meta { color: var(--muted); font-size: .88rem; font-weight: 700; }
.kid-stats { display: flex; gap: 1rem; font-weight: 800; font-size: .92rem; }
.add-card { border: 3px dashed var(--line); background: transparent; box-shadow: none; align-items: center; justify-content: center; text-decoration: none; color: var(--brand); font-weight: 800; min-height: 180px; }
.add-card:hover { background: var(--brand-soft); }

.cat-progress { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .4rem 1.2rem; }
.cat-row { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .5rem; align-items: center; padding: .35rem 0; }
.cat-row .bar { grid-column: 2 / 4; }
.cat-row .cname { font-weight: 700; font-size: .92rem; }
.cat-row .cval { font-size: .82rem; color: var(--muted); font-weight: 700; }
.badge-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.badge-chip { background: var(--brand-soft); border-radius: 999px; padding: .25rem .7rem; font-weight: 700; font-size: .85rem; }
.badge-chip.off { opacity: .4; }

.code-box { font: 700 1.8rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .2em; background: var(--brand-soft); color: var(--brand); padding: .6rem 1rem; border-radius: 12px; display: inline-block; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filters .field { margin: 0; min-width: 160px; }

/* Receipt */
.receipt { max-width: 720px; }
.receipt-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 1rem; margin-bottom: 1rem; }
.receipt dl { display: grid; grid-template-columns: 180px 1fr; gap: .5rem 1rem; margin: 0; }
.receipt dt { color: var(--muted); font-weight: 700; }
.receipt dd { margin: 0; font-weight: 700; }
@media (max-width: 560px) { .receipt dl { grid-template-columns: 1fr; } .receipt dd { margin-bottom: .4rem; } }
@media print {
  .sidebar, .topbar, .no-print, .banner { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* Prose (privacy / terms) */
.prose { background: #fff; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); margin-top: 2rem; }
.prose h2 { margin-top: 1.4em; font-size: 1.3rem; }
.prose li { margin-bottom: .35rem; }

/* ---------- Nola logo ---------- */
.logo-img { display: block; height: 52px; width: auto; }
.site-header .logo-img { height: 56px; }
.site-footer .logo-img { height: 44px; display: inline-block; vertical-align: middle; background: #fff; border-radius: 12px; padding: 4px 8px; }
.sidebar .logo { background: #fff; border-radius: 16px; padding: .5rem .8rem; align-self: flex-start; }
.sidebar .logo .logo-img { height: 46px; }
.sidebar .logo:has(.tenant-logo) { background: transparent; padding: 0 .4rem; }
.receipt .logo-img { height: 60px; }
.hero h1 .hl, .accent-gold { color: var(--sun); }
.side-nav a.on, .side-foot a.on { box-shadow: inset 4px 0 0 var(--sun); }
input[type=radio], input[type=checkbox] { accent-color: var(--brand); }

/* ---------- Free trial ---------- */
.hero-trial { margin-top: 1rem; font-weight: 800; color: var(--sun); }
.trial-note { background: #fff6e0; border: 2px solid var(--sun); border-radius: 14px; padding: .75rem 1rem; color: #5a3a00; }
.banner-trial { background: #fff6e0; color: #5a3a00; border: 2px solid var(--sun); }
