/* ═══════════════════════════════════════════════════════════════════
   TarvyX theme — app shell, components and responsive layout.
   Loaded LAST on every page, so it wins over app.css / page styles.
   Breakpoints: ≤1199 compact sidebar · ≤1023 drawer navigation
                ≤767 tablet-portrait / large phone · ≤479 small phone
   ═══════════════════════════════════════════════════════════════════ */

/* ── Icons ─────────────────────────────────────────────────────────── */
.ic { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.ic-tile { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: var(--tile, 40px); height: var(--tile, 40px); border-radius: 10px;
  background: var(--purple-lt); color: var(--purple); }
.ic-tile.t-amber { background: var(--coral-lt); color: var(--coral2); }
.ic-tile.t-green { background: var(--green-lt); color: var(--green); }
.ic-tile.t-blue  { background: var(--blue-lt);  color: var(--blue); }
.ic-tile.t-red   { background: var(--red-lt);   color: var(--red); }
.ic-tile.t-gray  { background: var(--bg3);      color: var(--gray2); }
.ic-plain { display: inline-flex; align-items: center; justify-content: center; color: currentColor; flex-shrink: 0; }
.ei { display: inline-flex; vertical-align: -.18em; color: currentColor; } /* inline icon replacing an emoji */
.ei .ic { width: 1.05em; height: 1.05em; }

/* ── App shell ─────────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  width: var(--sb); background: var(--nav-bg); color: var(--nav-text);
  border-right: 1px solid var(--nav-border);
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; height: 100vh; height: 100dvh;
  z-index: 300; padding: 18px 14px 14px; overflow: hidden;
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
.sb-logo-row { display: flex; align-items: center; gap: 11px; padding: 2px 6px 18px; margin: 0 0 6px; border-bottom: 1px solid var(--nav-border); }
.sb-logo { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; background: #fff; border-radius: 11px; padding: 4px; box-shadow: 0 0 0 1px var(--nav-border), 0 4px 10px -4px rgba(124,58,237,.35); }
.sb-logo-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sb-logo-text b { font-family: var(--font-brand); font-size: 1.12rem; font-weight: 800; letter-spacing: .03em; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sb-logo-text span { font-size: .68rem; color: var(--nav-label); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-top: 1px; }
.sb-close { display: none; margin-left: auto; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--nav-text); align-items: center; justify-content: center; }
.sb-close:hover { background: var(--nav-hover); color: var(--nav-text-hi); }

.sb-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 2px; scrollbar-width: thin; scrollbar-color: var(--nav-border) transparent; }
.nav-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--nav-label); padding: 14px 12px 6px; }
.nav-label:first-child { padding-top: 6px; }
.nav-a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  font-size: .87rem; font-weight: 500; color: var(--nav-text); position: relative;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s, box-shadow .15s;
  background: transparent; box-shadow: none; transform: none;
}
.nav-a::before { display: none !important; }
.nav-a .ic { width: 19px; height: 19px; opacity: .85; }
.nav-a:hover { background: var(--nav-hover); color: var(--nav-text-hi); transform: none; }
.nav-a:hover .ic { color: var(--nav-accent); opacity: 1; }
.nav-a.on, .nav-a.on:hover { background: var(--nav-active); color: var(--nav-active-text); font-weight: 600; box-shadow: 0 6px 16px -6px rgba(124,58,237,.6); }
.nav-a.on .ic { color: #fff; opacity: 1; }
.nav-a .nav-tip { position: static; background: none; border: 0; box-shadow: none; padding: 0; opacity: 1; font-size: inherit; color: inherit; overflow: hidden; text-overflow: ellipsis; }
.nav-a .nav-badge { margin-left: auto; font-size: .68rem; font-weight: 700; background: var(--grad-warm); color: #fff; border-radius: 999px; padding: 1px 7px; }
.nav-child { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--nav-text); text-decoration: none; border: 1px solid transparent; }
.nav-child:hover { background: var(--nav-hover); color: var(--nav-text-hi); }
.nav-child.on { background: var(--purple-lt); border-color: color-mix(in srgb, var(--purple) 25%, transparent); color: var(--nav-text-hi); }
.nav-child .nc-name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-child .nc-sub { font-size: .72rem; color: var(--nav-label); }
.nav-empty { font-size: .8rem; color: var(--nav-label); padding: 6px 10px; }

.sb-bottom { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--nav-border); margin-top: 8px; }
.sb-profile { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--purple) 9%, var(--nav-bg)), color-mix(in srgb, var(--coral) 7%, var(--nav-bg))); border: 1px solid var(--nav-border); cursor: pointer; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.sb-profile:hover { border-color: color-mix(in srgb, var(--purple) 35%, transparent); box-shadow: var(--sh1); transform: none; }
.sb-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad-brand); display: flex; align-items: center; justify-content: center; color: #fff; border: 2px solid var(--nav-bg); box-shadow: 0 0 0 2px color-mix(in srgb, var(--purple) 35%, transparent); flex-shrink: 0; overflow: hidden; font-weight: 700; font-size: .82rem; font-family: var(--font-head); }
.sb-avatar .avatar-img { width: 100% !important; height: 100% !important; box-shadow: none; }
.sb-profile-info { overflow: hidden; white-space: nowrap; min-width: 0; flex: 1; }
.sb-profile-name { font-size: .85rem; font-weight: 700; color: var(--nav-text-hi); overflow: hidden; text-overflow: ellipsis; }
.sb-profile-role { font-size: .72rem; color: var(--nav-text); overflow: hidden; text-overflow: ellipsis; }
.sb-profile > .ic { color: var(--nav-label); }
.sb-level-pill { display: inline-block; margin-top: 5px; background: var(--purple-lt); color: var(--purple); border: 0; border-radius: 999px; padding: 1px 8px; font-size: .66rem; font-weight: 700; }
.sb-xp-bar { height: 5px; background: color-mix(in srgb, var(--purple) 14%, transparent); border-radius: 4px; overflow: hidden; margin-top: 7px; }
.sb-xp-fill { height: 100%; background: linear-gradient(90deg, #7C3AED, #A855F7 60%, #F59E0B); border-radius: 4px; }
.sb-xp-txt { font-size: .66rem; color: var(--nav-label); margin-top: 4px; }
.sb-bottom .nav-a:hover { color: var(--red); background: var(--red-lt); }
.sb-bottom .nav-a:hover .ic { color: var(--red); }

.sb-overlay { display: none; position: fixed; inset: 0; background: rgba(15,11,31,.5); z-index: 250; opacity: 0; transition: opacity .25s; backdrop-filter: blur(3px); }

.main { margin-left: var(--sb); flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

.topbar {
  background: var(--topbar-bg); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  padding: 0 28px; height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 200; gap: 12px; box-shadow: none;
}
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { font-family: var(--font-head); font-size: 1.08rem; font-weight: 700; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-title .avatar-img, .topbar-title .avatar-emoji { display: none; }
.tb-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mob-btn, #mob-btn { display: none !important; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; background: transparent; border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative;
  color: var(--gray2); transition: background-color .15s, color .15s, border-color .15s; font-size: 1rem; flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg3); color: var(--white); border-color: var(--border2); }
.icon-btn .ic { width: 18px; height: 18px; }
.notif-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); border: 2px solid var(--bg2); }

/* Theme toggle shows the right glyph without JS changing text */
.theme-ic-sun { display: none; }
html[data-theme="dark"] .theme-ic-sun { display: inline-block; }
html[data-theme="dark"] .theme-ic-moon { display: none; }

.streak-chip { display: flex; align-items: center; gap: 8px; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; white-space: nowrap; height: 38px; }
.streak-chip .ic { color: var(--coral2); }
.streak-chip .sc-lvl { font-size: .78rem; font-weight: 700; color: var(--white); }
.streak-chip .sc-bar { width: 64px; height: 5px; background: var(--bg4); border-radius: 4px; overflow: hidden; }
.streak-chip .sc-fill { height: 100%; background: linear-gradient(90deg, #7C3AED, #A855F7 60%, #F59E0B); border-radius: 4px; }
.streak-chip .sc-xp { font-size: .72rem; color: var(--gray2); font-weight: 600; }
.tb-avatar-wrap { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; background: transparent; border: 1px solid var(--border); cursor: pointer; transition: border-color .15s; text-decoration: none; color: inherit; height: 38px; }
.tb-avatar-wrap:hover { border-color: var(--border2); background: var(--bg3); }
.tb-avatar-wrap .tb-av { width: 30px; height: 30px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: .76rem; font-weight: 700; font-family: var(--font-head); }
.tb-avatar-wrap .tb-av .avatar-img { width: 30px !important; height: 30px !important; box-shadow: none; }
.tb-avatar-wrap .tb-nm { font-size: .82rem; font-weight: 600; color: var(--white); }
.tb-avatar-wrap .tb-chev { color: var(--gray3); display: inline-flex; }

.page { padding: 24px 28px 40px; flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; min-width: 0; }
.page > * { animation: none !important; }

/* Notification dropdown */
.notif-panel { position: absolute; top: calc(var(--topbar-h) - 6px); right: 20px; width: min(360px, calc(100vw - 24px)); background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--sh3); z-index: 400; display: none; overflow: hidden; }
.notif-panel.open { display: block; }
.notif-panel-head { padding: 12px 16px; font-weight: 700; font-size: .88rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; color: var(--white); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: .82rem; color: var(--gray1); border-left: 3px solid var(--clr, transparent); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--bg3); }

/* ── Cards, grids, stats ───────────────────────────────────────────── */
.card, .hs-card { background: var(--card); border-radius: var(--r2); padding: 20px; border: 1px solid var(--border); box-shadow: var(--sh1); }
.card:hover, .stat-card:hover, .hs-card:hover { transform: none !important; box-shadow: var(--sh1); }
.card-head { font-family: var(--font-head); font-size: .98rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--white); flex-wrap: wrap; }
.card-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hs-title { font-family: var(--font-head); font-weight: 700; }
.stat-row { gap: 16px; }
.stat-card { border-radius: var(--r2); padding: 18px; border: 1px solid var(--border) !important; background: var(--card); box-shadow: var(--sh1); position: relative; overflow: hidden; }
.stat-card::after { display: none !important; }
.stat-card.sc1 { box-shadow: inset 0 3px 0 var(--purple), var(--sh1); }
.stat-card.sc2 { box-shadow: inset 0 3px 0 var(--coral), var(--sh1); }
.stat-card.sc3 { box-shadow: inset 0 3px 0 var(--green), var(--sh1); }
.stat-card.sc4 { box-shadow: inset 0 3px 0 var(--blue), var(--sh1); }
.stat-val { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; color: var(--white); line-height: 1.1; letter-spacing: -.02em; }
.stat-lbl { font-size: .78rem; color: var(--gray2); margin-top: 4px; font-weight: 500; }
.stat-delta { font-size: .74rem; font-weight: 600; }
.page:not([data-page="aitutor"]) .stat-ico, .stat-ico { width: 42px; height: 42px; margin-bottom: 12px; }

h1, h2, h3 { color: var(--white); }
.page h1 { font-size: 1.5rem; }
.page h2 { font-size: 1.2rem; }
.page h3 { font-size: 1rem; }

/* Course / list items */
.course-item, .mini-person, .lb-item, .res-item, .notice-item, .hs-notif-item { border-radius: 10px; }
.course-item:hover, .mini-person:hover { transform: none !important; background: var(--bg3); }
.course-prog-fill, .prog-fill { background: linear-gradient(90deg, #7C3AED, #A855F7) !important; }
.lb-item.me { background: var(--purple-lt); border-color: transparent; }

/* Hero banner (student dashboard) */
.hero-banner { background: var(--hero-bg) !important; border: 0 !important; box-shadow: var(--sh2) !important; border-radius: var(--r3); }
.hero-banner::before, .hero-banner::after { display: none !important; }
.hero-title { font-family: var(--font-head) !important; letter-spacing: -.02em; }
.wof-banner { background: var(--wof-banner-bg) !important; border: 1px solid var(--border) !important; box-shadow: var(--sh1) !important; }

/* ── Forms ─────────────────────────────────────────────────────────── */
.field label, label.lbl { display: block; margin-bottom: 6px; font-size: .8rem; font-weight: 600; color: var(--gray1); text-transform: none; letter-spacing: 0; }
.page input[type="text"], .page input[type="email"], .page input[type="password"], .page input[type="number"],
.page input[type="date"], .page input[type="time"], .page input[type="search"], .page input[type="url"],
.page input[type="tel"], .page input[type="datetime-local"], .page select, .page textarea {
  font-family: var(--font-body); color: var(--white); max-width: 100%;
}
.page input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):focus,
.page select:focus, .page textarea:focus { outline: none; border-color: var(--brand-500) !important; box-shadow: var(--focus) !important; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-600); }
input[type="file"] { max-width: 100%; font-size: .84rem; color: var(--gray2); }
input[type="file"]::file-selector-button { border: 1px solid var(--border2); background: var(--card); color: var(--gray1); border-radius: 8px; padding: 7px 12px; margin-right: 10px; font-weight: 600; cursor: pointer; font-family: inherit; }

/* Alerts used across the app */
.err-box, .error-box, .alert-error, .flash-error { background: var(--red-lt) !important; color: var(--red) !important; border: 1px solid color-mix(in srgb, var(--red) 25%, transparent) !important; border-radius: 10px !important; }
.ok-box, .success-box, .alert-success, .flash-success { background: var(--green-lt) !important; color: var(--green) !important; border: 1px solid color-mix(in srgb, var(--green) 25%, transparent) !important; border-radius: 10px !important; }

/* ── Tables ────────────────────────────────────────────────────────── */
.page table { border-collapse: collapse; width: 100%; font-size: .86rem; }
.page th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--gray2); background: var(--bg3); }
.page th, .page td { border-color: var(--border) !important; }
.page tbody tr:hover td { background: color-mix(in srgb, var(--bg3) 55%, transparent); }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
.table-wrap > table { min-width: 640px; }

/* ── Floating AI button / popup ────────────────────────────────────── */
.ai-fab { width: 54px; height: 54px; border-radius: 18px; background: var(--grad-brand); color: #fff; box-shadow: 0 12px 28px -8px rgba(124,58,237,.65); border: 0; display: flex; align-items: center; justify-content: center; }
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -8px rgba(124,58,237,.75); }
.ai-fab .ic { width: 24px; height: 24px; }
.ai-fab-badge { background: var(--grad-warm); color: #fff; font-size: .6rem; font-weight: 800; }
.ai-popup { border: 1px solid var(--border); box-shadow: var(--sh3); border-radius: 16px; background: var(--card); max-width: calc(100vw - 24px); }
.popup-head { background: var(--card2); border-bottom: 1px solid var(--border); }
.popup-av { background: var(--purple-lt) !important; color: var(--purple); display: flex; align-items: center; justify-content: center; }
.popup-send { background: var(--grad-brand) !important; color: #fff; display: flex; align-items: center; justify-content: center; }
.cmsg-user { background: var(--grad-brand) !important; color: #fff !important; }
.cmsg-ai { background: var(--bg3) !important; color: var(--white) !important; }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 4px; }

/* ── Auth pages (all four portals, OTP, forgot password) ───────────── */
.auth-body { min-height: 100vh; min-height: 100dvh; margin: 0; background: var(--bg); font-family: var(--font-body); color: var(--white); }
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.auth-aside { position: relative; overflow: hidden; background: var(--grad-ink); color: #EDE9FE; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; isolation: isolate; }
.auth-aside::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(520px 420px at 78% 38%, rgba(139,92,246,.42), transparent 62%),
  radial-gradient(420px 320px at 92% 92%, rgba(249,115,22,.22), transparent 60%),
  radial-gradient(380px 300px at 0% 0%, rgba(168,85,247,.20), transparent 60%); }
.auth-aside::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(ellipse at 60% 45%, #000 20%, transparent 75%); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 42px; height: 42px; background: #fff; border-radius: 12px; padding: 5px; object-fit: contain; box-shadow: 0 6px 18px -6px rgba(124,58,237,.6); }
.auth-brand b { font-family: var(--font-brand); font-size: 1.12rem; font-weight: 800; letter-spacing: .06em; display: block; color: #fff; text-transform: uppercase; }
.auth-brand span { font-size: .74rem; color: #B9B3D6; letter-spacing: .03em; }
.auth-stage { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 36px; }
.auth-pitch h2 { font-family: var(--font-head); font-size: clamp(1.7rem, 2.5vw, 2.4rem); line-height: 1.15; color: #fff; font-weight: 800; letter-spacing: -.025em; max-width: 15ch; }
.auth-pitch h2 em { font-style: normal; background: linear-gradient(90deg, #C4B5FD, #F0ABFC 50%, #FDBA74); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-pitch p { margin-top: 14px; color: #C9C3E3; font-size: .97rem; max-width: 40ch; line-height: 1.6; }
.auth-points { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.auth-points li { display: flex; flex-direction: column; gap: 8px; color: #C9C3E3; font-size: .8rem; line-height: 1.45; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(6px); }
.auth-points .ic-tile { --tile: 32px; background: rgba(167,139,250,.18); color: #DDD6FE; border-radius: 9px; }
.auth-points li:nth-child(2) .ic-tile { background: rgba(251,191,36,.16); color: #FCD34D; }
.auth-points li:nth-child(3) .ic-tile { background: rgba(74,222,128,.14); color: #86EFAC; }
.auth-points b { color: #fff; display: block; font-weight: 700; font-size: .86rem; margin-bottom: 2px; }
.auth-foot { font-size: .74rem; color: #8F88B0; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg2); position: relative; }
.auth-main::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #7C3AED, #A855F7, #F59E0B); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .auth-mobile-brand { display: none; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: .74rem; font-weight: 700; color: var(--purple); background: var(--purple-lt); padding: 5px 11px; border-radius: 999px; margin-bottom: 16px; letter-spacing: .01em; }
.auth-card h1 { font-family: var(--font-head); font-size: 1.85rem; font-weight: 800; letter-spacing: -.025em; color: var(--white); }
.auth-sub { color: var(--gray2); margin: 8px 0 26px; font-size: .93rem; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--gray1); margin-bottom: 6px; }
.auth-input { position: relative; }
.auth-input > .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gray3); pointer-events: none; transition: color .15s; }
.auth-input:focus-within > .ic { color: var(--purple); }
.auth-input input { width: 100%; height: 48px; padding: 0 44px 0 42px; border: 1px solid var(--border2); border-radius: 12px; background: var(--card2); color: var(--white); font-size: .95rem; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.auth-input input:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--focus); background: var(--card); }
.auth-input .pw-toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--gray3); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.auth-input .pw-toggle:hover { color: var(--purple); background: var(--purple-lt); }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 20px; font-size: .84rem; }
.auth-link { color: var(--purple); font-weight: 600; }
.auth-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-btn { width: 100%; height: 48px; border: 0; border-radius: 12px; background: var(--grad-brand); color: #fff; font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--sh-purple); transition: box-shadow .2s, filter .2s; position: relative; overflow: hidden; }
.auth-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%); transform: translateX(-100%); transition: transform .6s; }
.auth-btn:hover { box-shadow: 0 10px 24px -6px rgba(124,58,237,.6); filter: saturate(1.1); }
.auth-btn:hover::after { transform: translateX(100%); }
.auth-btn.secondary { background: transparent; color: var(--gray1); border: 1px solid var(--border2); box-shadow: none; }
.auth-alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; font-size: .86rem; margin-bottom: 18px; line-height: 1.45; }
.auth-alert .ic { margin-top: 1px; }
.auth-alert.err { background: var(--red-lt); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 22%, transparent); }
.auth-alert.ok { background: var(--green-lt); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 22%, transparent); }
.auth-alert.info { background: var(--purple-lt); color: var(--purple); border: 1px solid color-mix(in srgb, var(--purple) 22%, transparent); }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--gray3); font-size: .72rem; font-weight: 600; margin: 26px 0 14px; text-transform: uppercase; letter-spacing: .1em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-portals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.auth-portals a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 12px; font-size: .78rem; font-weight: 600; color: var(--gray1); transition: border-color .15s, background-color .15s, transform .15s; text-align: center; background: var(--card); }
.auth-portals a:hover { border-color: var(--brand-400); background: var(--purple-gl); color: var(--purple); transform: translateY(-1px); }
.auth-portals .ic { color: var(--purple); }
.auth-portals a:nth-child(2) .ic { color: var(--coral2); }
.auth-portals a:nth-child(3) .ic { color: var(--blue); }
.auth-note { margin-top: 22px; font-size: .78rem; color: var(--gray3); text-align: center; }
.otp-input { letter-spacing: .5em; text-align: center; font-family: var(--font-head) !important; font-size: 1.35rem !important; font-weight: 800; padding-left: 16px !important; padding-right: 16px !important; }
.auth-theme { position: fixed; top: 16px; right: 16px; z-index: 5; background: var(--card); }

/* Simple centered state page (429 etc.) */
.state-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.state-card { max-width: 420px; text-align: center; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 36px 28px; box-shadow: var(--sh2); }
.state-card h1 { font-size: 1.4rem; margin: 14px 0 8px; }
.state-card p { color: var(--gray2); margin-bottom: 22px; }
.state-icon { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; }
.state-icon--warn { background: var(--coral-lt); color: var(--coral2); }

/* ── Teacher portal (standalone pages) ─────────────────────────────── */
body.tp {
  --bg: #F6F7FB; --bg2: #FFFFFF; --card: #FFFFFF; --border: #E8E7F2;
  --p1: #7C3AED; --p2: #A855F7; --p3: #F59E0B; --text: #111827; --muted: #5E6679;
  --green: #16A34A; --orange: #D97706; --red: #E11D48; --shadow: 0 1px 2px rgba(17,24,39,.04), 0 2px 8px rgba(76,29,149,.04);
  background: var(--bg) !important; color: var(--text); font-family: var(--font-body) !important; display: block;
}
html[data-theme="dark"] body.tp, body.tp[data-theme="dark"] {
  --bg: #09090F; --bg2: #121420; --card: #13151F; --border: rgba(139,92,246,.16);
  --p1: #A78BFA; --p2: #C084FC; --p3: #FBBF24; --text: #F4F3FA; --muted: #9CA1B8;
  --green: #4ADE80; --orange: #FBBF24; --red: #FB7185; --shadow: 0 1px 2px rgba(0,0,0,.35);
}
body.tp .sidebar { background: var(--nav-bg) !important; border-right: 1px solid var(--nav-border) !important; box-shadow: none !important; backdrop-filter: none; width: var(--sb); padding: 18px 14px 14px; display: flex !important; }
body.tp .nav-label { color: var(--nav-label) !important; }
body.tp .nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px !important; border-radius: 10px !important; color: var(--nav-text) !important; font-size: .87rem !important; font-weight: 500; background: transparent !important; border: 0 !important; box-shadow: none !important; position: relative; margin-bottom: 2px; cursor: pointer; transform: none !important; text-decoration: none; }
body.tp .nav-item .ic { width: 19px; height: 19px; opacity: .85; }
body.tp .nav-item:hover { background: var(--nav-hover) !important; color: var(--nav-text-hi) !important; }
body.tp .nav-item:hover .ic { color: var(--nav-accent); opacity: 1; }
body.tp .nav-item.active { background: var(--nav-active) !important; color: #fff !important; font-weight: 600; box-shadow: 0 6px 16px -6px rgba(124,58,237,.6) !important; }
body.tp .nav-item.active .ic { color: #fff; opacity: 1; }
body.tp .sb-profile.on { border-color: color-mix(in srgb, var(--purple) 40%, transparent); }
body.tp .main { margin-left: var(--sb) !important; padding: 0 28px 40px !important; max-width: none !important; min-width: 0; width: auto; }
body.tp .topbar { position: sticky; top: 0; z-index: 200; margin: 0 -28px 24px !important; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 0 !important; background: var(--topbar-bg) !important; border: 0 !important; border-bottom: 1px solid var(--border) !important; box-shadow: none !important; padding: 0 28px !important; min-height: var(--topbar-h); backdrop-filter: saturate(160%) blur(12px); }
body.tp .topbar > .mob-btn + * { margin-right: auto; min-width: 0; }
body.tp .topbar-right { display: flex; align-items: center; gap: 8px; }
body.tp .page-title { font-family: var(--font-head) !important; font-size: 1.1rem !important; font-weight: 700 !important; background: none !important; -webkit-text-fill-color: var(--text) !important; color: var(--text) !important; }
body.tp .page-title .ic-tile, body.tp .page-title .teacher-icon { display: none !important; }
body.tp .stat-value, body.tp .mini-stat-info .val, body.tp .week-pill b, body.tp .podium-bar, body.tp .podium-avatar, body.tp .rank-num, body.tp .session-time, body.tp .modal-title {
  font-family: var(--font-head) !important; background: none !important; -webkit-text-fill-color: currentColor !important; }
body.tp .stat-value { color: var(--text) !important; font-weight: 800 !important; letter-spacing: -.02em; }
body.tp .session-time { color: var(--p1) !important; }
body.tp .card, body.tp .stat-card, body.tp .session-item, body.tp .res-card, body.tp .modal, body.tp .modal-box, body.tp .modal-content {
  background: var(--card) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow) !important; backdrop-filter: none !important; color: var(--text); border-radius: var(--r2) !important; }
body.tp .stat-card:hover, body.tp .card:hover { transform: none !important; }
body.tp .search-box { background: var(--card) !important; border: 1px solid var(--border) !important; color: var(--text) !important; border-radius: 10px !important; height: 38px; }
body.tp .notif-btn, body.tp .theme-toggle { width: 38px; height: 38px; border-radius: 10px !important; background: transparent !important; border: 1px solid var(--border) !important; color: var(--muted) !important; display: inline-flex; align-items: center; justify-content: center; box-shadow: none !important; position: relative; }
body.tp .notif-btn:hover, body.tp .theme-toggle:hover { background: var(--bg3) !important; color: var(--purple) !important; }
body.tp .logout-btn { background: transparent !important; border: 1px solid var(--border) !important; color: var(--muted) !important; border-radius: 10px !important; height: 38px; display: inline-flex !important; align-items: center; gap: 6px; padding: 0 12px !important; box-shadow: none !important; }
body.tp .logout-btn:hover { color: var(--red) !important; border-color: color-mix(in srgb, var(--red) 40%, transparent) !important; }
body.tp .join-btn, body.tp .btn-primary, body.tp .primary-btn, body.tp button[type="submit"]:not(.btn-ghost):not(.icon-btn):not(.link-btn):not(.auth-link) { background: var(--grad-brand) !important; border-color: transparent !important; box-shadow: var(--sh-purple) !important; color: #fff !important; }
body.tp .card-title, body.tp .section-title { font-family: var(--font-head); color: var(--text) !important; }
body.tp table th { color: var(--muted) !important; }
body.tp .notif-panel { top: calc(100% + 6px); right: 0; }
body.tp .mob-btn { display: none !important; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1199px) {
  :root { --sb: 232px; }
  .page { padding: 20px 22px 36px; }
  .topbar, body.tp .topbar { padding: 0 22px !important; }
  body.tp .main { padding: 0 22px 36px !important; }
  body.tp .topbar { margin: 0 -22px 20px !important; }
  .stat-row, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .hero-row { grid-template-columns: 1fr !important; }
}

/* Drawer navigation on tablets & phones */
@media (max-width: 1023px) {
  .sidebar, body.tp .sidebar { transform: translateX(-102%); width: min(290px, 86vw) !important; padding: 18px 12px 14px !important; box-shadow: none; }
  .sidebar.open, body.tp .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.35); }
  body.nav-open .sb-overlay { display: block; opacity: 1; }
  body.nav-open { overflow: hidden; }
  .sb-close { display: inline-flex; }
  .main, body.tp .main { margin-left: 0 !important; }
  .mob-btn, #mob-btn { display: inline-flex !important; }
  body.tp .mob-btn { display: inline-flex !important; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dash-2col, .dash-left, .ptm-grid { grid-template-columns: 1fr !important; }
  .exam-shell { grid-template-columns: 1fr !important; }
}

@media (max-width: 767px) {
  :root { --topbar-h: 58px; }
  body { font-size: 14px; }
  .page { padding: 16px 14px 32px; }
  .topbar, body.tp .topbar { padding: 0 12px !important; gap: 8px; }
  body.tp .main { padding: 0 14px 32px !important; }
  body.tp .topbar { margin: 0 -14px 16px !important; }
  .topbar-title, body.tp .page-title { font-size: .98rem !important; }
  .tb-right { gap: 6px; }
  .streak-chip, .tb-avatar-wrap .tb-nm, .tb-avatar-wrap .tb-chev, .search-dark { display: none !important; }
  .tb-avatar-wrap { padding: 3px; }
  .g2, .g3, .g4, .kanban, .game-grid, .upcoming-row, .hero-row, .dash-left-sub { grid-template-columns: 1fr !important; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-val { font-size: 1.35rem; }
  .card, .hs-card { padding: 16px; }
  .hero-banner { padding: 22px !important; min-height: 0 !important; }
  .hero-fox-wrap, .hoodie-fox-wrap, .hero-bg-shape { display: none !important; }
  .hero-title { font-size: 1.5rem !important; }
  /* Inline-styled multi-column grids collapse to one column unless marked .keep-grid */
  .page [style*="grid-template-columns"]:not(.keep-grid):not(.tt-grid),
  body.tp .main [style*="grid-template-columns"]:not(.keep-grid) { grid-template-columns: 1fr !important; }
  .page [style*="width:"][style*="px"]:not(img):not(svg):not(.keep-w):not(.ic-tile):not([class*="avatar"]):not([class*="dot"]):not([class*="bar"]):not([class*="fill"]) { max-width: 100%; }
  .page form [style*="display:flex"], .page .card-head, .page [class*="toolbar"], .page [class*="filters"], .page [class*="actions"] { flex-wrap: wrap; }
  .modal, .modal-box, .modal-content, [class*="modal"] > div { max-width: calc(100vw - 24px) !important; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { padding: 28px 18px; align-items: flex-start; }
  .auth-card .auth-mobile-brand { display: flex; margin-bottom: 26px; }
  .auth-card .auth-mobile-brand b { color: var(--white); }
  .auth-card .auth-mobile-brand span { color: var(--gray3); }
  .ai-popup { right: 12px !important; left: 12px !important; width: auto !important; bottom: 84px !important; }
  .ai-fab { right: 16px !important; bottom: 16px !important; }
  .notif-panel { right: 8px; }
  body.tp .search-box { display: none !important; }
  body.tp .logout-btn span { display: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card .auth-mobile-brand { display: flex; margin-bottom: 26px; }
  .auth-card .auth-mobile-brand b { color: var(--white); }
}

@media (max-width: 479px) {
  .stat-row { grid-template-columns: 1fr 1fr !important; }
  .page h1 { font-size: 1.3rem; }
  .btn { padding: 9px 14px; }
  .auth-portals { grid-template-columns: 1fr 1fr 1fr; }
}

@media print {
  .sidebar, .topbar, .ai-fab, .ai-popup, .sb-overlay { display: none !important; }
  .main { margin: 0 !important; }
  .page { padding: 0; max-width: none; }
}

/* ── Fixes after first review ──────────────────────────────────────── */
.ic-tile { display: inline-flex !important; object-fit: initial; }
.stat-card .ic-tile, .stat-ico.ic-tile { margin-bottom: 12px; }
.dash-heading-icon.ic-tile { margin-right: 2px; vertical-align: middle; }
.topbar-title .avatar-img, .topbar-title .avatar-emoji { display: none !important; }
.mood-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mood-btn { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--gray2); display: inline-flex; align-items: center; justify-content: center; transition: border-color .15s, background-color .15s, color .15s; font-size: 0; }
.mood-btn:hover { border-color: var(--brand-400); color: var(--purple); background: var(--purple-gl); transform: none; }
.mood-btn.sel { border-color: var(--purple); background: var(--purple-lt); color: var(--purple); }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-cta .btn, .hero-cta a, .hero-cta button { border-radius: 10px; }
.hs-notif-ico { background: var(--bg3) !important; color: var(--gray2); }
.achv-ico, .b-ico { color: var(--coral2); }
.achv-hex.locked .achv-ico, .badge-pill.locked .b-ico { color: var(--gray3); filter: none; }
.g-ico .ic-tile { --tile: 44px; }
.res-ico, .f-ico { color: var(--purple); }
.content-inline-icon, .content-button-icon, .content-course-icon { color: inherit; margin-right: 4px; vertical-align: -2px; }
.ei + .ei { margin-left: 2px; }
@media (max-width: 767px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta > * { justify-content: center; text-align: center; }
  .wof-banner { flex-wrap: wrap; }
}

/* Teacher portal details */
body.tp #toast { background: var(--text) !important; color: var(--bg2) !important; border-radius: 10px !important; box-shadow: var(--sh3) !important; opacity: 0; transform: translateX(-50%) translateY(16px) !important; transition: opacity .2s, transform .2s !important; }
body.tp #toast.show { opacity: 1; transform: translateX(-50%) translateY(0) !important; }
body.tp .stat-icon { margin-bottom: 12px; }
body.tp .card-title span { font-size: inherit; }
body.tp .stat-label { color: var(--muted) !important; text-transform: none !important; letter-spacing: 0 !important; font-size: .8rem !important; }
body.tp .stat-card::before, body.tp .stat-card::after { opacity: .9; }
body.tp svg text { font-family: var(--font-head); }
body.tp input, body.tp select, body.tp textarea { font-family: var(--font-body); }
body.tp .inp, body.tp .search-box, body.tp select { background: var(--card) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
body.tp .field label, body.tp label { color: var(--muted); }

/* Grid/flex children may shrink below their content width (prevents sideways scrolling) */
.page :is(.g2, .g3, .g4, .gauto, .stat-row, .dash-2col, .dash-left, .hero-row, .admin-grid, .tutor-shell, [style*="display:grid"], [style*="display: grid"]) > * { min-width: 0; }
.tutor-main, .tutor-shell > * { min-width: 0; }
.admin-card { min-width: 0; max-width: 100%; }
@media (max-width: 1023px) {
  .page .g2[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .admin-grid { grid-template-columns: 1fr !important; }
}
.page, body.tp .main { overflow-wrap: break-word; }
.page [style*="flex:1"], .page [style*="flex: 1"], body.tp .main [style*="flex:1"] { min-width: 0; }
.fab-new { position: fixed; bottom: 24px; right: 24px; width: 52px; height: 52px; border-radius: 16px; background: var(--grad-brand); color: #fff; border: 0; box-shadow: var(--sh-purple); display: none; align-items: center; justify-content: center; z-index: 50; cursor: pointer; }
@media (max-width: 1023px) { .fab-new { display: inline-flex; } }

/* ═══ Brand finish (v2.1) ══════════════════════════════════════════ */
/* Ambient brand glow behind the workspace */
.shell, body.tp { background:
  radial-gradient(900px 340px at 100% -60px, rgba(168,85,247,.07), transparent 70%),
  radial-gradient(700px 300px at 20% -80px, rgba(245,158,11,.05), transparent 70%), var(--bg) !important; background-attachment: fixed !important; }

/* 3D brand illustration tiles */
.ic-tile.brand-tile { background: linear-gradient(145deg, #F5F3FF 0%, #FBF7FF 55%, #FFF7ED 100%); border: 1px solid color-mix(in srgb, var(--purple) 12%, transparent); border-radius: calc(var(--tile, 44px) * .3); }
.ic-tile.brand-tile img { width: 74%; height: 74%; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(76,29,149,.18)); }
html[data-theme="dark"] .ic-tile.brand-tile { background: linear-gradient(145deg, rgba(139,92,246,.18), rgba(249,115,22,.08)); border-color: rgba(139,92,246,.22); }
.ic-tile.brand-tile.t-amber, .ic-tile.brand-tile.t-green, .ic-tile.brand-tile.t-blue, .ic-tile.brand-tile.t-red { background: linear-gradient(145deg, #F5F3FF 0%, #FFF7ED 100%); }

/* Line-icon tiles in brand tints */
.ic-tile { border-radius: 10px; }

/* Stat cards: clean surface, signature corner orb, gradient top hairline */
.stat-card, body.tp .stat-card { position: relative; overflow: hidden; isolation: isolate; }
.stat-card::before, body.tp .stat-card::before { content: "" !important; display: block !important; position: absolute; top: -38px; right: -38px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--orb, var(--purple)) 16%, transparent), transparent 70%); z-index: -1; opacity: 1 !important; }
.stat-card.sc1 { --orb: var(--purple); box-shadow: inset 0 3px 0 0 #8B5CF6, var(--sh1); }
.stat-card.sc2 { --orb: var(--coral); box-shadow: inset 0 3px 0 0 #F59E0B, var(--sh1); }
.stat-card.sc3 { --orb: var(--green); box-shadow: inset 0 3px 0 0 #22C55E, var(--sh1); }
.stat-card.sc4 { --orb: var(--blue); box-shadow: inset 0 3px 0 0 #3B82F6, var(--sh1); }
.stat-val { font-weight: 800; }

/* Cards lift gently on hover where they are links */
a.card:hover, a.stat-card:hover, .card.clickable:hover { box-shadow: var(--sh2) !important; border-color: color-mix(in srgb, var(--purple) 25%, var(--border)) !important; }

/* Section heading icon tiles */
.card-head .ic-tile, .dash-heading-icon.ic-tile { background: var(--purple-lt); color: var(--purple); }

/* Hero (student dashboard) — deep navy-violet with brand glow and grid */
.hero-banner { background: var(--grad-ink) !important; position: relative; overflow: hidden; isolation: isolate; color: #fff; }
.hero-banner::before { content: "" !important; display: block !important; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(420px 300px at 78% 50%, rgba(139,92,246,.45), transparent 65%),
  radial-gradient(300px 220px at 98% 100%, rgba(249,115,22,.25), transparent 65%); }
.hero-banner::after { content: "" !important; display: block !important; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(ellipse at 70% 50%, #000 10%, transparent 70%); }
.hero-title { background: linear-gradient(90deg, #fff 0%, #fff 55%, #E9D5FF 100%); -webkit-background-clip: text; background-clip: text; color: transparent !important; }

/* Wall of fame banner */
.wof-banner { border-color: color-mix(in srgb, var(--purple) 16%, var(--border)) !important; }

/* Top bar hairline in brand gradient */
.topbar::after, body.tp .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(124,58,237,.35), rgba(245,158,11,.30), transparent); pointer-events: none; }
.topbar { position: sticky; }

/* Tables: brand-tinted header row */
.page th { background: color-mix(in srgb, var(--purple) 5%, var(--card)); color: var(--gray2); }

/* Tags/badges: pill polish */
.tag, .badge, .pill { font-weight: 700; letter-spacing: .01em; }

/* Teacher nav & profile in brand */
body.tp .stat-icon .brand-tile, body.tp .stat-card .brand-tile { margin-bottom: 4px; }

/* Selection colour */
::selection { background: rgba(139,92,246,.22); }

@media (max-width: 1023px) {
  .auth-mascot { display: none; }
}
@media (max-width: 1280px) and (min-width: 1024px) {
  .auth-points { grid-template-columns: 1fr; }
  .auth-points li { flex-direction: row; align-items: center; padding: 10px 12px; }
}
/* Progress ring centre label */
.donut-wrap { position: relative; flex-shrink: 0; }
.donut-wrap canvas { position: relative; z-index: 1; }
.donut-mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; z-index: 2; line-height: 1.05; }
.donut-num { font-family: var(--font-head); font-weight: 800; color: var(--white); }
.donut-sub { font-size: .62rem; color: var(--gray3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.course-icon.brand-tile { width: 40px; height: 40px; }
.course-icon.brand-tile .course-ic { width: 72% !important; height: 72% !important; filter: drop-shadow(0 2px 4px rgba(76,29,149,.2)); }
@media (max-width: 767px) {
  body.tp .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  body.tp .tp-sub { display: none; }
}

/* ═══ Sign-in mascot — a different, continuous animation per portal ═══
   student: hop + orbiting skills + XP pops   · teacher: explaining sway + idea cards + typing bubble
   parent:  calm breathing + rising hearts    · admin:   steady hover + radar sweep + orbiting shield/lock  */
.auth-mascot { position: relative; width: clamp(190px, 18vw, 260px); aspect-ratio: 1 / 1.08; isolation: isolate; }
.auth-mascot::before { content: ""; position: absolute; inset: 14% 8% 10%; border-radius: 50%; z-index: -2;
  background: radial-gradient(circle, rgba(168,85,247,.55), rgba(249,115,22,.18) 55%, transparent 72%); filter: blur(20px);
  animation: mGlow 4s ease-in-out infinite; }
.m-body { position: absolute; inset: 0 0 6% 0; display: flex; align-items: flex-end; justify-content: center; transform-origin: 50% 100%; will-change: transform; }
.m-fig { position: relative; width: 100%; aspect-ratio: 1 / 1; filter: drop-shadow(0 18px 26px rgba(0,0,0,.45)); }
.m-fig > img, .m-fig > .m-outfit { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.m-outfit { overflow: visible; }
.m-outfit * { transform-box: view-box; }
.m-shadow { position: absolute; left: 24%; right: 24%; bottom: 3%; height: 8%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.45), transparent); z-index: -1; transform-origin: center; }
.m-fx { position: absolute; inset: -10% -16% -6% 0; pointer-events: none; }
.m-chip { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 7px; border-radius: 12px; color: #fff;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px); box-shadow: 0 8px 20px -8px rgba(0,0,0,.5); }
.m-chip b { font-size: .7rem; font-weight: 700; letter-spacing: .01em; padding-right: 3px; }
.m-chip.c1 { color: #DDD6FE; } .m-chip.c2 { color: #FCD34D; } .m-chip.c3 { color: #86EFAC; }

/* orbit helper: a rotating ring that carries a chip; the chip counter-rotates to stay upright */
.m-orbit { position: absolute; inset: 8% 14% 8% 0; border-radius: 50%; animation: mSpin 12s linear infinite; }
.m-orbit > .m-chip { top: -4%; left: 50%; transform: translateX(-50%); animation: mSpinBack 12s linear infinite; }
.m-orbit.o-rev { animation-direction: reverse; } .m-orbit.o-rev > .m-chip { animation-direction: reverse; }
.m-orbit.d2 { animation-delay: -4s; } .m-orbit.d2 > .m-chip { animation-delay: -4s; }
.m-orbit.d3 { inset: 18%; animation-duration: 9s; animation-delay: -6s; } .m-orbit.d3 > .m-chip { animation-duration: 9s; animation-delay: -6s; }
.m-orbit.o-slow, .m-orbit.o-slow > .m-chip { animation-duration: 16s; }

/* ── Student: curious learner ── */
.m-student .m-body { animation: mHop 2.8s cubic-bezier(.3,.1,.3,1) infinite; }
.m-student .m-shadow { animation: mShadowHop 2.8s cubic-bezier(.3,.1,.3,1) infinite; }
.m-pop { position: absolute; left: 62%; top: 30%; font: 800 .74rem var(--font-head); color: #1F1300; background: linear-gradient(135deg,#FCD34D,#F97316);
  padding: 3px 9px; border-radius: 999px; box-shadow: 0 6px 14px -6px rgba(249,115,22,.8); opacity: 0; animation: mPop 5.6s ease-out infinite; }
.m-pop.p2 { left: 64%; top: 52%; background: linear-gradient(135deg,#C4B5FD,#A855F7); color: #fff; animation-delay: 2.8s; }

/* ── Teacher: mentor explaining ── */
.m-teacher .m-body { animation: mExplain 4.2s ease-in-out infinite; }
.m-teacher .m-shadow { animation: mShadowSway 4.2s ease-in-out infinite; }
.m-teacher .m-chip { opacity: 0; animation: mCard 7.5s ease-in-out infinite; }
.m-teacher .m-chip.c1 { right: 0; top: 30%; }
.m-teacher .m-chip.c2 { right: 2%; top: 50%; animation-delay: 2.5s; }
.m-teacher .m-chip.c3 { right: -2%; top: 68%; animation-delay: 5s; }
.m-bubble { position: absolute; right: 8%; top: 9%; display: flex; gap: 5px; padding: 10px 13px; border-radius: 16px 16px 16px 4px;
  background: rgba(255,255,255,.95); box-shadow: 0 10px 24px -10px rgba(0,0,0,.6); animation: mBubble 4.2s ease-in-out infinite; }
.m-bubble i { width: 7px; height: 7px; border-radius: 50%; background: #7C3AED; animation: mDots 1.2s ease-in-out infinite; }
.m-bubble i:nth-child(2) { animation-delay: .15s; background: #A855F7; } .m-bubble i:nth-child(3) { animation-delay: .3s; background: #F59E0B; }

/* ── Parent: warm welcome ── */
.m-parent .m-body { animation: mBreathe 5s ease-in-out infinite; }
.m-parent .m-shadow { animation: mShadowBreathe 5s ease-in-out infinite; }
.m-ring { position: absolute; left: 44%; top: 55%; width: 60%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(196,181,253,.55);
  transform: translate(-50%,-50%) scale(.6); opacity: 0; animation: mRing 6s ease-out infinite; }
.m-ring.r2 { animation-delay: 2s; border-color: rgba(253,186,116,.40); } .m-ring.r3 { animation-delay: 4s; }
.m-float { position: absolute; bottom: 14%; color: #F9A8D4; opacity: 0; display: inline-flex; padding: 7px; border-radius: 50%; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px); animation: mRise 6s ease-in infinite; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.m-float.f1 { left: 4%; } .m-float.f2 { left: 84%; color: #86EFAC; animation-delay: 1.5s; }
.m-float.f3 { left: 22%; color: #FCD34D; animation-delay: 3s; } .m-float.f4 { left: 70%; animation-delay: 4.5s; }

/* ── Admin: guardian ── */
.m-admin .m-body { animation: mHover 3.6s ease-in-out infinite; }
.m-admin .m-shadow { animation: mShadowHover 3.6s ease-in-out infinite; }
.m-radar { position: absolute; left: 44%; top: 52%; width: 92%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%,-50%);
  background: conic-gradient(from 0deg, rgba(167,139,250,.0) 0deg, rgba(167,139,250,.0) 280deg, rgba(167,139,250,.45) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 46%, #000 47%, #000 69%, transparent 70%); mask: radial-gradient(circle, transparent 46%, #000 47%, #000 69%, transparent 70%);
  animation: mRadar 4s linear infinite; }
.m-radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(196,181,253,.35); }
.m-scan { position: absolute; left: 18%; right: 18%; height: 2px; top: 20%; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(134,239,172,.9), transparent); box-shadow: 0 0 12px rgba(134,239,172,.8); animation: mScan 3.6s ease-in-out infinite; }
.m-admin .m-chip { padding: 8px; }

/* Mini fox in the mobile/tablet header (each portal keeps its own motion) */
.mini-fox { margin-left: auto; width: 56px; height: 56px; display: none; }
.auth-brand .mini-fox img, .mini-fox img, .mini-fox .m-fig { width: 100%; height: 100%; object-fit: contain; background: none; padding: 0; border-radius: 0; box-shadow: none; filter: drop-shadow(0 6px 8px rgba(76,29,149,.3)); transform-origin: 50% 100%; }
/* mini fox animates the whole figure */
.mini-fox .m-fig > img { animation: none !important; }
.mini-fox.m-student .m-fig { animation: mHop 2.8s cubic-bezier(.3,.1,.3,1) infinite; }
.mini-fox.m-teacher .m-fig { animation: mExplain 4.2s ease-in-out infinite; }
.mini-fox.m-parent .m-fig { animation: mBreathe 5s ease-in-out infinite; }
.mini-fox.m-admin .m-fig { animation: mHover 3.6s ease-in-out infinite; }
@media (max-width: 1023px) { .auth-card .auth-mobile-brand { align-items: center; padding-right: 48px; } .mini-fox { display: block; } }

@keyframes mSpin { to { transform: rotate(360deg); } }
@keyframes mSpinBack { from { transform: translateX(-50%) rotate(0deg); } to { transform: translateX(-50%) rotate(-360deg); } }
@keyframes mGlow { 0%,100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes mHop {
  0%, 52%, 100% { transform: translateY(0) scale(1,1); }
  8%  { transform: translateY(0) scale(1.05,.93); }
  22% { transform: translateY(-16%) scale(.97,1.04) rotate(-2deg); }
  34% { transform: translateY(-18%) scale(1,1) rotate(2deg); }
  46% { transform: translateY(0) scale(1.06,.92); }
}
@keyframes mShadowHop { 0%,52%,100% { transform: scale(1); opacity: 1; } 22%,34% { transform: scale(.6); opacity: .45; } 46% { transform: scale(1.1); } }
@keyframes mPop { 0% { opacity: 0; transform: translateY(10px) scale(.7); } 10% { opacity: 1; transform: translateY(0) scale(1.05); } 35% { opacity: 1; transform: translateY(-18px) scale(1); } 50%,100% { opacity: 0; transform: translateY(-34px) scale(.9); } }
@keyframes mExplain { 0%,100% { transform: rotate(-3deg) translateX(-2%); } 25% { transform: rotate(0deg) translateY(-2%); } 50% { transform: rotate(3deg) translateX(2%); } 75% { transform: rotate(0deg) translateY(-1%); } }
@keyframes mShadowSway { 0%,100% { transform: translateX(-6%); } 50% { transform: translateX(6%); } }
@keyframes mCard { 0% { opacity: 0; transform: translateY(12px) scale(.85); } 8%,30% { opacity: 1; transform: translateY(0) scale(1); } 40%,100% { opacity: 0; transform: translateY(-10px) scale(.95); } }
@keyframes mBubble { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.04); } }
@keyframes mDots { 0%,80%,100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes mBreathe { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3%) scale(1.03); } }
@keyframes mShadowBreathe { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.88); opacity: .75; } }
@keyframes mRing { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.6); } }
@keyframes mRise { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: 1; transform: translateY(-20px) scale(1); } 70% { opacity: .8; } 100% { opacity: 0; transform: translateY(-150px) translateX(10px) scale(.9); } }
@keyframes mHover { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5%); } }
@keyframes mShadowHover { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.82); opacity: .65; } }
@keyframes mRadar { from { transform: translate(-50%,-50%) rotate(0deg); } to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes mScan { 0%,100% { top: 22%; opacity: 0; } 10%,90% { opacity: 1; } 50% { top: 82%; } }

/* Reduced-motion users: the mascot keeps moving, just slowly and gently */
@media (prefers-reduced-motion: reduce) {
  .auth-mascot *, .auth-mascot::before, .mini-fox img { animation-duration: 8s !important; transition-duration: .2s !important; }
  .m-student .m-body, /* mini fox animates the whole figure */
.mini-fox .m-fig > img { animation: none !important; }
.mini-fox.m-student .m-fig { animation-name: mBreathe !important; }
}

/* ═══ Admin: add-account fields + one-time credentials card ═══ */
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: .01em; }
.opt { font-weight: 500; color: var(--gray3); font-size: .74rem; }
.acct-box { margin: 6px 0 14px; padding: 14px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--purple) 30%, var(--border)); background: var(--purple-gl); }
.acct-box-head { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: .84rem; color: var(--purple); margin-bottom: 4px; }
.acct-hint { font-size: .76rem; color: var(--gray2); margin: 0 0 10px; line-height: 1.45; display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.acct-hint b { color: var(--white); font-weight: 700; }
.acct-pw { display: flex; gap: 8px; }
.acct-pw .inp { flex: 1; min-width: 0; }
.pw-meter { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: .74rem; color: var(--gray3); }
.pw-meter i { width: 72px; height: 5px; border-radius: 4px; background: var(--bg4); position: relative; overflow: hidden; flex-shrink: 0; }
.pw-meter i::after { content: ""; position: absolute; inset: 0; width: 0; border-radius: 4px; transition: width .2s, background-color .2s; }
.pw-meter[data-lvl="1"] i::after { width: 25%; background: var(--red); }   .pw-meter[data-lvl="1"] span { color: var(--red); }
.pw-meter[data-lvl="2"] i::after { width: 55%; background: var(--coral); }
.pw-meter[data-lvl="3"] i::after { width: 80%; background: var(--green); }
.pw-meter[data-lvl="4"] i::after { width: 100%; background: var(--green); } .pw-meter[data-lvl="3"] span, .pw-meter[data-lvl="4"] span { color: var(--green); }
.acct-check { display: flex; gap: 9px; align-items: flex-start; font-size: .82rem; color: var(--gray1); margin: 4px 0 8px; cursor: pointer; }
.acct-check input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.acct-check em { color: var(--gray3); font-style: normal; font-size: .76rem; }

.cred-card { margin-bottom: 18px; border-radius: 16px; background: var(--card); border: 1px solid color-mix(in srgb, var(--green) 35%, var(--border)); box-shadow: var(--sh2); overflow: hidden; }
.cred-head { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; background: linear-gradient(120deg, var(--green-lt), transparent 70%); }
.cred-badge { width: 42px; height: 42px; border-radius: 12px; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 6px 16px -6px rgba(22,163,74,.6); }
.cred-head h2 { font-size: 1.08rem !important; margin: 2px 0 3px; }
.cred-head p { font-size: .85rem; color: var(--gray2); }
.cred-x { margin-left: auto; border: 0; background: transparent; color: var(--gray3); width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.cred-x:hover { background: var(--bg3); color: var(--white); }
.cred-slip { margin: 0 20px; padding: 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--card2); }
.cred-slip-brand { display: none; }
.cred-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.cred-grid .wide { grid-column: 1 / -1; }
.cred-grid dt { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gray3); margin-bottom: 3px; }
.cred-grid dd { margin: 0; font-weight: 600; color: var(--white); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; word-break: break-all; font-size: .92rem; }
.cred-grid dd a { color: var(--purple); }
.cred-pw { font-size: 1.05rem !important; color: var(--purple) !important; }
.cred-copy { border: 1px solid var(--border2); background: var(--card); color: var(--gray2); width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s; }
.cred-copy:hover { color: var(--purple); border-color: var(--brand-400); }
.cred-copy.done, #credCopyAll.done { background: var(--green); border-color: var(--green); color: #fff; }
.cred-note { margin-top: 12px; font-size: .78rem; color: var(--gray2); display: flex; gap: 6px; align-items: center; }
.cred-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px 18px; }
.cred-mail { font-size: .82rem; color: var(--gray2); }
.cred-mail span { display: inline-flex; gap: 6px; align-items: center; }
.cred-mail .ok { color: var(--green); font-weight: 600; } .cred-mail .err { color: var(--red); }
.cred-actions { display: flex; gap: 8px; }
@media (max-width: 767px) { .cred-grid { grid-template-columns: 1fr; } .cred-slip { margin: 0 14px; } .cred-head, .cred-foot { padding-left: 14px; padding-right: 14px; } .cred-actions { width: 100%; } .cred-actions .btn { flex: 1; } }

/* Printing the slip: only the credentials, nicely branded */
@media print {
  body.has-cred * { visibility: hidden !important; }
  body.has-cred #credSlip, body.has-cred #credSlip * { visibility: visible !important; }
  body.has-cred #credSlip { position: fixed; left: 0; top: 0; width: 100%; border: 2px solid #7C3AED; border-radius: 14px; padding: 28px; background: #fff !important; color: #111 !important; }
  body.has-cred .cred-slip-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #ddd; }
  body.has-cred .cred-slip-brand img { width: 40px; height: 40px; }
  body.has-cred .cred-slip-brand b { display: block; font-size: 1.1rem; } body.has-cred .cred-slip-brand span { color: #555; font-size: .85rem; }
  body.has-cred .cred-copy { display: none !important; }
  body.has-cred .cred-grid dd { color: #111 !important; font-size: 1rem; }
}
.uid-tag { display: inline-flex; align-items: center; font-size: .68rem; font-weight: 700; color: var(--purple); background: var(--purple-lt); border-radius: 6px; padding: 1px 6px; margin-left: 6px; letter-spacing: .02em; white-space: nowrap; }
.setpw-id { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: -8px 0 20px; padding: 12px 14px; border-radius: 12px; background: var(--purple-gl); border: 1px solid color-mix(in srgb, var(--purple) 18%, var(--border)); }
.setpw-id span { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--gray3); }
.setpw-id b { font-size: .86rem; color: var(--white); word-break: break-all; }


/* ═══ Sign-in mascot v2: role outfits + readable activity cards ═══ */
/* outfit details move on their own */
.m-tassel { transform-origin: 375px 70px; animation: mTassel 2.8s ease-in-out infinite; }
.m-pointer { transform-origin: 448px 488px; animation: mPoint 4.2s ease-in-out infinite; }
.m-scarf { transform-origin: 440px 290px; animation: mScarf 5s ease-in-out infinite; }
.m-heartpin { transform-origin: 318px 285px; animation: mBeat 1.6s ease-in-out infinite; }
.m-mic { animation: mMic 1.8s ease-in-out infinite; }
@keyframes mTassel { 0%,100% { transform: rotate(0deg); } 30% { transform: rotate(-8deg); } 60% { transform: rotate(5deg); } }
@keyframes mPoint { 0%,100% { transform: rotate(0deg); } 20% { transform: rotate(-6deg); } 28% { transform: rotate(-2deg); } 36% { transform: rotate(-6deg); } 60% { transform: rotate(2deg); } }
@keyframes mScarf { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(4deg); } }
@keyframes mBeat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
@keyframes mMic { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* activity cards: one at a time, each says what it is */
.m-note { position: absolute; display: flex; align-items: center; gap: 9px; padding: 8px 12px 8px 8px; border-radius: 14px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 28px -10px rgba(0,0,0,.6); color: #fff; white-space: nowrap; opacity: 0; z-index: 2;
  animation: mNote 9s ease-in-out infinite; }
.m-note .ic-tile { --tile: 30px; border-radius: 9px; background: rgba(167,139,250,.22); color: #E9D5FF; }
.m-note b { display: block; font: 700 .78rem/1.2 var(--font-head); color: #fff; }
.m-note small { display: block; font-size: .68rem; color: #CFC8EA; margin-top: 1px; }
.m-note.n1 { top: -6%; right: -6%; }
.m-note.n2 { top: 44%; right: -8%; animation-delay: 3s; }
.m-note.n2 .ic-tile { background: rgba(251,191,36,.2); color: #FCD34D; }
.m-note.n3 { bottom: 10%; right: -2%; animation-delay: 6s; }
.m-note.n3 .ic-tile { background: rgba(74,222,128,.18); color: #86EFAC; }
@keyframes mNote { 0% { opacity: 0; transform: translateY(14px) scale(.94); } 5%,28% { opacity: 1; transform: translateY(0) scale(1); } 34%,100% { opacity: 0; transform: translateY(-12px) scale(.97); } }
/* older decorative pieces kept subtle */
.m-radar { opacity: .55; }
.m-ring { opacity: 0; }
.m-student .m-pop.p1 { top: 22%; left: 70%; }

/* ═══ Wordmark in the TMS logo colours (navy + flame orange) ═══ */
.wordmark { font-family: var(--font-brand) !important; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; background: none !important; -webkit-text-fill-color: initial !important; }
.wm-t { background: linear-gradient(180deg, #2E57D6 0%, #13308F 60%, #0D1F57 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.wm-e { background: linear-gradient(180deg, #FF9A4D 0%, #F45A1C 55%, #D9380B 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
/* on dark surfaces the navy is lifted so it stays readable */
.auth-aside .wm-t, html[data-theme="dark"] .wm-t { background-image: linear-gradient(180deg, #8EA8FF 0%, #4C74F2 55%, #2E57D6 100%); filter: drop-shadow(0 0 10px rgba(76,116,242,.35)); }
.auth-aside .wm-e, html[data-theme="dark"] .wm-e { filter: drop-shadow(0 0 10px rgba(244,90,28,.35)); }
.sb-logo-text b.wordmark { font-size: .98rem; letter-spacing: .03em; }
.auth-brand b.wordmark { font-size: 1.15rem; }

.auth-mascot { margin-right: 34px; }
.auth-brand b.wordmark { font-size: 1.22rem; }
.m-teacher .m-bubble { top: 14%; right: auto; left: -4%; border-radius: 16px 16px 4px 16px; }

/* ═══ Sign-in mascot v3 — calm & professional ════════════════════════
   Plain brand fox · a slow halo in the logo colours · one nameplate.
   Each portal keeps its own gentle motion. */
.auth-mascot { margin-right: 12px; margin-bottom: 58px; }
.auth-mascot .m-fx { inset: 0; }
.m-halo { position: absolute; left: 50%; top: 48%; width: 96%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, rgba(46,87,214,0) 0deg, rgba(76,116,242,.9) 70deg, rgba(168,85,247,.85) 150deg, rgba(244,90,28,.9) 230deg, rgba(244,90,28,0) 300deg, rgba(46,87,214,0) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 66.5%, #000 67.5%, #000 69%, transparent 70%);
          mask: radial-gradient(circle, transparent 66.5%, #000 67.5%, #000 69%, transparent 70%);
  animation: mHalo 22s linear infinite; opacity: .9; }
.m-halo.h2 { width: 78%; opacity: .35; animation-duration: 34s; animation-direction: reverse;
  background: conic-gradient(from 90deg, transparent 0deg, rgba(196,181,253,.9) 120deg, transparent 240deg, rgba(253,186,116,.8) 300deg, transparent 360deg); }
@keyframes mHalo { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

.m-plate { position: absolute; left: 50%; bottom: -34px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 8px; border-radius: 14px; white-space: nowrap;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px -14px rgba(0,0,0,.7); }
.m-plate .ic-tile { --tile: 32px; border-radius: 10px; background: linear-gradient(135deg, rgba(76,116,242,.35), rgba(244,90,28,.30)); color: #fff; }
.m-plate b { display: block; font: 700 .84rem/1.2 var(--font-head); color: #fff; }
.m-plate small { display: block; font-size: .7rem; color: #C9C3E3; letter-spacing: .02em; margin-top: 1px; }

/* gentler, more formal motion per portal */
.m-student .m-body, .mini-fox.m-student .m-fig { animation: mBob 3.2s ease-in-out infinite !important; }
.m-student .m-shadow { animation: mShadowHover 3.2s ease-in-out infinite !important; }
.m-teacher .m-body, .mini-fox.m-teacher .m-fig { animation: mNod 4.6s ease-in-out infinite !important; }
.m-teacher .m-shadow { animation: mShadowSway 4.6s ease-in-out infinite !important; }
@keyframes mBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
@keyframes mNod { 0%,100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg) translateY(-1.5%); } }
@media (prefers-reduced-motion: reduce) { .m-halo { animation-duration: 60s !important; } }

/* ═══ Sign-in mascot v4 — still, poised, interactive ═══════════════
   No bouncing. The fox stands still; it tilts subtly toward the pointer
   (3D parallax), a light sheen shaped to its outline sweeps across it,
   and the logo-colour halo turns slowly behind. */
.auth-mascot { perspective: 900px; }
.auth-mascot .m-body, .mini-fox .m-fig { animation: none !important; transform: none; }
.auth-mascot .m-shadow { animation: none !important; }
.auth-mascot .m-body { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .2s ease-out; will-change: transform; }
.auth-mascot .m-fx { transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform .2s ease-out; }
.m-sheen { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url(/static/img/login-fox-mascot.png) center / contain no-repeat; mask: url(/static/img/login-fox-mascot.png) center / contain no-repeat;
  background: linear-gradient(105deg, transparent 0%, transparent 44%, rgba(255,255,255,.5) 48.5%, rgba(255,236,210,.12) 51%, transparent 54%, transparent 100%);
  background-size: 260% 100%; background-position: 130% 0; mix-blend-mode: screen; opacity: .85;
  animation: mSheen 7s cubic-bezier(.45,.05,.25,1) infinite; }
@keyframes mSheen { 0%, 55% { background-position: 130% 0; } 85%, 100% { background-position: -40% 0; } }
.mini-fox .m-sheen { display: none; }
/* per-portal halo tint (all within the logo palette) */
.m-teacher .m-halo:not(.h2) { filter: hue-rotate(-18deg) saturate(1.1); }
.m-parent  .m-halo:not(.h2) { filter: hue-rotate(14deg); }
.m-admin   .m-halo:not(.h2) { filter: saturate(.85) brightness(1.1); animation-duration: 30s; }
@media (prefers-reduced-motion: reduce) { .m-sheen { animation: none; opacity: 0; } }
.auth-mascot .m-fig { position: relative; }

/* automatic-email status line in the Add user forms */
.acct-auto { display: flex; gap: 9px; align-items: flex-start; font-size: .82rem; line-height: 1.5; margin: 6px 0 8px; padding: 9px 11px; border-radius: 10px; }
.acct-auto svg { flex-shrink: 0; margin-top: 2px; }
.acct-auto.ok { background: color-mix(in srgb, #10B981 9%, transparent); color: var(--gray1); border: 1px solid color-mix(in srgb, #10B981 28%, transparent); }
.acct-auto.ok svg { color: #059669; }
.acct-auto.warn { background: color-mix(in srgb, #F59E0B 10%, transparent); color: var(--gray1); border: 1px solid color-mix(in srgb, #F59E0B 30%, transparent); }
.acct-auto.warn svg { color: #D97706; }
.acct-auto a { color: var(--violet, #7C3AED); font-weight: 600; }
