/* Viji's Academy - New Batch registration (/batch/)
   Layout: a navy stage header carrying the logo on a white plate and a swara strip, then one bright form card
   (poster beside it on wide screens, above it on phones). Accent colour follows the chosen batch. */
:root {
  --night: #15206b;        /* logo navy */
  --night-2: #2a2f9e;
  --red: #d0021b;          /* logo red */
  --saffron: #ff7a00;      /* logo orange */
  --marigold: #ffc23d;
  --rani: #e8197d;         /* rani pink */
  --peacock: #00a19b;      /* peacock teal */
  --paper: #fff7ee;
  --card: #ffffff;
  --ink: #24123f;
  --muted: #565d86;
  --line: #dfe2f3;
  --field: #fbfbff;
  --error: #c3102c;
  --error-bg: #fff0f2;

  --accent: var(--red);
  --accent-2: var(--rani);
  --accent-soft: #ffe9ec;

  --display: 'Baloo 2', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --body: 'Hind', 'Segoe UI', Roboto, system-ui, -apple-system, Arial, sans-serif;
  --r-card: 22px;
  --r-field: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- Hero ---------- */
.hero {
  color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(208, 2, 27, .55) 0%, rgba(208, 2, 27, 0) 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(255, 122, 0, .38) 0%, rgba(255, 122, 0, 0) 60%),
    linear-gradient(160deg, var(--night) 0%, var(--night-2) 100%);
  padding-top: env(safe-area-inset-top, 0px);
}
.hero-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 20px 26px;
  text-align: center;
}
.logo-plate {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 12px 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(5, 10, 50, .35), 0 0 0 4px rgba(255, 255, 255, .18);
}
.hero-logo {
  width: min(240px, 62vw);
  height: auto;
  margin: 0 auto;
}
.hero-eyebrow {
  display: inline-block;
  margin: 0 0 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--marigold);
  color: var(--night);
  font: 700 .78rem/1.4 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font: 800 clamp(1.9rem, 7vw, 3rem)/1.05 var(--display);
  text-wrap: balance;
}
.hero-sub {
  max-width: 34em;
  margin: 10px auto 0;
  font-size: 1.02rem;
  color: #f3e9ff;
}
.hero-compact .hero-inner { padding-bottom: 16px; }

.swara-strip {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0 12px 14px;
  overflow: hidden;
}
.swara-strip span {
  flex: 0 1 auto;
  min-width: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font: 700 .85rem/1.5 var(--display);
  color: var(--night);
}
.swara-strip span:nth-child(4n+1) { background: var(--marigold); }
.swara-strip span:nth-child(4n+2) { background: #ff9d4d; }
.swara-strip span:nth-child(4n+3) { background: #ff7ab5; }
.swara-strip span:nth-child(4n+4) { background: #5fd9cf; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 600px;
  margin: 0 auto;
  padding-inline: 14px;
  padding-block: 18px 30px;
  display: grid;
  gap: 18px;
}
@media (min-width: 920px) {
  .wrap.has-poster {
    max-width: 1020px;
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    align-items: start;
    padding-block: 28px 40px;
    gap: 28px;
  }
  .wrap.has-poster .poster-card { position: sticky; top: 20px; }
}

/* ---------- Poster ---------- */
.poster-card {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 12px;
  box-shadow: 0 10px 30px rgba(21, 32, 107, .12);
}
.poster-frame {
  position: relative;
  max-height: 260px;
  overflow: hidden;
  border-radius: 14px;
  transition: max-height .45s ease;
}
.poster-frame img { width: 100%; height: auto; }
.poster-frame.expanded { max-height: 3000px; }
.poster-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--card));
  pointer-events: none;
}
.poster-frame.expanded .poster-fade { display: none; }
.poster-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding-top: 10px;
}
@media (min-width: 920px) {
  .poster-frame { max-height: none; }
  .poster-fade, .poster-actions { display: none; }
}

/* ---------- Buttons ---------- */
.chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 2px solid var(--night);
  border-radius: 999px;
  background: var(--night);
  color: #fff;
  font: 700 .95rem/1 var(--display);
  text-decoration: none;
  cursor: pointer;
}
.chip-ghost { background: transparent; color: var(--night); }
.chip-btn:focus-visible, .submit-btn:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; }

/* ---------- Form card ---------- */
.form-card {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 22px 18px 20px;
  box-shadow: 0 14px 40px rgba(21, 32, 107, .14);
  position: relative;
  overflow: hidden;
}
.form-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 8px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: background .3s;
}
@media (min-width: 480px) { .form-card { padding: 28px 28px 24px; } }

.tone-kids     { --accent: var(--peacock); --accent-2: #3b4fd8; --accent-soft: #e3f8f6; }
.tone-carnatic { --accent: var(--saffron); --accent-2: var(--red); --accent-soft: #fff1e3; }
.tone-cine     { --accent: var(--rani);    --accent-2: var(--red);  --accent-soft: #ffe9f3; }

.form-card h2 {
  margin: 4px 0 2px;
  font: 800 1.6rem/1.15 var(--display);
  color: var(--night);
  text-wrap: balance;
}
.lead { margin: 0 0 16px; color: var(--muted); }
.req { color: var(--red); font-weight: 700; }
.opt {
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eceefa;
  color: var(--muted);
  font: 600 .72rem/1.6 var(--body);
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--error-bg);
  border: 1.5px solid var(--error);
  color: var(--error);
  font-size: .95rem;
}

form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label {
  font: 700 1rem/1.3 var(--display);
  color: var(--night);
}
.hint { margin: 0; font-size: .86rem; color: var(--muted); }
.field-error {
  margin: 0;
  font-size: .9rem;
  font-weight: 600;
  color: var(--error);
}

input[type=text], input[type=email], input[type=tel], input[type=number], input[type=search], input[type=password], select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--r-field);
  background: var(--field);
  color: var(--ink);
  font: 500 1.0625rem/1.3 var(--body); /* 17px keeps iOS from zooming */
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: #9aa0bf; }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
[aria-invalid="true"] { border-color: var(--error) !important; background: var(--error-bg) !important; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.field-age input { max-width: 140px; }

.select-wrap { position: relative; }
.select-wrap select { padding-right: 46px; cursor: pointer; font-weight: 600; }
.select-wrap select:invalid { color: #7f86ab; font-weight: 500; }
.select-wrap::after {
  content: "";
  position: absolute; right: 18px; top: 50%;
  width: 10px; height: 10px;
  border-right: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
select option { color: var(--ink); font-weight: 500; }

.parent-field {
  padding: 12px;
  margin: -4px 0 0;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  background: var(--accent-soft);
}

.phone-wrap { display: flex; min-width: 0; }
/* Country code: a real, visible dropdown so every phone opens its own picker on tap. */
.cc-wrap { position: relative; flex: 0 0 auto; max-width: 46%; }
.cc-wrap select {
  width: 100%;
  min-height: 52px;
  padding: 12px 30px 12px 12px;
  border-right: 0;
  border-radius: var(--r-field) 0 0 var(--r-field);
  background: #eef0fa;
  color: var(--night);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-overflow: ellipsis;
}
.cc-wrap::after {
  content: ""; position: absolute; right: 12px; top: 50%;
  width: 7px; height: 7px;
  border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.phone-wrap input { border-radius: 0 var(--r-field) var(--r-field) 0; min-width: 0; flex: 1 1 auto; }

.parent-field.pop { animation: pop-open .35s ease-out; }
@keyframes pop-open {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.submit-btn {
  margin-top: 6px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  font: 800 1.2rem/1 var(--display);
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(208, 2, 27, .25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.submit-btn:hover { filter: brightness(1.05); }
.submit-btn:active { transform: translateY(1px) scale(.99); }
.submit-btn:disabled { opacity: .7; cursor: progress; }
.fine { margin: 0; text-align: center; font-size: .84rem; color: var(--muted); }

/* ---------- Thank-you ---------- */
.thanks-card { text-align: center; display: grid; gap: 8px; justify-items: center; }
.thanks-card p { margin: 0; max-width: 32em; }
.thanks-mark {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--rani));
  color: #fff;
  font-size: 2rem;
  margin-top: 6px;
}
.muted-line { color: var(--muted); }
.next-steps {
  list-style: none; counter-reset: step;
  margin: 8px 0 4px; padding: 0;
  display: grid; gap: 10px;
  text-align: left; max-width: 26em; width: 100%;
}
.next-steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 14px; background: #f4f5fc;
  line-height: 1.45;
}
.next-steps .step-text { min-width: 0; }
.next-steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--rani)); color: #fff;
  font: 800 1rem/1 var(--display);
}
.thanks-card .chip-btn { margin-top: 10px; }

/* ---------- Footer ---------- */
.foot {
  padding-inline: 16px;
  padding-block: 8px calc(24px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
}
.foot p { margin: 2px 0; }

/* ---------- Admin (students list) ---------- */
.admin-body { background: #f1f3fb; }
.admin-bar {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  align-items: center; justify-content: space-between;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  background: linear-gradient(120deg, var(--night), var(--night-2));
  color: #fff;
}
.admin-bar h1 { margin: 0; font: 800 1.3rem/1.2 var(--display); }
.admin-bar nav { display: flex; gap: 14px; flex-wrap: wrap; }
.admin-bar a { color: var(--marigold); font-weight: 600; text-decoration: none; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding-inline: 14px; padding-block: 18px 40px; display: grid; gap: 18px; }
.panel {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(21, 32, 107, .08);
  min-width: 0;
}
.panel h2 { margin: 0 0 10px; font: 800 1.25rem/1.2 var(--display); color: var(--night); }
.flash { padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.flash-ok { background: #e3f8f1; color: #0b6b52; border: 1.5px solid #3cbf98; }
.flash-err { background: var(--error-bg); color: var(--error); border: 1.5px solid var(--error); }
.counts { display: flex; flex-wrap: wrap; gap: 10px; }
.count-pill {
  flex: 1 1 140px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  border-left: 6px solid var(--accent);
}
.count-pill b { display: block; font: 800 1.45rem/1 var(--display); color: var(--night); font-variant-numeric: tabular-nums; }
.count-pill span { font-size: .88rem; color: var(--muted); }
.settings-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .settings-grid { grid-template-columns: 220px 1fr; align-items: start; } }
.poster-thumb { width: 100%; max-width: 220px; border-radius: 12px; border: 2px solid var(--line); }
.no-poster { display: grid; place-items: center; height: 140px; max-width: 220px; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: .9rem; text-align: center; padding: 10px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--rani); }
.check.remember { font-weight: 500; color: var(--ink); }
.panel textarea {
  width: 100%; min-height: 70px; padding: 10px 12px;
  border: 2px solid var(--line); border-radius: 12px;
  font: 500 1rem/1.4 var(--body); color: var(--ink); background: var(--field); resize: vertical;
}
.panel input[type=file] { font-size: .95rem; max-width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-solid {
  min-height: 44px; padding: 8px 20px; border: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--rani)); color: #fff;
  font: 700 1rem/1 var(--display); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
}
.btn-line {
  min-height: 40px; padding: 6px 16px; border: 2px solid var(--night); border-radius: 999px;
  background: #fff; color: var(--night); font: 700 .95rem/1 var(--display);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center;
}
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.filters select, .filters input { min-height: 44px; width: auto; flex: 1 1 180px; font-size: 1rem; }
.batch-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.batch-tag.tone-kids { background: #d9f5f2; color: #00706b; }
.batch-tag.tone-carnatic { background: #ffe8d1; color: #a84c00; }
.batch-tag.tone-cine { background: #ffdcec; color: #a10f56; }
.del-btn { border: 0; background: none; color: var(--error); font-weight: 600; cursor: pointer; padding: 6px 0; text-decoration: underline; font-size: .88rem; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* Follow-up status */
.status-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.status-chip.status-new       { background: #fff1c9; color: #7a5200; }
.status-chip.status-contacted { background: #dfe7ff; color: #1d3aa8; }
.status-chip.status-joined    { background: #d8f3e6; color: #0b6b44; }
.status-chip.status-declined  { background: #eceef3; color: #5b6075; }
.count-pill.status-pill { background: #fff; border-left-color: var(--night); }
.wa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 6px 14px; border-radius: 999px;
  background: #1da851; color: #fff; font: 700 .92rem/1 var(--display); text-decoration: none; white-space: nowrap;
}
.wa-btn:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.msg-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .msg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.msg-grid textarea { min-height: 190px; font-size: .95rem; }
.ph-help { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.ph-help code { background: #eef0fa; padding: 1px 6px; border-radius: 6px; }
details.panel > summary { cursor: pointer; font: 800 1.25rem/1.2 var(--display); color: var(--night); list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: " ▾"; color: var(--muted); }
details.panel[open] > summary { margin-bottom: 12px; }

/* Students: cards that fit any screen (no sideways scrolling) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 14px;
  align-items: start;
}
.stu-card {
  min-width: 0;
  display: grid; gap: 10px;
  padding: 14px 16px 14px 18px;
  border: 1.5px solid var(--line);
  border-left: 6px solid #d5d9ea;
  border-radius: 16px;
  background: #fff;
  scroll-margin-top: 16px;
}
.stu-card.status-new       { border-left-color: #f0b400; }
.stu-card.status-contacted { border-left-color: #3b5bdb; }
.stu-card.status-joined    { border-left-color: #1f9d6a; }
.stu-card.status-declined  { border-left-color: #9aa0b4; background: #fafafc; }
.stu-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; justify-content: space-between; }
.stu-title { min-width: 0; flex: 1 1 160px; display: grid; gap: 4px; justify-items: start; }
.stu-title h3 { margin: 0; font: 800 1.12rem/1.25 var(--display); color: var(--night); overflow-wrap: anywhere; }
.status-form { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.status-form select {
  min-height: 40px; padding: 6px 34px 6px 14px; width: auto; border-radius: 999px; font-weight: 700; font-size: .92rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2315206b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.stu-card.status-new .status-form select       { background-color: #fff6d6; border-color: #f0c84a; }
.stu-card.status-contacted .status-form select { background-color: #e6ecff; border-color: #a9b9f5; }
.stu-card.status-joined .status-form select    { background-color: #dcf5ea; border-color: #8fd6b6; }
.saved-note { font-size: .82rem; font-weight: 700; color: var(--muted); min-width: 0; }
.saved-note.ok { color: #0b6b44; }
.stu-facts { margin: 0; display: grid; gap: 4px; }
.stu-facts > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
.stu-facts dt { color: var(--muted); font-size: .82rem; font-weight: 600; padding-top: 2px; }
.stu-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.stu-card .row-actions { justify-content: space-between; }
.del-form { margin-left: auto; }

/* Open / close a batch */
.sub-h { margin: 16px 0 8px; font: 700 .95rem/1.2 var(--display); color: var(--night); letter-spacing: .02em; }
.batch-switches { display: grid; gap: 8px; }
.batch-switch {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff;
}
.batch-switch .bs-name { flex: 1 1 180px; min-width: 0; }
.batch-switch .bs-name .batch-tag { white-space: normal; }
.bs-state { font-weight: 700; font-size: .88rem; padding: 2px 10px; border-radius: 999px; }
.batch-switch.is-open .bs-state { background: #d8f3e6; color: #0b6b44; }
.batch-switch.is-closed { background: #f6f6f9; }
.batch-switch.is-closed .bs-state { background: #eceef3; color: #5b6075; }
.bs-btn { min-height: 40px; }
.closed-tag { font-style: normal; font-weight: 700; color: #5b6075; }
.full-note { color: var(--muted); }
