/* Schools.Career.Studio: parent sign-up and setup. Mobile first. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0efea;
  --ink: #15201c;
  --muted: #5a6964;
  --line: #e2e0d8;
  --teal: #0f766e;
  --teal-strong: #0b5f58;
  --on-teal: #ffffff;
  --teal-soft: #e3f1ee;
  --ok: #0f766e;
  --warn-ink: #7a4f00;
  --warn-soft: #fbf1d8;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(21, 32, 28, .05), 0 6px 20px rgba(21, 32, 28, .05);
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1311;
    --surface: #141c19;
    --surface-2: #1a2420;
    --ink: #e7eeeb;
    --muted: #9db0a9;
    --line: #26332e;
    --teal: #2dd4bf;
    --teal-strong: #5eead4;
    --on-teal: #04211d;
    --teal-soft: #10302a;
    --ok: #2dd4bf;
    --warn-ink: #f3c86e;
    --warn-soft: #2b2311;
    --danger: #ff8a80;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--teal); }
b, strong { font-weight: 650; }

.top, main, .foot { width: 100%; max-width: 620px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: .01em; }
.brand b { color: var(--teal); }
.mark { width: 30px; height: 30px; flex: none; }
.mark rect { fill: var(--teal); }
.mark path { fill: var(--on-teal); }
.mark path.cap { fill: none; stroke: var(--on-teal); stroke-width: 2; }
#nav { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: .92rem; }
#nav .who { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.brand span, #nav .link { white-space: nowrap; }
@media (max-width: 480px) { #nav .who { display: none; } }

main { flex: 1; padding-top: 12px; padding-bottom: 40px; outline: none; }
.foot { color: var(--muted); font-size: .85rem; padding-bottom: 28px; text-align: center; }

h1 { font-size: 1.85rem; line-height: 1.15; letter-spacing: -.02em; margin: 18px 0 10px; outline: none; }
h2 { font-size: 1.12rem; line-height: 1.3; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
p { margin: 0 0 12px; }
.lead { font-size: 1.06rem; color: var(--muted); margin-bottom: 22px; }
/* The opening promise on step 1, read before the practical detail. */
.lead.hope { font-size: 1.2rem; font-weight: 600; color: var(--ink); line-height: 1.4; margin-bottom: 10px; }
.muted { color: var(--muted); }
.hint, .fine { color: var(--muted); font-size: .9rem; }
.fine { margin-top: 16px; }
.error { color: var(--danger); font-size: .95rem; min-height: 0; }
.error:empty { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loading { color: var(--muted); padding: 40px 0; }

/* progress */
.steps { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps li { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; color: var(--muted); }
.steps li::before { content: ""; height: 4px; border-radius: 4px; background: var(--line); }
.steps li.done::before, .steps li.now::before { background: var(--teal); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps .dot { display: none; }

/* cards and sections */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 14px; box-shadow: var(--shadow); }
.card.soft { background: var(--teal-soft); border-color: transparent; box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-strong); font-size: .85rem; font-weight: 700; flex: none; }
.optional { font-weight: 500; font-size: .8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.badge { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--teal-soft); color: var(--teal-strong); }

/* forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-weight: 600; font-size: .95rem; }
input[type=text], input[type=email], input[type=search], input[type=password], select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; min-height: 52px; padding: 0 14px; width: 100%;
  -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
input::placeholder { color: var(--muted); opacity: .8; }
/* Password with a Show button; the emailed 6-digit code. */
.pw { display: flex; gap: 8px; align-items: stretch; }
.pw input { flex: 1; min-width: 0; }
.pw .btn.small { min-height: 52px; }
input.code { font-size: 1.5rem; letter-spacing: .35em; text-align: center; max-width: 11ch; font-variant-numeric: tabular-nums; padding: 0 8px 0 calc(8px + .35em); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; min-height: 52px; padding: 0 22px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.btn.primary:hover { background: var(--teal-strong); border-color: var(--teal-strong); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .92rem; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn[aria-busy=true] { opacity: .7; cursor: progress; }
.btn:focus-visible, .link:focus-visible, .result:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--teal); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.actions .btn { width: 100%; }
form .btn.primary[type=submit] { margin-top: 6px; }

/* school picker */
.picker { position: relative; }
.results { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.results:empty { display: none; }
.results li + li { border-top: 1px solid var(--line); }
.result { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; padding: 12px 14px; cursor: pointer; }
.result:hover { background: var(--surface-2); }
.result .muted, .chosen .muted { font-size: .88rem; }
.results .empty { padding: 12px 14px; font-size: .92rem; }
.chosen { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--teal); border-radius: 12px; background: var(--teal-soft); }
.chosen > div { display: flex; flex-direction: column; min-width: 0; }
.chosen[hidden], input[hidden] { display: none; }

.saved { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--teal-soft); margin-bottom: 18px; font-size: .95rem; }
.saved .tick { color: var(--ok); font-weight: 700; }
.saved a { margin-left: auto; }

/* membership */
.plan .price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.plan .amount { font-size: 2.3rem; font-weight: 700; letter-spacing: -.02em; }
.plan .per { color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 700; }
.notice { background: var(--warn-soft); color: var(--warn-ink); border-radius: 12px; padding: 12px 14px; font-size: .95rem; }

/* copyable values */
.copy { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--surface-2); margin: 6px 0 10px; }
.copy .value { flex: 1; min-width: 0; font-family: var(--mono); font-size: .95rem; overflow-wrap: anywhere; }
.copy .btn { flex: none; }

/* live status */
.status { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin: 8px 0 12px; font-size: .95rem; }
.card > .status:last-child { margin-bottom: 0; }
/* Connect Gmail, inside "Make it automatic". */
.subcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.subcard h3 { margin: 0; font-size: 1rem; }
.gmail-connect { display: flex; flex-direction: column; gap: 10px; }
.gmail-connect .status { margin: 0; }
.status.ok { background: var(--teal-soft); }
.status .tick { color: var(--ok); font-weight: 800; font-size: 1.1rem; line-height: 1.3; }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .92rem; padding: 10px 0; margin: 0; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); flex: none; margin-top: 7px; animation: pulse 1.6s ease-in-out infinite; }
.waiting .pulse { margin-top: 0; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; opacity: .7; } .btn { transition: none; } }

/* how-to steps */
details { border-top: 1px solid var(--line); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; padding: 14px 2px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.3rem; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "–"; }
.howto { margin: 0 0 16px; padding-left: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.howto > li { counter-increment: s; position: relative; padding-left: 36px; }
.howto > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: var(--muted); }
.howto p { margin-bottom: 6px; }
.howto .btn { margin: 2px 0 4px; }

/* invite */
.invite .row { display: flex; gap: 8px; }
.invite input { flex: 1; min-width: 0; }
.invite .btn { flex: none; }
.invite .hint, .invite .error { margin-top: 8px; }

/* AI prompts */
.asks { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 8px; }
.asks li { background: var(--surface); border-radius: 12px; padding: 10px 14px; font-size: .97rem; }

/* home */
.child h2 { font-size: 1.3rem; margin-bottom: 2px; }
.kv { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; gap: 8px; align-items: baseline; }
.list .tick { color: var(--ok); font-weight: 700; }
.access-list li { flex-direction: column; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
.access-list li:last-child { border-bottom: 0; }
.access-list .when { font-size: .85em; color: var(--muted, #6b6b6b); }
.more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

@media (min-width: 560px) {
  h1 { font-size: 2.15rem; }
  .card { padding: 24px; }
  .actions { flex-direction: row-reverse; justify-content: flex-start; }
  .actions .btn { width: auto; min-width: 220px; }
  .steps .dot { display: none; }
}

/* School senders */
.list.senders li { align-items: center; justify-content: space-between; }
.list.senders .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sender-ask p { margin: 0 0 8px; overflow-wrap: anywhere; }
.sender-ask .actions { margin: 0; gap: 12px; align-items: center; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }

/* Class photos (from a feed portal such as Weduc / Cognita Connect) */
.photo-post { margin: 0 0 14px; }
.photo-post .meta { color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.photo-post .summary { margin: 0 0 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin: 0 0 12px; }
.photo-grid a { display: block; border-radius: 8px; overflow: hidden; background: var(--teal-soft); }
.photo-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-save { display: flex; flex-direction: column; gap: 6px; }
.photo-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.photo-head h2 { margin-bottom: 0; }
.photo-tools { display: flex; gap: 14px; align-items: baseline; font-size: .95rem; }
.photo-pick { position: relative; display: block; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--teal-soft); cursor: pointer; }
.photo-pick img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-grid.selecting .photo-pick:not(.on) img { opacity: .85; }
.photo-pick.on { outline: 3px solid var(--teal); outline-offset: -3px; }
.photo-pick .check { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .25); color: #fff; font-weight: 700; font-size: 14px; line-height: 20px; text-align: center; }
.photo-pick.on .check { background: var(--teal); }

/* Full-screen photo viewer */
.photo-open { display: block; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--teal-soft); cursor: zoom-in; }
.photo-open img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.viewer { position: fixed; inset: 0; z-index: 50; background: #0b0f11; color: #fff; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.viewer-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 8px 132px; box-sizing: border-box; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.viewer-close { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 28px; line-height: 44px; cursor: pointer; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 36px; cursor: pointer; }
.viewer-nav.prev { left: 8px; }
.viewer-nav.next { right: 8px; }
.viewer-nav:disabled { opacity: .25; cursor: default; }
.viewer-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.viewer-count { font-size: .9rem; opacity: .8; }
.viewer-save { width: min(420px, 100%); }
.viewer-msg { margin: 0; min-height: 1.2em; font-size: .9rem; opacity: .9; }
@media (hover: none) { .viewer-nav { display: none; } }

/* Add to the records */
textarea { width: 100%; box-sizing: border-box; min-height: 84px; padding: 12px 14px; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
textarea::placeholder { color: var(--muted); opacity: .8; }
.add-files { margin: 12px 0; }
.add-files li { justify-content: space-between; align-items: center; word-break: break-all; }
#add-child { margin-bottom: 4px; }
.add-pick { margin-top: 0; }
.photo-post.linked { outline: 3px solid var(--teal); outline-offset: 2px; }
