/* =====================================================================
   assets/public-ui.css — the DASHBOARD LOOK for pages opened without an account (new, 5 Nov 2026)
   =====================================================================
   Used together with assets/student-ui.css (all colours, fonts and the
   "sd-" pieces come from there) by: parent.php, tasks.php, share.php,
   certificate.php, report_card.php, support.php and, for visitors
   without an account, leaderboard.php. The PHP side is
   includes/public_shell.php (ps_head, ps_topbar, ps_foot).
   Every class here starts with "ps-". Plain CSS, no build step.
   Night / day: html.dark (the same switch as the whole site).
   ===================================================================== */

/* ── top bar for visitors ─────────────────────────────────────────── */
.ps-sp { flex: 1; }
.ps-top .sd-btn.sm { min-height: 36px; }
@media (max-width: 560px) { .ps-top .ps-up { display: none; } }

/* ── page widths ──────────────────────────────────────────────────── */
.ps-narrow { max-width: 780px; }
.ps-mid { max-width: 980px; }
@media (max-width: 760px) { body.sd.ps-page { padding-bottom: 0; } }

/* ── the hero card (like the dashboard's command deck) ────────────── */
.ps-hero { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 24px 26px; box-shadow: var(--shadow); }
html.dark .ps-hero { background: linear-gradient(135deg, #121840 0%, #0f1430 55%, #0c1130 100%); }
.ps-hero::before { content: ""; position: absolute; inset: -50% -12% auto auto; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(255,201,71,.16), transparent 62%); pointer-events: none; }
.ps-hero > * { position: relative; }
.ps-hero h1 { margin: 6px 0 6px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.ps-hero .mot { margin: 0; color: var(--body); font-size: 15px; max-width: 600px; }
.ps-hero .mot b { color: var(--gold-txt); } html.dark .ps-hero .mot b { color: var(--gold); }
.ps-who { display: flex; align-items: center; gap: 16px; }
.ps-who .av > * { width: 64px !important; height: 64px !important; font-size: 26px !important; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--gold-fill); border-radius: 99px; }
.ps-acc { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--k, var(--gold-fill)); }
@media (max-width: 760px) { .ps-hero { padding: 18px; border-radius: 20px; } .ps-hero h1 { font-size: 24px; } }

/* ── the band ring (share card) ───────────────────────────────────── */
.ps-ringrow { display: flex; align-items: center; gap: 22px; }
.ps-ring { position: relative; width: 150px; height: 150px; flex: none; }
.ps-ring svg { display: block; width: 100%; height: 100%; }
.ps-ring .track { stroke: var(--line2); } html.dark .ps-ring .track { stroke: rgba(255,255,255,.1); }
.ps-ring .val { transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); }
.ps-ring .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ps-ring .num b { font-family: var(--num-font); font-weight: 400; font-size: 54px; line-height: 1; color: var(--gold-txt); }
html.dark .ps-ring .num b { color: var(--gold); text-shadow: 0 0 24px rgba(255,201,71,.35); }
@media (max-width: 520px) { .ps-ringrow { flex-direction: column; text-align: center; } .ps-ring { width: 132px; height: 132px; } .ps-ring .num b { font-size: 46px; } }

/* ── small number tiles (reuses .sd-stat from student-ui.css) ─────── */
.ps-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ps-tiles .sd-stat { cursor: default; }
.ps-tiles .sd-stat.L .v { color: var(--l-ink); } .ps-tiles .sd-stat.R .v { color: var(--r-ink); }
.ps-tiles .sd-stat.W .v { color: var(--w-ink); } .ps-tiles .sd-stat.S .v { color: var(--s-ink); }
html.dark .ps-tiles .sd-stat.L .v { color: var(--l); } html.dark .ps-tiles .sd-stat.R .v { color: var(--r); }
html.dark .ps-tiles .sd-stat.W .v { color: var(--w); } html.dark .ps-tiles .sd-stat.S .v { color: var(--s); }
.ps-tiles .sd-stat.gold .v { color: var(--gold-txt); } html.dark .ps-tiles .sd-stat.gold .v { color: var(--gold); }
.ps-tiles .sd-stat.ok .v { color: var(--ok); }
.ps-tiles .sd-stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--k, transparent); }
.ps-tiles .sd-stat.L { --k: var(--l); } .ps-tiles .sd-stat.R { --k: var(--r); } .ps-tiles .sd-stat.W { --k: var(--w); } .ps-tiles .sd-stat.S { --k: var(--s); }
@media (max-width: 420px) { .ps-tiles { grid-template-columns: 1fr 1fr; } }

/* ── status words in lists ────────────────────────────────────────── */
.ps-st { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-weight: 800; font-size: 12.5px; white-space: nowrap; background: var(--line2); color: var(--mute); }
.ps-st.ok { background: var(--ok-soft); color: var(--ok); }
.ps-st.late { background: var(--s-soft); color: var(--s-ink); } html.dark .ps-st.late { color: var(--s); }
.ps-st.bad { background: var(--bad-soft); color: var(--bad); }
.ps-res { font-family: var(--num-font); font-size: 20px; min-width: 64px; text-align: right; color: var(--ink); }
.ps-rows .sd-row { flex-wrap: nowrap; }
.ps-rows .sd-row .ti { min-width: 0; }
.ps-rows .sd-row .ti b { overflow-wrap: anywhere; }
@media (max-width: 520px) { .ps-rows .sd-row { flex-wrap: wrap; } .ps-rows .sd-row .ti { flex-basis: 100%; } .ps-res { margin-left: auto; } }

/* ── homework cards (tasks.php) ───────────────────────────────────── */
.ps-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 640px) { .ps-tasks { grid-template-columns: 1fr; } }
.ps-task { --k: var(--brand); --ks: var(--brand-soft); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; animation: psUp .45s both; }
.ps-task::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--k); }
.ps-task::after { content: ""; position: absolute; right: -36px; top: -36px; width: 110px; height: 110px; border-radius: 50%; background: var(--ks); opacity: .8; pointer-events: none; }
.ps-task > * { position: relative; z-index: 1; }
.ps-task .top { display: flex; gap: 12px; align-items: flex-start; }
.ps-task .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--ks); flex: none; }
.ps-task .k { font-family: var(--lab-font); font-weight: 700; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--k); }
.ps-task h2 { margin: 2px 0 0; font-size: 16.5px; line-height: 1.3; font-weight: 800; overflow-wrap: anywhere; }
.ps-task .sub { color: var(--mute); font-size: 13px; margin-top: 2px; }
.ps-task.done { opacity: .78; }
.ps-task.done::before { background: var(--ok); }
.ps-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ps-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--bg); border: 1px solid var(--line); color: var(--body); }
html.dark .ps-chip { background: rgba(255,255,255,.04); }
.ps-chip.soon { background: var(--s-soft); border-color: transparent; color: var(--s-ink); } html.dark .ps-chip.soon { color: var(--s); }
.ps-chip.late { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.ps-chip.live { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.ps-bar { height: 6px; border-radius: 9px; background: var(--line2); overflow: hidden; } html.dark .ps-bar { background: rgba(255,255,255,.08); }
.ps-bar i { display: block; height: 100%; background: var(--k); border-radius: 9px; }
.ps-cls { font-size: 12px; color: var(--mute); margin-top: -4px; }
.ps-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.ps-go .sd-btn { background: var(--k); color: #fff !important; }
.ps-go .sd-btn.ghost { background: transparent; color: var(--ink) !important; border: 1px solid var(--line); }
.ps-done { font-weight: 800; color: var(--ok); font-size: 14px; }
@keyframes psUp { from { opacity: 0; transform: translateY(12px); } }

/* the progress ring of a group member (tasks.php) */
.ps-myring { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.ps-myring > div { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; text-align: center; background: var(--card); font-size: 11px; font-weight: 700; color: var(--mute); }
.ps-myring b { display: block; font-family: var(--num-font); font-weight: 400; font-size: 24px; line-height: 1; color: var(--ink); }

/* ── a message card (link not found, nothing yet …) ───────────────── */
.ps-msg { text-align: center; padding: 40px 22px; }
.ps-msg .big { font-size: 48px; line-height: 1; }
.ps-msg h1 { margin: 14px 0 6px; font-size: 24px; font-weight: 800; }
.ps-msg p { margin: 0 auto 18px; color: var(--mute); max-width: 460px; }

/* ── call to action under a card ──────────────────────────────────── */
.ps-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ps-cta .txt { flex: 1 1 240px; min-width: 0; }
.ps-cta .txt b { display: block; font-size: 16px; }
.ps-cta .txt span { font-size: 13.5px; color: var(--mute); }

/* ── support page: the card tiles ─────────────────────────────────── */
.ps-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; }
@media (max-width: 560px) { .ps-pay { grid-template-columns: 1fr; } }
.ps-pay > div { --k: var(--brand); --ks: var(--brand-soft); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 18px 16px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.ps-pay > div::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--k); }
.ps-pay .tag { align-self: flex-start; font-family: var(--lab-font); font-weight: 700; font-size: 10.5px; letter-spacing: .16em; padding: 6px 10px; border-radius: 9px; background: var(--ks); color: var(--k); }
.ps-pay h2 { margin: 0; font-size: 17px; font-weight: 800; }
.ps-pay p { margin: 0; font-size: 13.5px; color: var(--mute); }
.ps-num { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 800; font-size: 14px; letter-spacing: .02em; }
.ps-num { flex-wrap: wrap; font-size: 13.5px; letter-spacing: 0; }
.ps-num span { white-space: nowrap; user-select: all; }   /* a card number is never cut: when it does not fit, "Copy" moves to the next line */
.ps-num button { margin-left: auto; }
html.dark .ps-num { background: rgba(255,255,255,.04); }
.ps-num button { flex: none; border: 0; background: var(--ks); color: var(--k); border-radius: 9px; height: 30px; padding: 0 10px; font: 700 12px Inter, system-ui, sans-serif; cursor: pointer; }
.ps-who2 { font-size: 12.5px; color: var(--mute); }

/* ── footer ───────────────────────────────────────────────────────── */
.ps-foot { text-align: center; color: var(--mute); font-size: 13px; padding: 6px 16px 34px; }
.ps-foot a { color: var(--mute) !important; font-weight: 700; text-decoration: none; }
.ps-foot a:hover { color: var(--ink) !important; }

@media (prefers-reduced-motion: reduce) { .ps-task, .ps-ring .val { animation: none !important; transition: none !important; } }
@media print { .sd-top, .ps-foot, .sd-skip { display: none !important; } }
