/* ==========================================================================
   Generation Swimming Academy - design system
   Palette sampled from the Generation letterhead logo and the level
   certificates. Mascot accents come from data/curriculum.json.
   ========================================================================== */

:root {
  /* ---- Official Generation Schools CI 2025 ----------------------------
     Primary      #00729A  Pantone 7469C
     Secondary    #95C8DB  Pantone 636C
     Alternative  #00AEEF  Pantone Cyan C
     Alternative  #F47A20  Pantone 158C
     Everything else below is a tint or shade derived from these four.
     The certificate artwork keeps its own navy: it was supplied that way
     by the school and is not ours to restyle.                          */
  --brand:       #00729A;
  --brand-mid:   #0091C2;   /* derived: primary lifted toward the cyan */
  --brand-deep:  #00556F;   /* derived: primary darkened, for footers */
  --cyan:        #00AEEF;
  --sky:         #95C8DB;
  --orange:      #F47A20;   /* used sparingly, for genuine attention only */

  /* Legacy names, kept so existing rules keep working. They predate the
     brand guide; --navy is now the primary teal, not a navy. */
  --navy:        var(--brand);
  --navy-deep:   var(--brand-deep);
  --blue:        var(--brand-mid);
  --foam:        #E9F4FA;

  /* Surface */
  --bg:          #F3FAFD;
  --card:        #FFFFFF;
  --line:        #D8E9F0;
  --ink:         #0E2A36;
  --ink-soft:    #4C6C79;
  --ink-faint:   #8AA6B2;

  /* Status */
  --ok:          #1FA971;
  --ok-soft:     #E4F7EF;
  --warn:        #E9922B;
  --warn-soft:   #FDF1E2;
  --danger:      #E04B4B;
  --danger-soft: #FCEAEA;

  /* Mascot accents */
  --lv1: #4CAF50;  --lv2: #F5A623;  --lv3: #8E5BC4;  --lv4: #26A69A;
  --lv5: #78909C;  --lv6: #2196F3;  --lv7: #546E7A;  --lv8: #263238;

  --radius:    18px;
  --radius-lg: 28px;
  --radius-sm: 12px;

  --shadow:    0 4px 18px rgba(0, 85, 111, .09);
  --shadow-lg: 0 14px 40px rgba(0, 85, 111, .16);

  /* The brand guide specifies Museo Sans, which is commercially licensed and
     cannot be bundled here. It is named first so it is picked up wherever the
     school has a licence installed; Nunito is the fallback and is a close
     match in spirit - geometric, humanist, slightly rounded, and friendly
     enough for a children's product. */
  --font: "Museo Sans", "Museo Sans Rounded", "Nunito", "Segoe UI",
          system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; color: var(--navy); font-weight: 800; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p  { line-height: 1.6; color: var(--ink-soft); margin: 0 0 1em; }
a  { color: var(--blue); }

/* ---------- Water backdrop ------------------------------------------------ */

.water-top {
  position: relative;
  background: linear-gradient(160deg, var(--cyan) 0%, var(--blue) 55%, var(--navy) 100%);
  color: #fff;
  overflow: hidden;
}
.water-top h1, .water-top h2 { color: #fff; }
.water-top p  { color: rgba(255, 255, 255, .88); }

/* Soft bubbles drifting in the header. Purely decorative. */
.water-top::before,
.water-top::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  pointer-events: none;
}
.water-top::before { width: 240px; height: 240px; top: -90px;  right: -60px; }
.water-top::after  { width: 150px; height: 150px; bottom: -70px; left: 8%; }

.wave {
  display: block;
  width: 100%;
  height: 52px;
  margin-bottom: -1px;
}

/* ---------- Layout -------------------------------------------------------- */

/* Wide enough to use a modern laptop screen without the content sitting in a
   narrow column, capped so line lengths stay readable on very wide monitors.
   The clamp lets it breathe on mid-size screens rather than jumping. */
.wrap  { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px); }
.wrap-narrow { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 20px; }

.stack   > * + * { margin-top: 18px; }
.stack-s > * + * { margin-top: 10px; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.spacer { flex: 1; }

section { padding: 44px 0; }

/* ---------- Cards --------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card-flush { padding: 0; overflow: hidden; }
.card-hero {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px;
}

.card-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-body { padding: 22px; }

/* ---------- Buttons ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: .98rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #fff;
  box-shadow: 0 6px 18px rgba(30, 123, 224, .35);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(30, 123, 224, .45); }

.btn-ghost {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--line);
}
.btn-ghost:hover { border-color: var(--cyan); }

.btn-on-dark { background: #fff; color: var(--navy); }
.btn-quiet   { background: var(--foam); color: var(--navy); }
.btn-sm      { padding: 9px 18px; font-size: .87rem; }
.btn-block   { display: flex; width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- Forms --------------------------------------------------------- */

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block;
  font-weight: 700;
  font-size: .88rem;
  color: var(--navy);
  margin-bottom: 6px;
}
.field .hint { font-weight: 500; color: var(--ink-faint); font-size: .82rem; }

.input, .select, .textarea {
  width: 100%;
  padding: 13px 15px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(41, 171, 226, .16);
}
.textarea { min-height: 110px; resize: vertical; }

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  background: var(--warn-soft);
  border: 2px solid #F5DDBA;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.check input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.check.is-done { background: var(--ok-soft); border-color: #B6E7D2; }

/* ---------- Pills & badges ------------------------------------------------ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .01em;
}
.pill-ok      { background: var(--ok-soft);     color: #147850; }
.pill-warn    { background: var(--warn-soft);   color: #9A5C10; }
.pill-danger  { background: var(--danger-soft); color: #A82F2F; }
.pill-info    { background: var(--foam);        color: var(--navy); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .74rem;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 8px;
}

/* ---------- Progress wheel ------------------------------------------------ */

.wheel { display: grid; place-items: center; position: relative; }
.wheel svg { transform: rotate(-90deg); display: block; }
.wheel-track { stroke: var(--foam); }
.wheel-fill  { stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.22,1,.36,1); }
.wheel-label {
  position: absolute;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: 1.1;
}
.wheel-label b { display: block; font-size: 1.5rem; color: var(--navy); }
.wheel-label small { display: block; font-size: .68rem; color: var(--ink-faint); font-weight: 700; }

/* ---------- Level cards --------------------------------------------------- */

.level {
  position: relative;
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  border: 2px solid var(--line);
  transition: transform .15s ease, box-shadow .15s ease;
}
.level:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.level::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--accent, var(--cyan));
}
.level.is-locked { opacity: .55; }
.level.is-current { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(41,171,226,.14); }

.level-mascot {
  width: 62px; height: 62px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--foam);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  flex: none;
}

/* ---------- Skill rows ---------------------------------------------------- */

.skill { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.skill:last-child { border-bottom: none; }
.skill-text { font-weight: 600; font-size: .94rem; color: var(--ink); }

.meter { height: 9px; background: var(--foam); border-radius: 999px; overflow: hidden; }
.meter > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  transition: width .8s cubic-bezier(.22,1,.36,1);
}

/* ---------- Stepper ------------------------------------------------------- */

.steps { display: flex; gap: 6px; margin-bottom: 26px; }
.steps > li {
  flex: 1;
  list-style: none;
  font-size: .74rem;
  font-weight: 800;
  color: var(--ink-faint);
  text-align: center;
  padding-top: 12px;
  border-top: 4px solid var(--line);
  transition: color .2s, border-color .2s;
}
.steps > li.is-done    { color: var(--ok);   border-color: var(--ok); }
.steps > li.is-current { color: var(--blue); border-color: var(--blue); }

/* ---------- Tables -------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left;
  padding: 12px 14px;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-faint);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- Avatars ------------------------------------------------------- */

.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  flex: none;
  font-size: .95rem;
}
.avatar-lg { width: 68px; height: 68px; font-size: 1.4rem; }

/* ---------- Mobile shell (instructor / parent PWA) ------------------------ */

.phone {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  box-shadow: 0 0 60px rgba(22, 53, 127, .12);
  padding-bottom: 86px;
  position: relative;
}

.tabbar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
}
.tabbar a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--ink-faint);
  font-size: .68rem;
  font-weight: 800;
  padding: 6px 2px;
  border-radius: var(--radius-sm);
}
.tabbar a.is-active { color: var(--blue); background: var(--foam); }
.tabbar .ic { display: block; font-size: 1.25rem; margin-bottom: 2px; }

/* ---------- Utilities ----------------------------------------------------- */

.muted   { color: var(--ink-soft); }
.faint   { color: var(--ink-faint); }
.small   { font-size: .84rem; }
.tiny    { font-size: .75rem; }
.b       { font-weight: 800; }
.center  { text-align: center; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }

.note {
  padding: 14px 16px;
  border-left: 4px solid var(--cyan);
  background: var(--foam);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .88rem;
  color: var(--navy);
}

/* Prototype-only banner so nobody mistakes this for the live product. */
.proto-flag {
  background: #12233F;
  color: #9FD7F0;
  font-size: .76rem;
  font-weight: 700;
  text-align: center;
  padding: 7px 16px;
  letter-spacing: .02em;
}
.proto-flag a { color: #fff; }

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