/* ───────────────────────────────────────────────────────────────
   Spectrum Steps v5.0 — account & parent pages (sign in, invitation, password,
   profile picker, parent dashboard). Uses the tokens from base.css.
   ─────────────────────────────────────────────────────────────── */
body.portal { margin: 0; min-height: 100vh; background: var(--md-paper); color: var(--md-ink); font-family: var(--font-body); }
body.portal * { box-sizing: border-box; }
.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img.mark { width: 64px; height: 64px; object-fit: contain; }
.brand img.letters { height: 50px; width: auto; }
.brand .tagline { display: block; font-size: 0.85rem; font-weight: 800; color: var(--md-ink-soft); margin-top: 2px; }
.portal-header nav { display: flex; gap: 8px; flex-wrap: wrap; }

.portal-main { max-width: 1100px; margin: 0 auto; padding: 8px 28px 64px; }
.auth-wrap { display: grid; place-items: start center; padding-top: 3vh; }
.auth-card {
  width: min(460px, 100%); background: #fff; border: 1px solid var(--md-line);
  border-radius: 24px; padding: 30px 28px;
}
.auth-card h1 { font-family: var(--font-display); font-size: var(--fs-4); line-height: 1.1; margin: 0 0 6px; }
.auth-card .lede { color: var(--md-ink-soft); margin: 0 0 22px; font-weight: 600; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 800; margin-bottom: 6px; }
.field .hint { font-size: 0.85rem; color: var(--muted); margin-top: 4px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--md-ink);
  background: #fff; border: 2px solid var(--md-line); border-radius: 12px;
}
.field input[readonly] { background: #F3F7FB; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--md-blue); outline: none; box-shadow: 0 0 0 3px rgba(78,127,216,0.25); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; margin: 10px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--md-sky-deep); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 14px; border: 2px solid var(--md-line);
  background: #fff; color: var(--md-ink); font: inherit; font-weight: 900; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--md-blue); }
.btn-primary { background: var(--md-navy); border-color: var(--md-navy); color: #fff; }
.btn-primary:hover { background: var(--md-navy-deep); border-color: var(--md-navy-deep); }
.btn-danger { background: #fff; border-color: #E6A39A; color: #9A2E22; }
.btn-danger:hover { background: #FFF0EE; }
.btn-small { padding: 7px 12px; font-size: 0.9rem; border-radius: 10px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.link { color: var(--md-navy); font-weight: 800; }

.form-error { color: #9A2E22; background: #FFF0EE; border: 1px solid #F3C4BD; border-radius: 12px; padding: 10px 12px; font-weight: 700; margin: 0 0 14px; }
.form-ok { color: #1E6B48; background: #E7F6EE; border: 1px solid #B8E5CF; border-radius: 12px; padding: 10px 12px; font-weight: 700; margin: 0 0 14px; }
.form-error:empty, .form-ok:empty { display: none; }
.muted { color: var(--muted); font-weight: 600; }
.small { font-size: 0.9rem; }

/* Profile picker */
.profiles-title { font-family: var(--font-display); font-size: var(--fs-5); text-align: center; margin: 12px 0 6px; }
.profiles-sub { text-align: center; color: var(--md-ink-soft); font-weight: 700; margin: 0 0 28px; }
.profile-grid { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.profile-card {
  width: 190px; padding: 22px 16px; border-radius: 26px; border: 3px solid var(--md-line); background: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; font: inherit; color: var(--md-ink);
}
.profile-card:hover, .profile-card:focus-visible { border-color: var(--md-blue); }
.profile-card .avatar { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 3.2rem; background: #FFF3B8; }
.profile-card:nth-child(4n+2) .avatar { background: #D5F3E5; }
.profile-card:nth-child(4n+3) .avatar { background: #ECE1FB; }
.profile-card:nth-child(4n+4) .avatar { background: #FFE3D9; }
.profile-card .name { font-family: var(--font-display); font-size: var(--fs-2); font-weight: 800; }
.profiles-actions { display: flex; justify-content: center; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.empty-state { text-align: center; background: #fff; border: 2px dashed var(--md-line); border-radius: 24px; padding: 32px; max-width: 520px; margin: 0 auto; }

/* Parent dashboard */
.dash-title { font-family: var(--font-display); font-size: var(--fs-4); margin: 6px 0 4px; }
.dash-sub { color: var(--md-ink-soft); font-weight: 700; margin: 0 0 22px; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.panel { grid-column: span 6; background: #fff; border: 1px solid var(--md-line); border-radius: 22px; padding: 22px; min-width: 0; }
.panel.wide { grid-column: span 12; }
.panel h2 { font-family: var(--font-display); font-size: var(--fs-3); margin: 0 0 4px; }
.panel > p.desc { color: var(--md-ink-soft); margin: 0 0 16px; font-weight: 600; }
.child-list { display: grid; gap: 10px; margin-bottom: 14px; }
.child-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--md-line); border-radius: 16px; }
.child-row .avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; background: #FFF3B8; flex: 0 0 auto; }
.child-row .meta { flex: 1; min-width: 0; }
.child-row .meta strong { display: block; font-size: 1.05rem; }
.child-row .meta span { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.inline-form .full { grid-column: 1 / -1; }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.avatar-picker button { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--md-line); background: #fff; font-size: 1.5rem; cursor: pointer; }
.avatar-picker button[aria-pressed="true"] { border-color: var(--md-sky-deep); background: #E6F2FC; }
.summary-list { margin: 10px 0; padding: 12px 16px; background: #F6F9FD; border-radius: 14px; border: 1px solid var(--md-line); }
.summary-list li { margin: 4px 0; font-weight: 700; }
.invite-url { display: flex; gap: 8px; margin-top: 10px; }
.invite-url input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--md-line); }
.table th { color: var(--md-ink-soft); font-weight: 800; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.media-item { border: 1px solid var(--md-line); border-radius: 14px; overflow: hidden; background: #F6F9FD; }
.media-item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.media-item .cap { padding: 6px 8px; font-size: 0.8rem; font-weight: 700; display: flex; justify-content: space-between; gap: 4px; align-items: center; }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 800; border-radius: 999px; padding: 2px 10px; background: #EDF3F9; color: var(--md-ink-soft); }
.pill.ok { background: #E3F6EC; color: #1E6B48; }
.pill.warn { background: #FFF4C2; color: #6B5000; }
.danger-zone { border-color: #F3C4BD; }
.section-gap { margin-top: 16px; }

@media (max-width: 860px) {
  .panel { grid-column: span 12; }
  .inline-form { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .portal-header { padding: 14px 16px; }
  .portal-main { padding: 4px 16px 48px; }
  .brand img.letters { height: 30px; }
  .brand .tagline { display: none; }
  .auth-card { padding: 22px 18px; }
  .profile-card { width: 150px; }
}

/* ── v5.1: Parent Dashboard quick links and Activity Journal ── */
.dash-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 18px; }
.dash-link { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; border-radius: 16px; background: rgba(255,255,255,0.95);
  border: 2px solid var(--md-line); color: var(--md-ink); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; text-align: left; }
.dash-link span { font-size: 1.4rem; }
.dash-link:hover, .dash-link:focus-visible { border-color: var(--md-blue); }
.dash-nav-note { margin: -8px 0 16px; }
.journal-range-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.journal-range { font-weight: 800; }
.journal-list { margin-top: 14px; }
.pj-day { border-top: 2px solid var(--md-line); padding: 12px 0; }
.pj-day h3 { margin: 0 0 6px; }
.pj-activity { border: 1px solid var(--md-line); border-radius: 14px; padding: 10px 12px; margin: 8px 0; background: #fff; }
.pj-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pj-icon { font-size: 1.6rem; }
.pj-title { flex: 1 1 180px; min-height: 40px; padding: 6px 10px; border: 2px solid var(--md-line); border-radius: 10px; font: inherit; font-weight: 800; }
.pj-status { min-height: 40px; border-radius: 10px; border: 2px solid var(--md-line); padding: 4px 8px; font: inherit; }
.pj-links, .pj-notes { margin: 6px 0 0 18px; padding: 0; }
.pj-media img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; margin: 6px 6px 0 0; }
.pj-note-form, .pj-photo-form { margin-top: 6px; }
.pj-said ul { margin: 6px 0 0 18px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #EEF2F7; font-size: 0.8rem; font-weight: 800; }
.pill-warn { background: #FFF4C2; color: #5C4300; }

/* v5.2.1: small, quiet Admin entry under "Sign in" on the welcome page */
.admin-entry { display: flex; justify-content: center; margin-top: 12px; }
.btn-admin {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 6px 16px;
  border: 2px solid var(--md-blue); border-radius: 12px; background: #fff; color: var(--md-navy);
  font-weight: 800; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px;
}
.btn-admin:hover { background: #F1F6FC; }
.btn-admin:focus-visible { outline: 3px solid var(--md-blue); outline-offset: 2px; }

/* v5.2.1: administrator page */
.admin-wrap { display: grid; gap: 18px; justify-items: center; padding-top: 2vh; }
.admin-card { width: min(640px, 100%); }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head h1 { margin: 0; }
.admin-who { color: var(--md-ink-soft); font-weight: 700; margin: 4px 0 0; overflow-wrap: anywhere; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .admin-grid { grid-template-columns: 1fr; } }
.inv-list { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.inv-list th { text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--md-ink-soft); padding: 8px 6px; border-bottom: 2px solid var(--md-line); }
.inv-list td { padding: 10px 6px; border-bottom: 1px solid var(--md-line); vertical-align: top; overflow-wrap: break-word; }
.inv-list td[data-col="email"] { min-width: 190px; word-break: break-word; }
.inv-list td[data-col="date"] { white-space: nowrap; }
#admin-list-card h2 { margin: 0 0 10px; font-family: var(--font-display); }
.inv-status { display: inline-block; font-size: 0.8rem; font-weight: 900; border-radius: 999px; padding: 2px 10px; background: #E8EEF8; color: #1B3F82; white-space: nowrap; }
.inv-status[data-status="Registered"] { background: #DDF3E6; color: #1F5E3A; }
.inv-status[data-status="Failed"] { background: #FFE6E2; color: #9A2E22; }
.inv-status[data-status="Expired"], .inv-status[data-status="Cancelled"] { background: #EEF1F5; color: #4D5D78; }
.inv-note { display: block; font-size: 0.8rem; color: #9A2E22; font-weight: 700; margin-top: 4px; }
@media (max-width: 560px) {
  .inv-list thead { display: none; }
  .inv-list tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--md-line); }
  .inv-list td { border: 0; padding: 2px 0; }
  .inv-list td[data-col="email"] { min-width: 0; overflow-wrap: anywhere; }
  .inv-list td[data-col="email"] { grid-column: 1 / -1; }
}
