/* ── Genius Sync design tokens — the product website's identity (paper, indigo ink and the
   toy-block colours of the logo). Theme/SchoolSyncTheme.cs carries the same values for
   MudBlazor; keep the two in step. ─────────────────────────────────────────────────────── */
:root {
    --gs-paper: #FFFAF0;
    --gs-cream: #FFF1D2;
    --gs-ink: #1E2145;
    --gs-ink2: #4A4D70;
    --gs-mute: #6A6C88;
    --gs-line: rgba(30, 33, 69, 0.13);
    --gs-sun: #FFC52E;
    --gs-sun-l: #FFE7A3;
    --gs-berry: #B3245A;
    --gs-berry-l: #FBE1EA;
    --gs-sky: #2F7FE6;
    --gs-sky-d: #1B5DBB;
    --gs-sky-l: #DDEBFF;
    --gs-leaf: #1C7F51;
    --gs-leaf-l: #DBF2E5;
    --gs-amber: #9A5B00;
    --gs-amber-l: #FFEBC2;
    --gs-night: #1C1E44;
    --gs-font-display: 'Fredoka', ui-rounded, 'Segoe UI', system-ui, sans-serif;
    --gs-font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --gs-shadow: 0 30px 60px -32px rgba(30, 33, 69, 0.45);
}

html, body {
    height: 100%;
    margin: 0;
    font-family: var(--gs-font-body);
    color: var(--gs-ink);
    /* Same navy as the loading splash and every other screen's base — a permanent baseline
       so nothing (a resize, a brief gap between the splash unmounting and the app's own
       layout painting, etc.) can ever show the browser's default white through. The inline
       <style> in index.html duplicates just this line so it's already in effect before this
       stylesheet itself has loaded. */
    background: var(--gs-paper);
    /* Global safety net: no page should ever be horizontally scrollable — this
       only ever kicks in if something further down the tree is wider than the
       viewport, at which point clipping the overflow is safer than a page-wide
       horizontal scrollbar shifting every fixed-position element (appbar, drawer). */
    overflow-x: hidden;
}

/* ── Loading splash — a fixed overlay sibling of #app (index.html), shown from first paint
   until a tiny inline script (index.html, no Blazor/startup code touched) detects Blazor has
   inserted its first real content into #app and fades this out. Matches the same Genius Sync
   identity as every other screen (navy + orange/blue accents) instead of the browser's
   default white, which is what showed through here before this had any styling of its own.
   `html, body`'s inline <style> in index.html covers the sliver of time before this
   stylesheet itself has loaded. ─────────────────────────────────────────────────────────── */
.loading-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    padding: 24px;
    background:
        radial-gradient(ellipse 900px 700px at 50% 30%, #FFFFFF 0%, transparent 60%),
        var(--gs-paper);
    opacity: 0;
    animation: loading-splash-fade-in 0.5s ease forwards;
    transition: opacity 0.45s ease;
}

.loading-splash.loading-splash-hide {
    opacity: 0;
    pointer-events: none;
}

@keyframes loading-splash-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-splash-glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 520px 420px at 50% 42%, rgba(255, 197, 46, 0.22), transparent 65%),
        radial-gradient(ellipse 480px 480px at 60% 60%, rgba(47, 127, 230, 0.10), transparent 65%);
}

/* Handful of small, slow-drifting motes — kept extremely subtle (low opacity, tiny size,
   long duration) so it reads as ambient depth rather than a decorative gimmick. */
.loading-splash-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.loading-splash-particles span {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 0;
    animation: loading-particle-float 7s ease-in-out infinite;
}

.loading-splash-particles span:nth-child(1) { left: 22%; top: 68%; background: #FFC52E; animation-delay: 0s; }
.loading-splash-particles span:nth-child(2) { left: 78%; top: 32%; background: #2F7FE6; animation-delay: 1.4s; }
.loading-splash-particles span:nth-child(3) { left: 36%; top: 22%; background: #B3245A; animation-delay: 2.8s; }
.loading-splash-particles span:nth-child(4) { left: 66%; top: 74%; background: #FFC52E; animation-delay: 4.2s; }
.loading-splash-particles span:nth-child(5) { left: 50%; top: 48%; background: #2F7FE6; animation-delay: 5.6s; }

@keyframes loading-particle-float {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 0.4; }
    70% { opacity: 0.4; }
    100% { opacity: 0; transform: translateY(-36px); }
}

.loading-splash-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 320px;
}

/* Icon container — the toy-block logo sits inside a soft rounded surface rather than
   floating bare, with a slow pulsing glow so the whole composition feels alive without being
   distracting. */
.loading-splash-icon-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(84px, 20vw, 104px);
    height: clamp(84px, 20vw, 104px);
    border-radius: 26px;
    margin-bottom: 22px;
    background: #FFFFFF;
    border: 1.5px solid var(--gs-line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    animation:
        loading-splash-scale-in 0.5s ease 0.1s forwards,
        loading-icon-ring-pulse 3.2s ease-in-out 0.6s infinite;
}

.loading-splash-icon {
    width: 52%;
    height: 52%;
}

@keyframes loading-splash-scale-in {
    from { opacity: 0; transform: scale(0.82); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes loading-icon-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(255, 197, 46, 0.18), 0 18px 36px -18px rgba(30, 33, 69, 0.35); }
    50% { box-shadow: 0 0 0 12px rgba(255, 197, 46, 0.10), 0 18px 36px -18px rgba(30, 33, 69, 0.35); }
}

.loading-splash-wordmark {
    font-family: var(--gs-font-display);
    color: var(--gs-ink);
    font-weight: 800;
    font-size: clamp(1.25rem, 5vw, 1.55rem);
    letter-spacing: 0.01em;
    margin-bottom: 10px;
    opacity: 0;
    animation: loading-splash-fade-up 0.5s ease 0.3s forwards;
}

/* .accent-orange / .accent-blue already exist as document-wide utilities (used by the
   login page's branding panel) — reused as-is here rather than re-declared. */
.loading-splash-wordmark .accent-my { color: var(--gs-mute); font-weight: 500; }
.loading-splash-wordmark .accent-berry { color: var(--gs-berry); }

.loading-splash-message {
    font-family: var(--gs-font-body);
    font-size: 0.85rem;
    color: #6A6C88;
    margin-bottom: 22px;
    opacity: 0;
    animation: loading-splash-fade-up 0.5s ease 0.45s forwards;
}

@keyframes loading-splash-fade-up {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modern gradient sweep line, favoured over a spinner or dots — a slim rounded track with a
   short gradient segment sweeping across it. */
.loading-bar {
    position: relative;
    width: 150px;
    height: 3px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(30, 33, 69, 0.1);
    opacity: 0;
    animation: loading-splash-fade-up 0.5s ease 0.6s forwards;
}

.loading-bar span {
    position: absolute;
    inset: 0;
    width: 42%;
    left: -42%;
    border-radius: 999px;
    background: linear-gradient(90deg, #FFC52E, #B3245A, #2F7FE6);
    animation: loading-bar-sweep 1.6s ease-in-out infinite;
}

@keyframes loading-bar-sweep {
    0% { left: -42%; }
    100% { left: 100%; }
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(30, 33, 69, 0.12);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}


/* ── Brand mark (BrandMark.razor): the toy-block logo + "Genius Sync" wordmark ──────────── */
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--gs-ink);
    text-decoration: none;
    min-width: 0;
}

.brand-mark-icon {
    display: block;
    flex-shrink: 0;
}

.brand-wordmark {
    font-family: var(--gs-font-display);
    font-weight: 600;
    font-size: 1.3rem;
    line-height: 1;
    letter-spacing: -0.01em;
    white-space: nowrap;
    color: var(--gs-ink);
}

.brand-wordmark b {
    font-weight: 600;
    color: var(--gs-berry);
}

.brand-wordmark small {
    display: block;
    margin-top: 4px;
    font: 700 0.62rem/1 var(--gs-font-body);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gs-mute);
}

h1, h2, h3, h4, h5, h6 { font-family: var(--gs-font-display); }

/* ── Genius Sync theme — logo, borders, pill status chips ─────────────── */
/* Same design system as the main app (SchoolSync.Client.UI/wwwroot/css/app.css) —
   duplicated here for the same reason the theme file is duplicated: this project takes no
   project reference on anything staff-facing. Keep the two files in sync by hand. */

.app-logo {
    height: 40px;
    width: auto;
    display: block;
}

.app-logo-large {
    width: min(90%, 380px);
    max-width: 100%;
    height: auto;
    display: block;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    margin-top: -16px;
    margin-bottom: 8px;
}

.app-bar-bordered {
    border-bottom: 1px solid var(--mud-palette-divider);
}

/* Small header avatar — initials fallback (gradient chip) or the student's photo when
   MyProfileDto.PhotoUrl is set. Kept compact so the app bar never grows taller. */
.student-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #B3245A, #2F7FE6);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.8rem;
}

.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-layout {
    min-height: 100vh;
    background-color: var(--mud-palette-background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-bordered {
    border-right: 1px solid var(--mud-palette-divider);
    background: #FFFFFF;
}

/* ── Mobile drawer overlay fix — same root cause/fix as the staff app (see
   SchoolSync.Client.UI/wwwroot/css/app.css for the full explanation):
   MudDrawer's Persistent variant has no breakpoint awareness of its own, so
   MudBlazor's CSS pushes .mud-main-content/.mud-appbar over by the drawer's
   full width via margin-left at every screen size. Below 960px, cancelling
   that margin lets content reclaim the full viewport width; the already
   position:fixed drawer naturally overlays on top when open, with a
   tap-to-close scrim (added in MainLayout.razor) behind it. ────────────── */
@media (max-width: 959px) {
    .mud-main-content,
    .mud-appbar {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
    }
}

.mobile-drawer-scrim {
    display: none;
}

@media (max-width: 959px) {
    .mobile-drawer-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(30, 33, 69, 0.3);
        z-index: calc(var(--mud-zindex-drawer, 1300) - 1);
    }
}

/* Rounded, pill-shaped status chips (matches the reference's "Active" badges) */
.mud-chip.mud-chip-filled {
    border-radius: 999px;
    font-weight: 600;
}

/* ── Ambient gradient mesh, behind the main content only ──────────────────
   Kept out of the sidebar/appbar so nav text stays crisp and easy to read. */
.mud-main-content {
    position: relative;
}

.mud-main-content::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 800px 500px at 15% -10%, rgba(255, 197, 46, 0.16), transparent 60%),
        radial-gradient(ellipse 900px 600px at 90% 10%, rgba(47, 127, 230, 0.08), transparent 60%),
        radial-gradient(ellipse 700px 700px at 50% 120%, rgba(47, 127, 230, 0.05), transparent 60%);
    animation: mesh-drift 24s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes mesh-drift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-2%, 2%, 0) scale(1.05); }
}

/* ── Glass panels — scoped to cards inside the main content, so the
   solid-color appbar/drawer navigation is never affected. ────────────── */
.mud-main-content .mud-paper {
    border-radius: 12px;
    background-color: #FFFFFF;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(30, 33, 69, 0.08);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.mud-main-content .mud-paper:hover {
    border-color: rgba(255, 197, 46, 0.56);
    box-shadow: 0 0 24px rgba(255, 197, 46, 0.19), 0 8px 24px rgba(30, 33, 69, 0.15);
}

/* ── Signature element: a slow, subtle gradient shimmer on primary
   buttons — the one place this theme "moves" on its own, kept restrained
   rather than repeated everywhere. ─────────────────────────────────────── */
.mud-button-filled.mud-button-filled-primary {
    background: var(--gs-ink);
    color: #FFFFFF;
    box-shadow: 0 3px 0 var(--gs-sun);
    transition: box-shadow 0.25s ease, transform 0.15s ease;
}

.mud-button-filled.mud-button-filled-primary:hover {
    background: var(--gs-ink);
    box-shadow: 0 5px 0 var(--gs-sun), 0 14px 26px -14px rgba(30, 33, 69, 0.7);
    transform: translateY(-1px);
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ── Hover glow on other interactive elements ──────────────────────────── */
.mud-icon-button:hover {
    box-shadow: 0 0 12px rgba(47, 127, 230, 0.22);
}

.mud-nav-link {
    border-radius: 10px;
    margin: 2px 8px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.mud-nav-link:hover {
    background-color: rgba(255, 197, 46, 0.13);
    transform: translateX(2px);
}

/* MudBlazor 7 marks the current page with .active (older builds used .mud-selected). */
.mud-nav-link.mud-selected,
.mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: linear-gradient(90deg, rgba(255, 197, 46, 0.42), rgba(255, 231, 163, 0.28)) !important;
    border-inline-end-width: 0;
    box-shadow: inset 3px 0 0 0 var(--gs-berry);
    color: var(--gs-ink) !important;
    font-weight: 700;
}

/* ── Sidebar brand header ───────────────────────────────────────────── */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(30, 33, 69, 0.1);
    margin-bottom: 8px;
}

.nav-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 197, 46, 0.4), rgba(47, 127, 230, 0.16));
    border: 1px solid rgba(30, 33, 69, 0.16);
    color: #B3245A;
}

.nav-brand-text {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 1px;
    white-space: nowrap;
    background: linear-gradient(100deg, #B3245A 0%, #B3245A 45%, #2F7FE6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ── Per-item accent colours — resting icon tint + matching hover wash
   and glow. Active-state chrome (background/left-bar) stays the single
   consistent orange/blue brand treatment above, independent of these. ── */
.mud-nav-link .mud-icon-root {
    width: 22px;
    height: 22px;
    font-size: 22px;
}

.mud-nav-link.mud-selected .mud-icon-root,
.mud-nav-link.active .mud-icon-root {
    transform: scale(1.06);
}

.nav-icon-orange .mud-icon-root { color: #B3245A !important; }
.nav-icon-blue .mud-icon-root { color: #2F7FE6 !important; }
.nav-icon-green .mud-icon-root { color: #1C7F51 !important; }
.nav-icon-purple .mud-icon-root { color: #9A5B00 !important; }
.nav-icon-cyan .mud-icon-root { color: #1B5DBB !important; }

.nav-icon-orange:hover { background-color: rgba(255, 197, 46, 0.16); }
.nav-icon-blue:hover { background-color: rgba(47, 127, 230, 0.08); }
.nav-icon-green:hover { background-color: rgba(28, 127, 81, 0.09); }
.nav-icon-purple:hover { background-color: rgba(139, 92, 246, 0.10); }
.nav-icon-cyan:hover { background-color: rgba(6, 182, 212, 0.10); }

@media (max-width: 599px) {
    .nav-brand {
        padding: 16px 16px 14px;
    }

    .mud-nav-link {
        margin: 2px 6px;
    }
}

/* Covers MudTable, MudSimpleTable, and MudDataGrid row markup */
.mud-table-row:hover,
.mud-tr:hover,
tbody tr:hover {
    box-shadow: inset 3px 0 0 var(--mud-palette-info);
}

/* ── Accessibility floor: visible focus ring, reduced motion honoured ──── */
:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .mud-main-content::before,
    .mud-button-filled.mud-button-filled-primary,
    .loading-splash-icon-ring,
    .loading-splash-particles span,
    .loading-bar span {
        animation: none;
    }

    .loading-splash-icon-ring,
    .loading-splash-wordmark,
    .loading-splash-message,
    .loading-bar {
        opacity: 1;
    }

    .loading-bar span {
        left: 0;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ── Student-portal specific: bigger tap targets throughout — this app is
   used on a shared classroom device, often by young learners, not a
   mouse-and-keyboard staff workstation. Kept as this project's one
   deliberate addition on top of the shared design system. ────────────── */
.mud-button-root {
    min-height: 44px;
}

/* ── Auth footer — bottom-right of the viewport, on every page using AuthLayout ────────── */
.auth-footer {
    position: fixed;
    right: 24px;
    bottom: 16px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    letter-spacing: 0.02em;
}

/* ── Login shell — split-screen branding + form, matching
   Documents/Development/StudentPortal_reference.png. Same navy overlay
   gradient + Login_background.png treatment as the main app's login
   (SchoolSync.Client.UI/wwwroot/css/app.css .login-shell) — the
   image is duplicated into this project's own wwwroot/images rather than
   referenced, since this app takes no project reference on anything
   staff-facing (see the .csproj's own comment for why), the same reason
   its CSS/theme files are duplicated by hand instead of shared. This app
   IS its own WASM host (unlike SchoolSync.Client.UI, a Razor Class
   Library), so the path below resolves at the site root directly — no
   _content/... prefix needed here. Scoped to its own class rather than
   .auth-layout, same reason the main app scopes .login-shell instead of
   touching .auth-layout: if a student-facing Register/ForgotPassword page
   is ever added, it should get the plain .auth-layout background, not
   this one. */
.student-login-shell {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 48px 24px;
    background:
        radial-gradient(circle at 1px 1px, rgba(30, 33, 69, 0.07) 1px, transparent 0) 0 0 / 22px 22px,
        var(--gs-paper);
}

.student-login-shell::before,
.student-login-shell::after,
.login-orbit-glow {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.student-login-shell::before {
    width: 480px;
    height: 480px;
    top: -160px;
    left: -120px;
    background: radial-gradient(circle, rgba(255, 197, 46, 0.35), transparent 70%);
}

.student-login-shell::after {
    width: 480px;
    height: 480px;
    bottom: -180px;
    right: -140px;
    background: radial-gradient(circle, rgba(47, 127, 230, 0.16), transparent 70%);
}

/* Ambient green wash behind the card — keeps the brand's third colour
   present near the form even though the trust row (which carries it on
   the main app's login) lives in the branding panel here instead. */
.login-orbit-glow.tertiary {
    width: 320px;
    height: 320px;
    top: 55%;
    right: 10%;
    background: radial-gradient(circle, rgba(28, 127, 81, 0.09), transparent 70%);
}

/* Dotted grid accent, top-left corner of the shell. */
.student-dot-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 260px;
    height: 260px;
    background-image: radial-gradient(rgba(255, 197, 46, 0.56) 1.5px, transparent 1.5px);
    background-size: 18px 18px;
    -webkit-mask-image: radial-gradient(circle at 0 0, black 0%, transparent 75%);
    mask-image: radial-gradient(circle at 0 0, black 0%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

/* Flowing diagonal line accent, bottom-left of the shell — a soft blurred
   gradient bar rather than a literal traced SVG path, close enough at the
   size this renders and far cheaper to maintain. */
.student-wave-accent {
    position: absolute;
    bottom: -40px;
    left: -120px;
    width: 720px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 197, 46, 0.8) 30%, rgba(47, 127, 230, 0.4) 70%, transparent);
    transform: rotate(-8deg);
    filter: blur(1.5px);
    pointer-events: none;
    z-index: 0;
}

.student-login-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    gap: 96px;
}

.student-branding-panel {
    position: relative;
    flex: 1 1 480px;
    min-width: 0;
    max-width: 560px;
}

.student-branding-content {
    position: relative;
    z-index: 1;
}

.student-brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    color: #1E2145;
}

.student-brand-mark .brand-wordmark {
    font-size: 1.7rem;
}

/* Class names are historical: berry and sky are two of the logo's blocks. */
.accent-orange { color: var(--gs-berry); }
.accent-blue   { color: var(--gs-sky-d); }

.student-heading .accent-orange {
    background: linear-gradient(transparent 72%, rgba(255, 197, 46, 0.75) 72%, rgba(255, 197, 46, 0.75) 92%, transparent 92%);
}

.student-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1.5px solid var(--gs-line);
    color: #4A4D70;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.student-heading {
    font-family: var(--gs-font-display);
    font-weight: 600;
    font-size: 2.5rem;
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: #1E2145;
    margin: 0 0 16px;
}

.student-subtitle {
    color: #6A6C88;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 28px;
    max-width: 460px;
}

.student-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 28px;
    color: #6A6C88;
    font-size: 0.8rem;
}

.student-trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.student-trust-row .mud-icon-root {
    font-size: 1.05rem;
    color: #1C7F51;
}

.student-form-panel {
    position: relative;
    z-index: 1;
    flex: 0 1 440px;
    min-width: 0;
    display: flex;
    justify-content: center;
}

/* Ambient halo behind the card — sits behind everything in the form panel
   (z-index:0, card is z-index:1 below) and gently pulses, so the card
   reads as a light source against the shell rather than a flat box with a
   border. Two glows rather than one: blue dominant (matches the card's
   own border) with a faint orange wash so the halo still carries both
   brand colours, echoing the shell's own orange/blue orbs. */
.student-form-panel::before {
    content: "";
    position: absolute;
    inset: -70px;
    z-index: 0;
    border-radius: 40px;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(47, 127, 230, 0.22), transparent 65%),
        radial-gradient(ellipse at 60% 70%, rgba(255, 197, 46, 0.22), transparent 60%);
    filter: blur(50px);
    pointer-events: none;
    animation: card-halo-pulse 6s ease-in-out infinite;
}

@keyframes card-halo-pulse {
    0%, 100% { opacity: 0.75; }
    50%      { opacity: 1; }
}

/* Glass card — matches the main login's .login-form-card treatment
   (translucent + blurred instead of MudPaper's default opaque surface),
   with a light-blue glow border instead of the main app's plain white
   border — the one deliberate departure from the shared design system,
   so the two login pages stay visually distinguishable at a glance.
   Elevation="0" on the MudPaper in Login.razor turns off MudBlazor's own
   box-shadow so it doesn't stack with this one. */
.student-login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    /* More transparent than a first pass would suggest — with only a flat
       gradient behind it, a subtle blur barely reads as "glass". Lower
       opacity lets the shell's orange/blue/green glow orbs tint through the
       card itself, which is what actually sells the frosted-glass look;
       saturate() boosts that tinted colour so it doesn't wash out grey. */
    background: #FFFFFF;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(47, 127, 230, 0.36);
    box-shadow:
        0 24px 60px rgba(30, 33, 69, 0.27),
        0 0 60px rgba(47, 127, 230, 0.14);
}

/* ── Login heading — icon badge, eyebrow label, accented brand name ────────────────────── */
.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.login-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: #FFFFFF;
    border: 1.5px solid var(--gs-line);
    box-shadow: 0 4px 0 rgba(255, 197, 46, 0.9);
    color: var(--gs-ink);
}

/* Plain label with a short centred underline, rather than the badge pill
   used in the branding panel — matches the reference card's treatment,
   which is a static label under the icon rather than a pill repeated
   twice on the same screen. */
.login-eyebrow {
    display: inline-block;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 2px solid rgba(47, 127, 230, 0.32);
    color: #1B5DBB;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
}

.login-title {
    font-weight: 800;
    letter-spacing: -0.01em;
}

/* ── Login feature section — echoes the main login's .login-feature-grid/
   .login-feature-card, using this app's own real destinations (see
   Layout/NavMenu.razor: Home, My attendance, My report card, My lessons)
   instead of the staff app's marketing copy. Lives in the branding panel
   now (see reference image), not below the card. Matches the reference's
   plain icon+text pairs — no enclosing card box, just a bordered icon
   chip to the left of a two-line title/description column. */
.student-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px 28px;
    margin-bottom: 8px;
}

.student-feature-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.student-feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 2px;
}

.student-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1.5px solid transparent;
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.student-feature-card:hover .student-feature-icon {
    background-color: rgba(30, 33, 69, 0.1);
}

.student-feature-icon.tone-orange { background: rgba(255, 197, 46, 0.19); border-color: rgba(255, 197, 46, 0.88); color: #B3245A; }
.student-feature-icon.tone-green  { background: rgba(28, 127, 81, 0.11);  border-color: rgba(28, 127, 81, 0.5); color: #1C7F51; }
.student-feature-icon.tone-blue   { background: rgba(47, 127, 230, 0.1); border-color: rgba(47, 127, 230, 0.44); color: #1B5DBB; }

.student-feature-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1E2145;
}

.student-feature-desc {
    font-size: 0.78rem;
    line-height: 1.4;
    color: #6A6C88;
}

/* ── Login form fields — static label above the input instead of
   MudTextField's floating label, matching the reference exactly (label,
   then a bordered field with a placeholder and a start icon). */
.student-field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4A4D70;
    margin-bottom: 6px;
}

.required-mark {
    color: #C62F3B;
    margin-left: 2px;
}

.student-login-button {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.student-card-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.78rem;
}

.student-card-divider::before,
.student-card-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(30, 33, 69, 0.13);
}

.student-help-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    color: var(--mud-palette-text-secondary) !important;
}

/* ── Split-screen breakpoint — stacks branding above form below 960px,
   the same breakpoint the main app's login uses, and drops the purely
   decorative dot pattern/wave/building illustration so the stacked
   column stays uncluttered on phones and tablets. */
@media (max-width: 959px) {
    .student-login-row {
        flex-direction: column;
        gap: 40px;
    }

    .student-branding-panel {
        max-width: 560px;
        text-align: center;
    }

    .student-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .student-trust-row {
        justify-content: center;
    }

    .student-dot-pattern,
    .student-wave-accent {
        display: none;
    }
}

/* ── Dashboard header ─────────────────────────────────────────────────────────────────── */

.dashboard-greeting {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.refresh-btn {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
    border-radius: 999px;
}

/* ── Stat/KPI card — icon + big-number pattern, ported verbatim from the admin app's
   design system (SchoolSync.Client.UI/wwwroot/css/app.css .stat-card) so both
   apps share one visual language for "at a glance" numbers. Kept as a reusable class
   rather than a page-specific rule — use it for any future icon+value card. ─────────── */
.stat-card,
.stat-card-row,
.stat-card-text {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.stat-card-value {
    font-weight: 800;
    letter-spacing: -0.01em;
}

@media (max-width: 600px) {
    .stat-card-value.mud-typography-h5,
    .stat-card-value.mud-typography-h6 {
        font-size: 1.15rem;
        word-break: break-word;
        overflow-wrap: anywhere;
        line-height: 1.25;
    }
}

/* ── Section panel header — title paired with an optional "View all" link, used above
   every list-style panel (Upcoming lessons, Recent activity, etc). ──────────────────── */
.section-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.section-panel-title {
    font-weight: 700;
}

.section-view-all {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--mud-palette-info);
    text-decoration: none;
    white-space: nowrap;
}

.section-view-all:hover {
    text-decoration: underline;
}

/* ── Empty state — centered icon + caption, used by Shared/EmptyState.razor whenever a
   panel has no data yet (mirrors the admin app's EmptyChartState, generalised with a
   configurable icon since this app isn't chart-only). ────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 16px;
    color: var(--mud-palette-text-secondary);
}

.empty-state .mud-icon-root {
    opacity: 0.5;
    margin-bottom: 8px;
}

/* ── Quick action card — a tappable destination tile (icon + title + description),
   used for the dashboard's "Quick actions" row. Plain <a> rather than MudPaper so it's
   real link semantics (keyboard-focusable, works without JS) styled to match the same
   glass-card hover treatment as `.mud-main-content .mud-paper:hover` above. ─────────── */
.quick-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 12px;
    background-color: #FFFFFF;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(30, 33, 69, 0.08);
    text-decoration: none;
    color: inherit;
    min-width: 0;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.quick-action-card:hover,
.quick-action-card:focus-visible {
    border-color: rgba(255, 197, 46, 0.56);
    box-shadow: 0 0 24px rgba(255, 197, 46, 0.19), 0 8px 24px rgba(30, 33, 69, 0.15);
    transform: translateY(-1px);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-icon.tone-orange { background: rgba(255, 197, 46, 0.19); color: #B3245A; }
.quick-action-icon.tone-blue   { background: rgba(47, 127, 230, 0.1); color: #1B5DBB; }
.quick-action-icon.tone-green  { background: rgba(28, 127, 81, 0.11);  color: #1C7F51; }

.quick-action-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.quick-action-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1E2145;
}

.quick-action-desc {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-action-arrow {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--mud-palette-text-secondary);
}

/* ── Lesson card — compact grid item used by Shared/LessonCard.razor (My Lessons page's
   "Recently completed" grid and non-featured "Coming up" items). Reuses .quick-action-icon
   for the subject chip rather than defining a second icon-chip pattern. ─────────────────── */
.lesson-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border-radius: 12px;
    background-color: #FFFFFF;
    border: 1.5px solid var(--gs-line);
}

.lesson-card-subject {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mud-palette-text-secondary);
    min-width: 0;
    overflow-wrap: anywhere;
}

.lesson-card-title {
    font-weight: 700;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.lesson-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.lesson-card-duration {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.lesson-card-duration .mud-icon-root {
    font-size: 1rem;
}

/* ── Featured "next lesson" hero card — the single most prominent card on My Lessons,
   picked out with a restrained orange accent bar rather than a full gradient fill (kept
   subtle per the design brief: no unnecessary gradients/glow). ──────────────────────────── */
.featured-lesson-card {
    position: relative;
    border-radius: 14px;
    border: 1px solid rgba(255, 197, 46, 0.56);
    background-color: rgba(255, 197, 46, 0.08);
    padding: 24px;
    padding-left: 28px;
    overflow: hidden;
}

.featured-lesson-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #B3245A, #B3245A);
}

@media (max-width: 600px) {
    .featured-lesson-card {
        padding: 18px;
        padding-left: 20px;
    }
}

/* Small uppercase section caption used above every ring/donut/list panel */
.panel-label {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mud-palette-text-secondary);
}

.insight-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── Attendance overview summary row — the % headline + status, sitting above the
   ApexCharts breakdown bar chart (Pages/Home.razor). Wraps on narrow cards instead of
   letting the status label collide with the percentage. ─────────────────────────────── */
.attendance-summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.lesson-list-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--mud-palette-divider);
}

.lesson-list-item:last-child {
    border-bottom: none;
}
