/*
 * Shared look for every page (staff, public, exam hall).
 * Simple on purpose: one green brand colour, soft cards, clear type.
 */
:root {
    --brand: #0b5d3b;
    --brand-600: #0e6b45;
    --brand-light: #127a4f;
    --brand-50: #ecf6f0;
    --brand-100: #d5ece0;
    --ink: #1d2a23;
    --muted: #66766e;
    --line: #e3eae6;
    --page: #f4f7f5;
    --radius: 14px;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-link-color: var(--brand-600);
    --bs-link-color-rgb: 14, 107, 69;
    --bs-link-hover-color: var(--brand);
}

body {
    font-family: var(--bs-body-font-family);
    background: var(--page);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6,
.bg-brand h1, .bg-brand h2, .bg-brand h3, .bg-brand h4, .bg-brand h5, .bg-brand h6 { color: inherit; }
.text-muted, .text-secondary { color: var(--muted) !important; }
a { text-underline-offset: 2px; }

/* ---------- Brand ---------- */
.bg-brand { background: linear-gradient(90deg, #094d31, #0e6b45) !important; }
.text-brand { color: var(--brand) !important; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-light); border-color: var(--brand-light); color: #fff; }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px; margin-right: .5rem;
    background: rgba(255, 255, 255, .16); font-size: 1.05rem;
}
.icon-circle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 15px;
    background: var(--brand-50); color: var(--brand); font-size: 1.5rem;
}
.icon-circle.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 1.15rem; }

/* ---------- Navbar ---------- */
.navbar.bg-brand { box-shadow: 0 2px 12px rgba(9, 77, 49, .18); }
.navbar.bg-brand .navbar-brand { font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; }
.navbar.bg-brand .nav-link { color: rgba(255, 255, 255, .82); border-radius: 9px; padding: .45rem .75rem !important; margin: 0 .1rem; }
.navbar.bg-brand .nav-link:hover, .navbar.bg-brand .nav-link.active, .navbar.bg-brand .show > .nav-link { color: #fff; background: rgba(255, 255, 255, .14); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(16, 40, 28, .12); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; }
.dropdown-item:active { background: var(--brand); }

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(16, 40, 28, .04), 0 6px 18px rgba(16, 40, 28, .04);
}
.card > .table-responsive:first-child, .card > .card-header:first-child { border-top-left-radius: calc(var(--radius) - 1px); border-top-right-radius: calc(var(--radius) - 1px); }
.card > .table-responsive:last-child, .card > .card-body:last-child { border-bottom-left-radius: calc(var(--radius) - 1px); border-bottom-right-radius: calc(var(--radius) - 1px); }
.card > .table-responsive { overflow: auto; }
.card-header { background: #fff !important; border-bottom: 1px solid var(--line); padding: .85rem 1.1rem; }
.card-header:first-child { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.card.border-success { border-color: #9fd3b8 !important; box-shadow: 0 0 0 3px rgba(25, 135, 84, .07), 0 6px 18px rgba(16, 40, 28, .05); }
a > .card, a.card, button.card { transition: transform .12s ease, box-shadow .12s ease; }
a:hover > .card, a.card:hover, button.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 40, 28, .08); }

/* Number tiles */
.stat { border-left: 4px solid var(--brand) !important; }
.stat .fs-3, .stat .fs-4 { letter-spacing: -.02em; }

/* ---------- Buttons and forms ---------- */
.btn { border-radius: 10px; font-weight: 500; }
.btn-sm { border-radius: 8px; }
.btn-lg { border-radius: 12px; padding: .65rem 1.3rem; }
.btn-success { --bs-btn-bg: #12865a; --bs-btn-border-color: #12865a; --bs-btn-hover-bg: #0f7550; --bs-btn-hover-border-color: #0f7550; --bs-btn-active-bg: #0b5d3b; --bs-btn-disabled-bg: #12865a; --bs-btn-disabled-border-color: #12865a; }
.btn-outline-success { --bs-btn-color: #12865a; --bs-btn-border-color: #9fd3b8; --bs-btn-hover-bg: #12865a; --bs-btn-hover-border-color: #12865a; }
.btn-outline-secondary { --bs-btn-color: #3f4d46; --bs-btn-border-color: #cfd9d4; --bs-btn-hover-bg: #f0f4f2; --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #b9c6bf; }
.form-control, .form-select { border-radius: 10px; border-color: #d4dfd9; }
.form-control-lg, .form-select-lg { border-radius: 12px; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #5fae8a; box-shadow: 0 0 0 .2rem rgba(11, 93, 59, .14); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 500; font-size: .92rem; }
.text-uppercase::placeholder { text-transform: none; }
.input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ---------- Tables ---------- */
.table { --bs-table-border-color: #edf1ef; margin-bottom: 0; }
.table > thead > tr > th {
    background: #f7faf8; color: var(--muted); font-size: .74rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line);
    padding-top: .7rem; padding-bottom: .7rem; white-space: nowrap;
}
.table > :not(caption) > * > * { padding-left: .9rem; padding-right: .9rem; }
.table td, .table th { vertical-align: middle; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f5faf7; }

/* ---------- Badges, alerts, modals ---------- */
.badge { font-weight: 600; border-radius: 999px; padding: .4em .72em; letter-spacing: .01em; }
.alert { border-radius: 12px; border: 1px solid transparent; }
.alert-success { background: #eaf6ef; border-color: #c6e6d4; color: #0f5132; }
.alert-danger { background: #fdeeee; border-color: #f5c9cc; }
.alert-warning { background: #fff7e6; border-color: #f6dfa8; }
.alert-info { background: #ebf5fb; border-color: #c4e2f2; }
.modal-content { border: 0; border-radius: 16px; box-shadow: 0 20px 50px rgba(16, 40, 28, .2); }
.list-group-item { border-color: #edf1ef; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h3 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: .92rem; margin-top: .15rem; }

/* ---------- Public pages ---------- */
.hero {
    background: linear-gradient(180deg, #ddf0e5 0%, rgba(244, 247, 245, 0) 100%);
    border-radius: 24px;
    padding: 2.75rem 1rem 1.75rem;
    margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }
.hero .lead { color: var(--muted); font-size: 1.08rem; }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--brand); font-size: .82rem; font-weight: 600; }
.how-step { display: flex; gap: .75rem; align-items: flex-start; }
.how-step .n { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.auth-card { max-width: 460px; margin: 0 auto; }
.site-footer { color: var(--muted); font-size: .85rem; }

/* ---------- Sign-in pages (staff + student) ---------- */
.auth-page { min-height: calc(100vh - 130px); display: flex; align-items: center; padding: 2.5rem 0; background: radial-gradient(800px 380px at 0% 0%, #dff1e7, transparent 60%), radial-gradient(700px 360px at 100% 100%, #e6eef9, transparent 60%); }
.auth-shell { display: grid; grid-template-columns: 1fr 1.05fr; max-width: 920px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px rgba(16, 40, 28, .12); }
.auth-side { position: relative; color: #fff; padding: 2.5rem 2.25rem; background: linear-gradient(150deg, #073d27, #0b5d3b 60%, #128052); display: flex; flex-direction: column; overflow: hidden; }
.auth-side.staff { background: linear-gradient(150deg, #14213d, #1f3a68 60%, #2b5c8f); }
.auth-side::after { content: ""; position: absolute; width: 320px; height: 320px; right: -110px; bottom: -110px; border-radius: 50%; border: 48px solid rgba(255, 255, 255, .06); }
.auth-side h2 { color: #fff; font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.auth-side p { color: rgba(255, 255, 255, .78); }
.auth-side .mark { width: 46px; height: 46px; border-radius: 13px; background: rgba(255, 255, 255, .14); display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; margin-bottom: 1.5rem; }
.auth-points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .85rem; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: .75rem; align-items: flex-start; font-size: .92rem; color: rgba(255, 255, 255, .88); }
.auth-points i { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .13); display: inline-flex; align-items: center; justify-content: center; }
.auth-side .foot { margin-top: auto; padding-top: 2rem; font-size: .8rem; color: rgba(255, 255, 255, .6); position: relative; z-index: 1; }
.auth-form { padding: 2.5rem 2.5rem 2.25rem; }
.auth-form h3 { font-size: 1.45rem; font-weight: 800; }
.auth-form .input-group-text { background: #f6f9f7; border-color: #d4dfd9; color: var(--muted); border-radius: 12px 0 0 12px; padding: 0 .95rem; }
.auth-form .input-group .form-control { border-left: 0; }
.auth-form .input-group .form-control:focus { box-shadow: none; }
.auth-form .input-group:focus-within .input-group-text, .auth-form .input-group:focus-within .form-control, .auth-form .input-group:focus-within .btn-eye { border-color: #5fae8a; }
.auth-form .input-group:focus-within { box-shadow: 0 0 0 .2rem rgba(11, 93, 59, .14); border-radius: 12px; }
.auth-form .btn-eye { border: 1px solid #d4dfd9; border-left: 0; background: #fff; color: var(--muted); border-radius: 0 12px 12px 0 !important; }
.auth-form .input-group.has-eye .form-control { border-right: 0; }
.auth-form .is-invalid ~ .invalid-feedback, .auth-form .invalid-feedback.d-block { font-size: .84rem; }
.auth-form .input-group.invalid .input-group-text, .auth-form .input-group.invalid .form-control, .auth-form .input-group.invalid .btn-eye { border-color: #dc3545; }
.auth-switch { border-top: 1px solid var(--line); margin-top: 1.75rem; padding-top: 1.1rem; font-size: .88rem; color: var(--muted); text-align: center; }
@media (max-width: 767.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-side { padding: 1.75rem 1.5rem; }
    .auth-side .auth-points, .auth-side .foot { display: none; }
    .auth-side .mark { margin-bottom: .9rem; }
    .auth-form { padding: 1.75rem 1.5rem; }
}

/* ---------- Upload box (admin.partials.file-drop) ---------- */
.file-drop { position: relative; display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; margin: 0; border: 1.5px dashed #c9d8d0; border-radius: 12px; background: #fafcfb; cursor: pointer; transition: border-color .12s ease, background .12s ease; min-height: 64px; }
.file-drop:hover, .file-drop.drag { border-color: var(--brand-light); background: var(--brand-50); }
.file-drop.has-file { border-style: solid; border-color: #9fd3b8; background: #f1f9f4; }
.file-drop.is-invalid { border-color: #dc3545; background: #fff7f7; }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-drop .fd-icon { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.file-drop.has-file .fd-icon { background: var(--brand); color: #fff; border-color: var(--brand); }
.file-drop .fd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.file-drop .fd-title { font-weight: 600; font-size: .9rem; }
.file-drop .fd-opt { font-weight: 500; font-size: .7rem; color: var(--muted); background: #eef2f0; border-radius: 999px; padding: .05rem .45rem; margin-left: .25rem; }
.file-drop .fd-name { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-drop.has-file .fd-name { color: var(--brand); font-weight: 500; }
.file-drop .fd-btn { flex: 0 0 auto; font-size: .8rem; font-weight: 600; color: var(--brand); padding: .3rem .7rem; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
