/* ==========================================================================
   Parent App theme
   Loaded after materialize.css + style.css; restyles the shared template
   classes so every page picks up the same look.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f4f6fb;
    --card: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 30px rgba(79, 70, 229, .18);
    --appbar-h: 64px;
    --font: 'Poppins', 'Segoe UI', Roboto, sans-serif;
}

/* ---------- base ---------- */
html body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink-2);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

body h1, body h2, body h3, body h4, body h5, body h6 {
    font-family: var(--font);
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -.01em;
}

body a { color: var(--primary); }
body a:hover { color: var(--primary-600); }

body hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

::selection { background: var(--primary-100); }

/* ---------- preloader ---------- */
.preloader { background: var(--bg) !important; }
.preloader .spinner {
    background: transparent !important;
    border: 3px solid var(--primary-100);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 42px; height: 42px;
    box-shadow: none !important;
    animation: pa-spin .8s linear infinite;
}
@keyframes pa-spin { to { transform: rotate(360deg); } }

/* ---------- app bar ---------- */
.app-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--appbar-h);
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    background: linear-gradient(120deg, var(--primary) 0%, #6d28d9 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(79, 70, 229, .25);
}
.app-bar .icon-btn {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    transition: background .2s;
    flex: 0 0 auto;
}
.app-bar .icon-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.app-bar .icon-btn i { font-size: 20px; line-height: 1; }
.app-bar .brand {
    flex: 1 1 auto;
    min-width: 0;
    color: #fff;
    text-decoration: none;
    line-height: 1.2;
}
.app-bar .brand strong {
    display: block;
    font-size: 16px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-bar .brand small {
    display: block;
    font-size: 12px; opacity: .8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-bar .avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .6);
    flex: 0 0 auto;
}

/* ---------- side drawer ---------- */
.sidebar-panel .side-nav {
    width: 280px;
    background: #fff;
    padding-bottom: 24px;
}
.sidebar-panel .side-nav .drawer-head {
    padding: 28px 20px 22px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    line-height: 1.3;
}
.sidebar-panel .side-nav .drawer-head img {
    width: 64px; height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, .5);
    margin-bottom: 12px;
    display: block;
}
.sidebar-panel .side-nav .drawer-head .name { font-size: 16px; font-weight: 700; display: block; }
.sidebar-panel .side-nav .drawer-head .sub { font-size: 12px; opacity: .8; display: block; }
.sidebar-panel .side-nav li > a {
    height: 46px; line-height: 46px;
    margin: 2px 10px;
    padding: 0 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-2);
    display: flex; align-items: center;
}
.sidebar-panel .side-nav li > a:hover { background: var(--primary-50); color: var(--primary); }
.sidebar-panel .side-nav li a > i,
.sidebar-panel .side-nav li a i {
    width: 22px;
    margin: 0 14px 0 0;
    font-size: 16px;
    color: var(--muted);
    text-align: center;
    line-height: inherit;
    height: auto;
}
.sidebar-panel .side-nav li > a:hover i { color: var(--primary); }
.sidebar-panel .side-nav li.divider-label {
    padding: 14px 24px 4px;
    font-size: 11px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    color: #94a3b8;
}
.sidebar-panel .side-nav li > a.logout { color: var(--danger); }
.sidebar-panel .side-nav li > a.logout i { color: var(--danger); }
.sidenav-overlay { background-color: rgba(15, 23, 42, .45); }

/* ---------- page chrome ---------- */
.segments-page { padding: calc(var(--appbar-h) + 18px) 0 96px; }
.segments-page .segments { padding-top: 0; }
body .container { width: 94%; max-width: 1100px; }

.pages-title {
    text-align: left;
    margin: 4px 0 18px;
    padding: 0;
}
.pages-title h3 {
    text-transform: none;
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
}
.pages-title .line {
    width: 40px; height: 4px;
    border-radius: 4px;
    margin: 10px 0 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.pages-title p[align="center"] { text-align: center; }

/* ---------- cards ---------- */
body .z-depth-1 { box-shadow: var(--shadow); }

.list .contents,
.contact-contents,
.signin-contents,
.features .contents,
.gallery-work .contents,
.blog .contents {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
    overflow: hidden;
}

.list .plum {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.list .primary, .list .info, .list .warning,
.list .success, .list .danger, .list .darkblue {
    border-radius: var(--radius);
    padding: 16px;
    color: #fff;
}
.list .darkblue { background: var(--primary); }

.list-text h5, .list-text h6 { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.list-text p { color: var(--muted); margin: 4px 0; }
.list-img img { border-radius: 12px; }

body .date { color: var(--muted); font-size: 12px; }
body .date i { color: var(--primary); margin-right: 4px; }

/* ---------- buttons ---------- */
html body .button,
html body .button-full,
html body .btn,
html body input[type="submit"].button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: auto;
    min-height: 42px;
    line-height: 1.2;
    padding: 10px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-family: var(--font);
    font-weight: 600;
    font-size: 14px;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .22);
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, background .2s;
}
html body .button:hover,
html body .btn:hover { background: var(--primary-600); color: #fff; box-shadow: var(--shadow-lg); }
html body .button:active,
html body .btn:active { transform: translateY(1px); }
html body .button i, html body .btn i { margin: 0; }
html body .button-full { width: 100%; }
html body .btn-sm { min-height: 34px; padding: 6px 14px; font-size: 13px; border-radius: 10px; }
html body .btn-success { background: var(--success); box-shadow: 0 4px 12px rgba(16, 185, 129, .25); }
html body .btn-success:hover { background: #059669; }
html body .btn-danger { background: var(--danger); box-shadow: 0 4px 12px rgba(239, 68, 68, .25); }
html body .btn-danger:hover { background: #dc2626; }
html body .btn-warning { background: var(--warning); }
html body .btn-info { background: var(--accent); }
html body .btn-default { background: #fff; color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; }

/* floating "Back" button present on most pages */
#slideout { left: 16px; right: auto; bottom: 18px; }
#slideout .button {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
}
#slideout .button:hover { background: var(--primary-50); color: var(--primary); }

/* ---------- forms ---------- */
/* materialize.css in this project has lost its input border/height, so
   inputs inside .input-field are rebuilt here as boxed fields with the
   label always shown above (order:-1 works whether the label comes before
   or after the input in the markup). */
body .input-field {
    display: flex;
    flex-direction: column;
    margin: 0 0 18px;
}
body .input-field > label,
body .input-field > label:not(.label-icon).active {
    order: -1;
    position: static;
    height: auto;
    transform: none;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
}
html body .input-field > input:not(.browser-default),
html body .input-field > textarea {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    font-family: var(--font);
    font-size: 14px;
    color: var(--ink);
    box-shadow: none;
}
html body .input-field > textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; }
html body .input-field > input:not(.browser-default):focus:not([readonly]),
html body .input-field > textarea:focus:not([readonly]) {
    outline: none;
    border: 1.5px solid var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
body .input-field > br { display: none; }

body select.form-control,
body select.browser-default,
body .StartDate, body .EndDate {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background-color: #fff;
    color: var(--ink);
    font-family: var(--font);
}
body textarea.form-control {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    min-height: 90px;
}

/* ---------- tables ---------- */
body table.table,
body .table-responsive table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    font-size: 13px;
}
body table.table th,
body .table-responsive table th {
    background: var(--primary-50);
    color: var(--primary-600);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 12px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
}
body table.table td,
body .table-responsive table td {
    padding: 11px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink-2);
}
body table.table tr:last-child td { border-bottom: 0; }
body table.table-striped tbody tr:nth-child(odd) { background: #fafbff; }
body .table-responsive { overflow-x: auto; border-radius: 12px; }

/* ---------- misc ---------- */
body .text-success { color: var(--success) !important; }
body .text-danger { color: var(--danger) !important; }
body img.img-circle { border-radius: 50%; }
.gallery-work .contents img { border-radius: 12px; }
.gallery-work .contents .text { padding: 10px 2px 0; }

/* empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}
.empty-state i { font-size: 40px; color: #cbd5e1; display: block; margin-bottom: 10px; }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.hero-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    margin-bottom: 22px;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 130%);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.hero-card::after {
    content: "";
    position: absolute;
    right: -40px; top: -40px;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
}
.hero-card img {
    width: 64px; height: 64px;
    border-radius: 18px;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, .45);
    flex: 0 0 auto;
}
.hero-card .hello { font-size: 13px; opacity: .85; margin: 0; }
.hero-card h2 { color: #fff; font-size: 20px; font-weight: 800; margin: 2px 0 4px; }
.hero-card .chip-light {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    font-size: 12px; font-weight: 600;
    color: #fff;
}
.hero-card .switch {
    margin-left: auto;
    position: relative; z-index: 1;
    color: #fff;
    background: rgba(255, 255, 255, .18);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 12px; font-weight: 600;
    white-space: nowrap;
}
.hero-card .switch:hover { background: rgba(255, 255, 255, .3); color: #fff; }

.section-label {
    font-size: 13px; font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 2px 12px;
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (min-width: 600px) { .tile-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
@media (min-width: 992px) { .tile-grid { grid-template-columns: repeat(6, 1fr); } }

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 18px 8px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
    text-decoration: none;
    transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .1);
    border-color: var(--primary-100);
    color: var(--ink);
}
.tile .ico {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.tile span { font-size: 12.5px; font-weight: 600; line-height: 1.25; }

.ico.c-indigo { background: #eef2ff; color: #4f46e5; }
.ico.c-rose   { background: #fff1f2; color: #e11d48; }
.ico.c-amber  { background: #fffbeb; color: #d97706; }
.ico.c-emerald{ background: #ecfdf5; color: #059669; }
.ico.c-sky    { background: #f0f9ff; color: #0284c7; }
.ico.c-violet { background: #f5f3ff; color: #7c3aed; }
.ico.c-orange { background: #fff7ed; color: #ea580c; }
.ico.c-teal   { background: #f0fdfa; color: #0d9488; }
.ico.c-pink   { background: #fdf2f8; color: #db2777; }
.ico.c-slate  { background: #f1f5f9; color: #475569; }

/* toast */
.pa-toast {
    position: fixed;
    left: 50%; bottom: 24px;
    transform: translate(-50%, 20px);
    opacity: 0;
    background: var(--ink);
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .3);
    z-index: 1000;
    transition: all .35s ease;
}
.pa-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Student picker (MainPage)
   ========================================================================== */
.picker-page { min-height: 100vh; background: var(--bg); }
.picker-page a, .auth a { text-decoration: none; }
.picker-head {
    position: relative;
    overflow: hidden;
    padding: 40px 20px 110px;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #06b6d4 140%);
    text-align: center;
}
.picker-head::before, .picker-head::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.picker-head::before { width: 320px; height: 320px; right: -90px; top: -150px; }
.picker-head::after { width: 220px; height: 220px; left: -70px; bottom: -120px; }
.picker-head .school-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: 12px; font-weight: 600;
    margin-bottom: 14px;
}
.picker-head h1 { color: #fff; font-size: 26px; font-weight: 700; margin: 0 0 6px; }
.picker-head p { margin: 0; opacity: .85; font-size: 14px; }

.picker-list {
    position: relative;
    max-width: 1000px;
    margin: -76px auto 0;
    padding: 0 16px 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.picker-list > .student-card { flex: 0 1 320px; min-width: 0; }
.student-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .10);
    overflow: hidden;
    color: var(--ink-2);
    transition: transform .2s, box-shadow .2s;
}
.student-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(79, 70, 229, .20); color: var(--ink-2); }
.student-card .cover {
    height: 76px;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .35) 0 18px, transparent 19px),
        radial-gradient(circle at 12% 90%, rgba(255, 255, 255, .25) 0 26px, transparent 27px),
        linear-gradient(120deg, #a5b4fc, #c4b5fd 55%, #a5f3fc);
}
.student-card .avatar {
    width: 92px; height: 92px;
    margin: -46px auto 0;
    border-radius: 50%;
    border: 5px solid #fff;
    background: var(--primary-50);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
    object-fit: cover;
    display: block;
}
.student-card .body { padding: 12px 20px 20px; text-align: center; }
.student-card h3 { font-size: 19px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.student-card .class-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 12.5px; font-weight: 600;
}
.student-card .facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 18px 0;
    padding: 0;
    list-style: none;
}
.student-card .facts li {
    padding: 10px 4px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
}
.student-card .facts small {
    display: block;
    font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted);
    margin-bottom: 3px;
}
.student-card .facts strong { display: block; font-size: 12px; letter-spacing: -.01em; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.student-card .facts strong.na { color: #94a3b8; font-weight: 500; font-style: italic; }
.student-card .open {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(120deg, var(--primary), #7c3aed);
    color: #fff;
    font-weight: 600; font-size: 14px;
    box-shadow: 0 8px 18px rgba(79, 70, 229, .28);
    transition: filter .2s;
}
.student-card:hover .open { filter: brightness(1.08); }
.student-card .open i { transition: transform .2s; }
.student-card:hover .open i { transform: translateX(4px); }

.picker-empty {
    flex: 1 1 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .10);
}
.picker-foot { flex: 1 1 100%; text-align: center; margin-top: 6px; }
.picker-foot a {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    color: var(--danger);
    font-weight: 600;
}
.picker-foot a:hover { background: #fef2f2; color: var(--danger); }

/* ==========================================================================
   Auth pages (Login, Forgot password, OTP, Change password, Splash)
   ========================================================================== */
.auth {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
    font-family: var(--font);
}
.auth-brand {
    display: none;
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    padding: 56px;
    color: #fff;
    background: linear-gradient(140deg, #4338ca 0%, #6d28d9 55%, #0891b2 120%);
    flex-direction: column;
    justify-content: space-between;
}
.auth-brand::before, .auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.auth-brand::before { width: 420px; height: 420px; right: -140px; top: -120px; }
.auth-brand::after { width: 300px; height: 300px; left: -100px; bottom: -110px; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand h1 { color: #fff; font-size: 38px; font-weight: 800; line-height: 1.15; margin: 0 0 14px; }
.auth-brand p { font-size: 16px; opacity: .85; max-width: 420px; margin: 0; }
.auth-brand .features { list-style: none; padding: 0; margin: 28px 0 0; }
.auth-brand .features li { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-weight: 500; }
.auth-brand .features i {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .16);
}
.auth-brand .foot { font-size: 13px; opacity: .7; }

.auth-main {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 18px;
    background:
        radial-gradient(600px 300px at 100% 0%, rgba(124, 58, 237, .10), transparent 70%),
        radial-gradient(500px 300px at 0% 100%, rgba(6, 182, 212, .10), transparent 70%),
        var(--bg);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 32px 26px 26px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}
.auth-logo {
    width: 76px; height: 76px;
    margin: 0 auto 16px;
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-50);
    color: var(--primary);
    font-size: 32px;
    overflow: hidden;
}
.auth-logo { position: relative; }
.auth-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.auth-card h2 { text-align: center; font-size: 24px; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 14px; }

.field { margin-bottom: 16px; }
.field > label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 6px;
}
.field .control { position: relative; }
.field .control > i {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
    pointer-events: none;
}
input.in,
html body input.in:not(.browser-default) {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 44px 0 42px;
    box-sizing: border-box;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    font-family: var(--font);
    font-size: 15px;
    color: var(--ink);
    box-shadow: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
input.in:focus,
html body input.in:not(.browser-default):focus:not([readonly]) {
    outline: none;
    border: 1.5px solid var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
input.in::placeholder { color: #94a3b8; }
.field .toggle-pass {
    position: absolute;
    right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}
.field .toggle-pass:hover { color: var(--primary); background: var(--primary-50); }
.field .err { display: block; color: var(--danger); font-size: 12.5px; margin-top: 6px; }

.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .captcha-code,
html body .auth input.captcha-code {
    flex: 0 0 104px;
    width: 104px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 1.5px dashed #a5b4fc;
    border-radius: 12px;
    background: repeating-linear-gradient(45deg, #eef2ff, #eef2ff 6px, #e0e7ff 6px, #e0e7ff 12px);
    color: var(--primary-600);
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    font-style: italic;
    user-select: none;
    box-shadow: none;
    cursor: default;
}
.captcha-row .control { flex: 1 1 auto; }

.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -2px 0 18px;
    font-size: 13px;
}
.auth-row a { font-weight: 600; color: var(--primary); }

.btn-auth {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(120deg, var(--primary), #7c3aed);
    color: #fff;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(79, 70, 229, .3);
    transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn-auth:hover { filter: brightness(1.06); box-shadow: 0 14px 30px rgba(79, 70, 229, .38); }
.btn-auth:active { transform: translateY(1px); }

.alert-err {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin: 0 0 16px;
    border-radius: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13.5px;
    font-weight: 500;
}
.alert-err i { margin-top: 2px; }

.auth-foot { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-foot a { font-weight: 600; color: var(--primary); }

@media (min-width: 992px) {
    .auth-brand { display: flex; }
    .auth-card { padding: 40px 36px 32px; }
}

/* splash */
.splash {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: #fff;
    text-align: center;
    background: linear-gradient(140deg, #4338ca 0%, #6d28d9 55%, #0891b2 120%);
    font-family: var(--font);
    margin: 0;
}
.splash .mark {
    width: 96px; height: 96px;
    border-radius: 28px;
    display: flex; align-items: center; justify-content: center;
    font-size: 44px;
    background: rgba(255, 255, 255, .15);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, .06);
    animation: pa-pop .6s ease-out both;
}
.splash h1 { color: #fff; font-size: 30px; font-weight: 800; margin: 0; animation: pa-up .6s .15s ease-out both; }
.splash p { margin: 0; opacity: .8; animation: pa-up .6s .25s ease-out both; }
.splash .bar {
    width: 140px; height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .2);
    overflow: hidden;
    margin-top: 10px;
}
.splash .bar span {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
    border-radius: 4px;
    animation: pa-load 2.8s ease-in-out forwards;
}
@keyframes pa-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pa-up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pa-load { to { width: 100%; } }

/* ==========================================================================
   Legacy navbar (pages that render their own header, e.g. online exam)
   ========================================================================== */
body .navbar {
    height: var(--appbar-h);
    padding: 0;
    display: flex;
    align-items: center;
    background: linear-gradient(120deg, var(--primary) 0%, #6d28d9 100%);
    box-shadow: 0 4px 20px rgba(79, 70, 229, .25);
}
body .navbar .container { width: 100%; max-width: none; padding: 0 16px; }
body .navbar .row { display: flex; align-items: center; }
body .navbar a, body .navbar i { color: #fff; }
body .navbar .content-center { text-align: left; }
body .navbar .content-center h1 { font-size: 16px; font-weight: 700; letter-spacing: 0; color: #fff; }
body .navbar .content-center h1 span { color: #fff; }
.sidebar-panel .side-nav .user-view {
    padding: 28px 20px 22px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
}
.sidebar-panel .side-nav .user-view .background { display: none; }
