/* Parent portal: builds on the public site's style.css (colours, fonts, buttons). */

.portal { min-height: 100vh; display: flex; flex-direction: column; }
.portal-main { flex: 1; padding-block: clamp(24px, 4vw, 48px); }
.portal-header .header-inner { height: 68px; }
.portal-header .tools { margin-inline-start: auto; }
.inline-form { display: inline; margin: 0; }
.portal-footer { border-top: 1px solid var(--line); padding-block: 18px 24px; font-size: .92rem; }
.portal-footer a { color: var(--ink-soft); }

.narrow { max-width: 560px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(20px, 4vw, 36px);
}
.card + .card { margin-top: 18px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.err-code { font-family: var(--font-display); font-size: 3.4rem; font-weight: 800; line-height: 1; margin: 0 0 8px; color: var(--mat-b); }

.card h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 6px; }
.h3 { font-size: 1.25rem; margin: 22px 0 10px; }
.form { margin-top: 18px; }
.form .btn { margin-top: 6px; }
.btn-block { width: 100%; }
.hint { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 16px; cursor: pointer; line-height: 1.6; }
.check input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--emerald); flex: none; }
.login-links { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .97rem; }
.login-links p { margin: 0 0 6px; }

/* navigation under the header (manager / teacher) */
.portal-nav { display: flex; gap: 4px; overflow-x: auto; padding-block: 0 10px; scrollbar-width: none; }
.portal-nav::-webkit-scrollbar { display: none; }
.portal-nav a {
  flex: none; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink);
  font-weight: 500; font-size: .95rem; white-space: nowrap;
}
.portal-nav a:hover { background: var(--bg-soft); }
.portal-nav a[aria-current="page"] { background: var(--bg-soft); color: var(--link); font-weight: 600; }

.page-title { font-size: clamp(1.7rem, 4vw, 2.3rem); margin-bottom: 18px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 18px; }
.page-head .page-title { margin: 0; }
.btn-sm { min-height: 40px; padding: 6px 16px; font-size: .92rem; }

.stat-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.stat {
  display: grid; gap: 2px; min-width: 180px; padding: 18px 22px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none;
}
.stat:hover { border-color: var(--emerald); }
.stat-num { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; line-height: 1.1; color: var(--link); }
.stat-label { color: var(--ink-soft); font-size: .95rem; }

.rows { list-style: none; margin: 0 0 20px; padding: 0; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 10px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row-main { flex: 1 1 240px; display: grid; gap: 2px; color: var(--ink); text-decoration: none; min-width: 0; }
.row-main:hover strong { color: var(--link); }
.row-main .muted { font-size: .93rem; overflow-wrap: anywhere; }
.row-muted { opacity: .7; }
.pill {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap;
}
.pill-ok { background: color-mix(in srgb, var(--emerald) 14%, transparent); border-color: color-mix(in srgb, var(--emerald) 40%, transparent); color: var(--link); }

.search-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.search-form input, .search-form select {
  flex: 1 1 200px; min-height: 44px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
}
.search-form select { flex: 0 1 200px; }

.checks { border: 0; padding: 0; margin: 0 0 16px; }
.checks legend { font-weight: 600; font-size: .97rem; margin-bottom: 8px; padding: 0; }
.checks .check { margin: 0 0 8px; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0 0 14px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-flex; align-items: center; min-height: 42px; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-weight: 500;
}
.seg input:checked + span { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.signup-card h2 { margin-top: 0; }
.signup-card p { margin: 0 0 6px; }
.approve-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.approve-form .when-existing { display: none; }
.approve-form:has(input[value="existing"]:checked) .when-existing { display: block; }
.approve-form:has(input[value="existing"]:checked) .when-new { display: none; }
.reject { margin-top: 10px; }
.reject summary { cursor: pointer; color: var(--ink-soft); font-weight: 500; }

.temp-pw { border-color: var(--emerald); }
.temp-pw h2 { margin-top: 0; }
.temp-pw-value { font-family: ui-monospace, Consolas, monospace; font-size: 1.8rem; letter-spacing: .08em; margin: 0 0 8px; color: var(--link); }
.actions-card { display: flex; flex-wrap: wrap; gap: 10px; }
.form-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; }
.form-inline .field { flex: 1 1 200px; }
.form-inline .btn { margin-bottom: 18px; }

/* teacher: class day */
.day-nav { display: flex; align-items: center; gap: 10px; margin: -8px 0 0; }
[dir="rtl"] .day-nav .i { transform: scaleX(-1); }
.class-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.class-actions .btn .i { width: 20px; height: 20px; }
.child-rows .row { padding-block: 14px; }
.child-rows .pill .i { width: 14px; height: 14px; vertical-align: -2px; }
.state-none .row-main strong { color: var(--ink); }

/* teacher: report form */
.seg-field { border: 0; padding: 0; margin: 0 0 18px; }
.seg-field legend { font-weight: 600; font-size: 1rem; margin-bottom: 8px; padding: 0; }
.seg-field .seg { margin: 0; }
.seg-field .seg span { min-height: 48px; padding-inline: 18px; font-size: 1rem; }
.seg-field.has-error .seg span { border-color: #c2412d; }
.nap-minutes { display: none; }
.report-form:has(input[name="nap"][value="slept"]:checked) .nap-minutes { display: block; }
.form-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.form-buttons .btn { flex: 1 1 180px; }
.hint .i { width: 16px; height: 16px; vertical-align: -3px; color: var(--emerald); }

/* photos */
.card h2 .i { width: 22px; height: 22px; vertical-align: -4px; color: var(--emerald); }
.thumbs { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumbs li { position: relative; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); background: var(--bg-soft); display: block; }
.thumb-del { position: absolute; top: 6px; inset-inline-end: 6px; width: 34px; height: 34px; background: rgb(0 0 0 / .55); color: #fff; border-color: transparent; }
.thumb-del .i { width: 16px; height: 16px; }
.upload-drop { display: block; cursor: pointer; }
.upload-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-drop span {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 84px; padding: 16px;
  border: 2px dashed var(--line); border-radius: var(--r); color: var(--link); font-weight: 600; text-align: center;
}
.upload-drop:hover span, .upload-drop input:focus-visible + span { border-color: var(--emerald); }
.upload-form.is-busy { opacity: .6; pointer-events: none; }
.js .upload-form[data-autosubmit] > .btn { display: none; }

/* class updates */
.no-consent {
  margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-sm);
  background: color-mix(in srgb, #e5484d 10%, transparent); border: 1px solid color-mix(in srgb, #e5484d 40%, transparent);
}
.no-consent ul { margin: 6px 0 0; padding-inline-start: 20px; }
.post-rows strong .i { width: 18px; height: 18px; vertical-align: -3px; color: var(--emerald); }

/* parents: family */
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.kid-card {
  display: grid; gap: 14px; padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.kid-card:hover { border-color: var(--emerald); }
.kid-head { display: flex; align-items: center; gap: 12px; }
.kid-head > span:last-child { display: grid; }
.kid-initial {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: var(--mat-b); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem;
}
.kid-head strong { font-size: 1.2rem; }
.kid-today { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.kid-today-label { font-weight: 600; color: var(--link); }
.kid-today .line { display: flex; justify-content: space-between; gap: 12px; }
.kid-today .i { width: 16px; height: 16px; vertical-align: -3px; }
.kid-more { color: var(--link); font-weight: 600; }

/* parents: timeline */
.narrow-wide { max-width: 760px; }
.page-sub { margin: -12px 0 0; }
.day-card { padding-top: 22px; }
.day-title { font-size: 1.4rem; margin: 0 0 12px; }
.updated-mark { display: inline-block; margin: 0 0 10px; padding: 3px 12px; border-radius: 999px; font-size: .85rem; background: var(--bg-soft); color: var(--ink-soft); }
.report-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 14px; }
.report-lines > div { padding: 10px 12px; border-radius: var(--r-sm); background: var(--bg-soft); }
.report-lines dt { font-size: .85rem; color: var(--ink-soft); }
.report-lines dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.photo-grid a { display: block; border-radius: var(--r-sm); overflow: hidden; cursor: zoom-in; }
.teacher-note { margin: 0 0 12px; padding: 12px 16px; border-inline-start: 4px solid var(--mat-b); background: var(--bg-soft); border-radius: var(--r-sm); }
.teacher-note p { margin: 4px 0 0; }
.class-post { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.class-post-label { margin: 0 0 6px; font-weight: 600; color: var(--link); }
.class-post-label .i { width: 18px; height: 18px; vertical-align: -3px; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
.lightbox::backdrop { background: rgb(4 14 10 / .9); }
.lightbox img { max-width: 94vw; max-height: 88vh; border-radius: var(--r); display: block; }
.lb-close { position: fixed; top: 14px; inset-inline-end: 14px; color: #fff; background: rgb(0 0 0 / .4); border-color: rgb(255 255 255 / .4); }

/* demo mode */
.demo-card { border-color: var(--emerald); margin-bottom: 18px; }
.demo-roles { display: grid; gap: 10px; margin: 16px 0 12px; }
.demo-roles form { margin: 0; }
.demo-banner { background: color-mix(in srgb, var(--mat-b) 16%, var(--bg)); border-bottom: 1px solid var(--line); }
.demo-banner-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 10px; }
.demo-banner p { margin: 0; font-weight: 500; font-size: .95rem; }
.demo-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip-btn {
  min-height: 34px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 .9rem/1.2 var(--font-body); cursor: pointer;
}
.chip-btn:hover { border-color: var(--emerald); }
.chip-btn.is-current { background: var(--emerald); border-color: var(--emerald); color: var(--on-emerald); }

.danger-zone summary { cursor: pointer; font-weight: 600; color: #c2412d; }
.btn-danger { background: #c2412d; color: #fff; }
.btn-danger:hover { background: #a3331f; }
.btn .i { width: 18px; height: 18px; }

.flash { padding: 12px 16px; border-radius: var(--r-sm); margin: 0 0 18px; font-weight: 500; }
.flash-ok { background: color-mix(in srgb, var(--emerald) 14%, transparent); color: var(--ink); border: 1px solid color-mix(in srgb, var(--emerald) 45%, transparent); }
.flash-error { background: color-mix(in srgb, #c2412d 12%, transparent); color: var(--ink); border: 1px solid color-mix(in srgb, #c2412d 45%, transparent); }
