/*
 * Gaya bersama halaman siswa, pendaftaran, dan staf.
 *
 * Dikonsolidasi dari blok <style> yang sebelumnya tertanam di tiap Blade:
 *   layouts/prototype.blade.php   -> token + reset
 *   student/register/notice.blade.php
 *   student/register/school.blade.php
 *   student/sessions.blade.php
 *   student/login.blade.php
 *   auth/login.blade.php
 *
 * Layar ujian TIDAK memakai berkas ini — ia punya exam.css sendiri, karena
 * halaman ujian harus sekecil mungkin dan tidak boleh memuat apa pun yang
 * mengganggu pengukuran fokus/viewport.
 *
 * Tailwind sengaja tidak dipakai: versi Laravel pun tidak memakainya di halaman
 * mana pun (hanya welcome.blade.php yang sudah mati), dan menambah langkah
 * build untuk aplikasi Workers ini tidak sepadan.
 */

:root {
    --red: #dc2626;
    --blue: #1d4ed8;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #1d4ed8;
    --primary-soft: #eff6ff;
    --primary-border: #bfdbfe;
    --text-muted: #6b7280;
    --border-line: #e5e7eb;
    --green: #166534;
    --amber: #92400e;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: #f9fafb;
    font-size: 15px;
    line-height: 1.5;
}

button { cursor: pointer; font-family: inherit; }
a { color: var(--blue); }

/* ── Tata letak dasar ─────────────────────────────────────────────────────── */

.wrap { max-width: 720px; margin: 32px auto; padding: 0 20px; }

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 26px;
    margin-bottom: 12px;
}

h1 { font-size: 20px; margin: 0 0 6px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.empty {
    padding: 26px;
    text-align: center;
    color: var(--muted);
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: 12px;
    line-height: 1.6;
    font-size: 14px;
}

.note { color: var(--muted); font-size: 12px; margin-top: 16px; line-height: 1.5; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ── Formulir ─────────────────────────────────────────────────────────────── */

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
label:first-child { margin-top: 0; }

input[type=text],
input[type=email],
input[type=password],
input[type=number],
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
}

input:focus, select:focus {
    outline: 2px solid var(--primary-border);
    border-color: var(--blue);
}

label.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 14px;
    margin-top: 14px;
}

label.remember input { width: auto; }

.primary {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: var(--blue);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
}

.primary:disabled { background: #cbd5e1; color: #64748b; cursor: not-allowed; }

.error { color: var(--red); font-size: 13px; margin-top: 6px; }

/* ── Pesan hasil redirect ────────────────────────────────────────────────── */

.flash {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-info { background: var(--primary-soft); color: #1e40af; border: 1px solid var(--primary-border); }

/* Di dalam .wrap, flash ikut berjarak seperti elemen lain. */
.wrap > .flash { margin-bottom: 16px; }

/* ── Pendaftaran ─────────────────────────────────────────────────────────── */

.warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
    font-size: 13.5px;
    line-height: 1.6;
}

.cand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.cand .who { font-size: 14px; font-weight: 700; }
.cand .meta { font-size: 12px; color: var(--muted); }
.cand form { margin: 0; }
.cand button {
    padding: 8px 14px;
    border-radius: 8px;
    border: 0;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.new-btn {
    width: 100%;
    margin-top: 12px;
    padding: 11px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
}

/* ── Modal ───────────────────────────────────────────────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}
.modal.show { display: flex; }
.modal .box {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    max-width: 420px;
    width: 100%;
    text-align: left;
}
.modal h3 { margin: 0 0 10px; font-size: 17px; }
.modal p { margin: 0 0 16px; font-size: 14px; color: #374151; line-height: 1.6; }
.modal .actions { display: flex; gap: 10px; }
.modal .actions button {
    flex: 1;
    padding: 11px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    border: 0;
}
.btn-cancel { background: #f1f5f9; color: #334155; border: 1px solid var(--line) !important; }
.btn-confirm { background: var(--red); color: #fff; }
.btn-confirm:disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }

.modal .confirm-label { display: block; text-align: left; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.modal input[type=text] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    margin-bottom: 18px;
}

/* ── Daftar sesi siswa ───────────────────────────────────────────────────── */

header.bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 20px;
}
header.bar .who { font-size: 14px; }
header.bar .who strong { font-size: 15px; }
header.bar .who span { color: var(--muted); }

.exam-banner {
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 12px;
    margin-bottom: 20px;
}
.exam-banner .name { font-size: 16px; font-weight: 700; }
.exam-banner .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }

.card.session {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
}
.card.session .info { flex: 1; }
.card.session .subject { font-size: 15px; font-weight: 700; }
.card.session .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card.session form { margin: 0; }
.card.session button {
    padding: 10px 20px;
    background: var(--blue);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.card.session button:disabled { background: #cbd5e1; color: #64748b; cursor: not-allowed; }

.badge {
    display: inline-block;
    margin-top: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: var(--amber);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-done { background: #dcfce7; color: var(--green); }
.badge-upcoming { background: #f69e2c; color: #faf9f8; }

.footer { margin-top: 28px; }
.footer .logout-link {
    background: none;
    border: 0;
    color: red;
    font-size: 13px;
    text-decoration: underline;
    padding: 8px 12px;
}

/* ── Staf / dashboard ────────────────────────────────────────────────────── */

body.staff { background: #f3f4f6; }

.staff-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 22px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.staff-bar .brand { color: #000666; font-size: 16px; }
.staff-bar .who { font-size: 14px; }
.staff-bar .role {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: #1e40af;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: capitalize;
}
.staff-bar form { margin: 0; }

.btn-ghost {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.btn-small {
    display: inline-block;
    background: var(--blue);
    border: 0;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.staff-main { max-width: 1080px; margin: 0 auto; padding: 24px 22px 60px; }
.staff-main > .flash { margin-bottom: 16px; }

.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 20px; margin: 0 0 4px; }
.page-head .sub { margin: 0; }

/* ── Tabel ───────────────────────────────────────────────────────────────── */

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}
.table th, .table td {
    padding: 11px 14px;
    text-align: left;
    font-size: 13.5px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.table th {
    background: #f9fafb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table td form { margin: 0; }
.row-locked { background: #fef2f2; }
.count-warn { color: var(--red); }
.reason { max-width: 240px; font-size: 12.5px; }

.pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: #fef3c7;
    color: var(--amber);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.pill-belum { background: #f1f5f9; color: #475569; }
.pill-sedang { background: var(--primary-soft); color: #1e40af; }
.pill-selesai { background: #dcfce7; color: var(--green); }
.pill-locked { background: #fee2e2; color: #991b1b; margin-left: 6px; }
.pill-pending { background: #fef3c7; color: var(--amber); margin-left: 6px; }

/* ── Pemantauan ──────────────────────────────────────────────────────────── */

.monitor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
    align-items: start;
}
.monitor-main .card { padding: 18px; }

.totp-card {
    background: #000666;
    color: #fff;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}
.totp-label { font-size: 12px; opacity: .8; }
.totp-code {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 6px;
    margin: 8px 0 4px;
    font-variant-numeric: tabular-nums;
}
.totp-meta { font-size: 12px; opacity: .8; }

@media (max-width: 860px) {
    .monitor-grid { grid-template-columns: 1fr; }
}
