/* =============================================================
   SNPD SIM EXAM — OFFICIAL RP PORTAL STYLESHEET
   Organized sections: tokens, layout, forms, exam, results, admin
   ============================================================= */

/* 01. DESIGN TOKENS AND RESETS */
:root {
    color-scheme: dark;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    --bg: #08111e;
    --bg-deep: #060c16;
    --surface: #101d2e;
    --surface-alt: #15243a;
    --surface-hover: #1b2c44;
    --stroke: #263650;
    --stroke-soft: #1c2b40;
    --text: #ecf2fb;
    --muted: #98a9c0;
    --primary: #3977bf;
    --primary-light: #76b6ff;
    --gold: #d8af70;
    --good: #5bd1a4;
    --bad: #ff8494;
    --radius: 15px;
    --shadow: 0 20px 60px rgb(0 0 0 / 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(180deg, rgb(5 12 23 / 0.83), rgb(5 12 23 / 0.93) 62%, #060c16 100%),
        url('/ujian-sim/assets/images/bg.webp') center top / cover fixed no-repeat,
        var(--bg);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: #356ba9; color: white; }
:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 3px; }

/* 02. SHARED SITE CHROME */
.site-shell { display: flex; min-height: 100vh; flex-direction: column; }
.site-header { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 15px max(28px, calc((100vw - 1160px) / 2)); border-bottom: 1px solid var(--stroke-soft); background: rgb(8 17 30 / 0.86); }
.brand { display: inline-flex; gap: 13px; align-items: center; min-width: 0; }
.brand[href]:hover .brand-copy strong { color: var(--gold); }
.brand-logo { width: 54px; height: 54px; object-fit: contain; flex-shrink: 0; }
.brand-copy { display: flex; gap: 3px; flex-direction: column; letter-spacing: 0.14em; }
.brand-copy strong { font-size: 13px; font-weight: 800; white-space: nowrap; }
.brand-copy small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.top-nav { display: flex; align-items: center; gap: 28px; }
.top-nav a, .exam-header-tag { color: #a3b4ce; font-size: 11px; font-weight: 750; letter-spacing: 0.14em; white-space: nowrap; }
.top-nav a:hover, .top-nav a.active { color: var(--gold); }
.exam-header-tag { border: 1px solid var(--stroke); border-radius: 50px; padding: 11px 16px; }
.page-container { width: min(100% - 48px, 1100px); margin: 0 auto; }
.page-pad { padding-top: 46px; padding-bottom: 76px; flex: 1; }
.site-footer { display: flex; justify-content: space-between; gap: 18px; padding: 23px max(28px, calc((100vw - 1160px) / 2)); border-top: 1px solid var(--stroke-soft); color: #6d819d; font-size: 10px; letter-spacing: 0.12em; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--gold); letter-spacing: 0.15em; font-size: 10px; font-weight: 800; }
.pulse-dot { width: 7px; height: 7px; border-radius: 100%; background: var(--good); box-shadow: 0 0 13px rgb(91 209 164 / 0.5); }
.overline { display: block; color: var(--gold); font-size: 10px; letter-spacing: 0.19em; font-weight: 750; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(29px, 4vw, 44px); line-height: 1.16; letter-spacing: -0.035em; }
h2 { font-size: 20px; letter-spacing: -0.02em; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }

/* 03. INTRODUCTION AND CARDS */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 32px; }
.compact-hero { margin: 32px 0 28px; }
.hero h1 { margin: 12px 0 13px; }
.hero h1 span { color: var(--gold); }
.hero p { max-width: 635px; margin: 0; line-height: 1.75; color: var(--muted); font-size: 15px; }
.hero-emblem { width: 118px; height: 118px; border: 2px solid rgb(216 175 112 / 0.35); border-radius: 50%; box-shadow: inset 0 0 0 9px rgb(216 175 112 / 0.04); display: grid; place-content: center; text-align: center; flex: 0 0 auto; }
.hero-emblem span { color: var(--gold); font-size: 13px; letter-spacing: 0.33em; }
.hero-emblem strong { font-size: 43px; line-height: 0.98; color: var(--gold); font-weight: 700; }
.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--stroke); border-radius: var(--radius); background: #0c1929; margin: 24px 0 26px; overflow: hidden; }
.stats-strip > div { padding: 24px; display: grid; gap: 4px; text-align: center; }
.stats-strip > div + div { border-left: 1px solid var(--stroke); }
.stat-value { font-size: 30px; font-weight: 780; letter-spacing: -0.03em; color: var(--text); }
.stat-unit { color: var(--gold); font-size: 18px; }
.stat-label { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr); gap: 22px; align-items: start; }
.info-column { display: grid; gap: 16px; }
.panel { position: relative; padding: 28px; border: 1px solid var(--stroke); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface) 0%, #0d192a 100%); box-shadow: var(--shadow); min-width: 0; }
.panel-muted { background: #0d1929; }
.panel-topline { position: absolute; top: -1px; left: 24px; width: 75px; height: 2px; background: var(--gold); }
.panel-heading { display: flex; gap: 13px; align-items: center; margin-bottom: 12px; }
.panel-heading h2 { margin: 5px 0 0; }
.panel-heading.smaller h2 { margin: 0; font-size: 18px; }
.icon-box { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border: 1px solid #3a6091; border-radius: 11px; background: #16304f; font-size: 14px; color: var(--primary-light); font-weight: 800; }
.icon-box.gold { border-color: #6e5738; color: var(--gold); background: #30271e; font-family: Georgia, serif; font-size: 22px; }
.panel > p.muted { line-height: 1.65; font-size: 13px; }
.rules-list { margin: 14px 0 0; padding-left: 20px; }
.rules-list li { margin: 0 0 15px; color: #b5c4d8; line-height: 1.6; font-size: 13px; padding-left: 3px; }
.rules-list li::marker { color: var(--gold); font-weight: 800; }
.notice-card { padding: 18px 20px; border: 1px solid #53462f; border-radius: 12px; background: rgb(121 93 48 / 0.11); }
.notice-card strong { color: var(--gold); font-size: 11px; letter-spacing: 0.12em; }
.notice-card p { margin: 7px 0 0; color: #b7b9b9; line-height: 1.65; font-size: 12px; }

/* 04. FORM ELEMENTS */
.form-stack { display: grid; gap: 19px; margin-top: 24px; }
.field { display: grid; gap: 9px; }
.field label, .field-label { color: #e0e8f4; font-size: 12px; font-weight: 700; }
.field small { color: #8c9db6; font-size: 11px; line-height: 1.6; }
.required { color: #e5a1a1; }
input:not([type="radio"]):not([type="checkbox"]), select, textarea { width: 100%; min-height: 46px; padding: 12px 14px; border: 1px solid #2c405b; border-radius: 9px; outline: none; color: var(--text); background: #0b1626; transition: border-color 0.15s, background 0.15s; }
input:focus, select:focus, textarea:focus { border-color: #568dd0 !important; background: #0e1c2f !important; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #677b94; }
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-option { min-height: 48px; padding: 10px 13px; display: flex; align-items: center; gap: 9px; border-radius: 9px; border: 1px solid #2c405b; background: #0b1626; font-size: 13px; color: #c9d5e5; cursor: pointer; }
.radio-option:has(input:checked) { border-color: #5388c6; background: #122c49; }
input[type="radio"], input[type="checkbox"] { accent-color: #538bd0; }
.consent { display: flex; align-items: flex-start; gap: 11px; color: #aebed1; line-height: 1.5; font-size: 12px; cursor: pointer; }
.consent input { flex-shrink: 0; margin-top: 2px; width: 16px; height: 16px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 45px; padding: 11px 17px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; letter-spacing: 0.07em; font-weight: 800; text-align: center; transition: transform 0.15s, background 0.15s, border-color 0.15s; white-space: nowrap; }
.button:disabled { cursor: not-allowed; opacity: 0.5; }
.button:not(:disabled):hover { transform: translateY(-1px); }
.button-primary { background: linear-gradient(110deg, #2e5f99, #3679c4); color: white; border-color: #4c86c2; }
.button-outline { background: transparent; border-color: #37506c; color: #bed2e9; }
.button-outline:hover { border-color: var(--primary-light); }
.button-gold { background: #b9955c; border-color: #dbb875; color: #08111d; }
.button-block { width: 100%; }
.button-small { min-height: 38px; padding: 9px 13px; }
.alert { margin: 0; padding: 12px 15px; border-radius: 9px; border: 1px solid #8c4554; background: #3d1d2a; color: #ffbdc8; font-size: 13px; line-height: 1.5; }
.alert.success { border-color: #346957; background: #153e34; color: #96e9cc; }

/* 05. EXAM FLOW */
.exam-topbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 28px 0 20px; }
.exam-topbar h1 { margin: 0 0 8px; }
.exam-topbar p { margin: 0; font-size: 13px; }
.timer { min-width: 130px; padding: 16px 21px; color: #b0d5ff; border: 1px solid #315c84; border-radius: 13px; background: #12304d; text-align: center; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.timer.urgent { color: #ffc0c5; border-color: #974455; background: #3d1c2c; }
.progress-track { width: 100%; height: 8px; border-radius: 30px; background: #1d2b40; overflow: hidden; }
.progress-fill { width: 0; height: 100%; background: linear-gradient(90deg, #356bad, #69b5ec); transition: width 0.25s; }
.progress-copy { font-size: 12px; margin: 10px 0 22px; }
.loading-state { display: flex; gap: 12px; align-items: center; justify-content: center; min-height: 175px; color: var(--muted); }
.spinner { display: inline-block; width: 21px; height: 21px; border: 3px solid #35506c; border-top-color: #75a8e8; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 275px; align-items: start; gap: 20px; }
.question-panel { min-height: 500px; }
.question-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.tag { display: inline-block; padding: 7px 11px; border: 1px solid #385677; border-radius: 6px; background: #16314f; color: #a9d4ff; font-size: 10px; font-weight: 800; letter-spacing: 0.07em; }
.question-head > .muted { font-size: 11px; letter-spacing: 0.08em; }
.question-title { margin: 28px 0 25px; font-size: 22px; line-height: 1.5; font-weight: 750; }
.question-image { display: block; max-height: 200px; margin: 0 auto 22px; border-radius: 10px; }
.answer-options { display: grid; gap: 11px; }
.answer-option { display: flex; align-items: center; gap: 14px; text-align: left; padding: 15px; min-height: 64px; border: 1px solid #30445f; border-radius: 10px; background: #0a182a; color: #d0ddef; font-size: 13px; line-height: 1.45; }
.answer-option:hover { border-color: #558bd0; }
.answer-option.selected { border-color: #6baddd; background: #133354; }
.option-letter { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border: 1px solid #36516f; border-radius: 7px; color: #aec5df; font-size: 12px; font-weight: 850; }
.answer-option.selected .option-letter { border-color: #70b9fb; background: #316fae; color: white; }
.save-state { margin-top: 14px; min-height: 20px; color: var(--good); font-size: 11px; }
.save-state.error { color: var(--bad); }
.question-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 21px; border-top: 1px solid var(--stroke-soft); }
.exam-side h3 { margin-bottom: 5px; }
.exam-side > .muted { font-size: 12px; line-height: 1.6; }
.question-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 22px 0; }
.number-button { aspect-ratio: 1; min-width: 0; border: 1px solid #344763; border-radius: 7px; background: #0b1728; color: #c5d2e5; font-size: 12px; font-weight: 800; }
.number-button.answered { border-color: #3e917b; background: #173c38; color: #9be8ce; }
.number-button.current { box-shadow: 0 0 0 2px #679bcf; }
.legend { display: flex; gap: 16px; align-items: center; margin: 0 0 28px; color: #9aacc3; font-size: 10px; }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; border: 1px solid #61738a; }
.legend-dot.done { background: #397f6d; border-color: #397f6d; }
.exam-side .tiny { margin: 10px 0 0; text-align: center; line-height: 1.5; }

/* 06. RESULT PAGE */
.result-page { display: flex; align-items: center; justify-content: center; }
.result-panel { width: min(100%, 710px); text-align: center; padding: 38px 45px; }
.result-panel h1 { margin: 10px 0 10px; font-size: 29px; }
.result-panel > p { font-size: 13px; }
.result-symbol { margin: 2px auto 20px; width: 60px; height: 60px; line-height: 60px; border: 1px solid #479d81; border-radius: 50%; background: #173e35; color: var(--good); font-size: 32px; }
.result-symbol.failed { color: var(--bad); border-color: #9b4b5c; background: #391c2a; }
.score-ring { display: flex; justify-content: center; flex-direction: column; width: 186px; height: 186px; margin: 30px auto 17px; border: 7px solid #3f8b77; border-radius: 50%; box-shadow: 0 0 30px rgb(57 128 109 / 0.1); }
.score-ring.failed { border-color: #b65b6c; }
.score-ring strong { font-size: 51px; letter-spacing: -0.06em; }
.score-ring small { color: var(--muted); font-size: 11px; letter-spacing: 0.14em; }
.result-badge { display: inline-block; padding: 8px 20px; border: 1px solid #418c72; border-radius: 50px; background: #173c34; color: #90e6c5; font-size: 12px; font-weight: 900; letter-spacing: 0.12em; }
.result-badge.failed { color: #ffb0bc; background: #3b1e2b; border-color: #9d5260; }
.result-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; padding: 1px; margin: 28px 0 23px; border: 1px solid var(--stroke); background: var(--stroke); border-radius: 11px; overflow: hidden; text-align: left; }
.result-meta > div { display: grid; gap: 8px; padding: 17px; background: #0d192a; }
.result-meta small { font-size: 10px; color: var(--muted); letter-spacing: 0.09em; }
.result-meta strong { font-size: 14px; overflow-wrap: anywhere; }
.result-panel .notice-card { text-align: left; }
.result-actions { display: flex; justify-content: center; gap: 12px; margin-top: 26px; }

/* 07. ADMIN INTERFACE */
.login-layout { display: flex; justify-content: center; align-items: center; padding: 45px 0 15px; }
.login-panel { width: min(100%, 445px); padding: 35px; }
.login-panel h1 { font-size: 29px; margin: 13px 0 10px; }
.login-panel > p { font-size: 13px; line-height: 1.6; }
.login-panel .tiny { margin: 23px 0 0; text-align: center; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 25px 0 30px; }
.dashboard-heading h1 { font-size: 32px; margin: 9px 0; }
.dashboard-heading p { margin: 0; font-size: 13px; }
.admin-person { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 21px; padding-bottom: 10px; border-bottom: 1px solid var(--stroke); }
.tab { padding: 12px 16px; color: #a7b6cb; border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: 11px; letter-spacing: 0.05em; font-weight: 800; white-space: nowrap; }
.tab:hover { color: #e6f1fc; }
.tab.active { color: #e5f1ff; border-color: #38618a; background: #17324f; }
.tab-panel { display: grid; gap: 20px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.metric { display: grid; gap: 9px; padding: 21px; }
.metric small { color: var(--muted); font-size: 10px; letter-spacing: 0.1em; }
.metric strong { font-size: 31px; line-height: 1; }
.metric > span { font-size: 11px; color: #778fae; }
.panel-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-toolbar h2 { margin: 0; }
.panel-toolbar p { font-size: 12px; margin: 6px 0 0; }
.toolbar-filters { display: flex; align-items: center; gap: 9px; margin: 20px 0; }
.toolbar-filters input { flex: 1; min-width: 0; }
.toolbar-filters select { width: 185px; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.data-table th { padding: 14px 13px; border-bottom: 1px solid #38506d; color: #95a8c2; font-size: 10px; text-align: left; letter-spacing: 0.08em; font-weight: 800; white-space: nowrap; }
.data-table td { padding: 15px 13px; border-bottom: 1px solid var(--stroke-soft); color: #c4d0e0; vertical-align: middle; }
.data-table td:first-child { color: var(--text); }
.data-table tr:hover td { background: rgb(97 144 191 / 0.06); }
.data-table .actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.data-table .mini-button { min-height: 30px; padding: 5px 8px; border: 1px solid #425c79; border-radius: 6px; color: #c8deef; background: #17283e; font-size: 10px; font-weight: 750; }
.data-table .mini-button.danger { color: #ffacbb; border-color: #7c4051; background: #321b28; }
.data-table .mini-button.success { color: #9fecc9; border-color: #396f5e; background: #16372d; }
.table-empty { padding: 25px; color: #8b9db4; font-size: 13px; text-align: center; }
.status { display: inline-block; padding: 5px 8px; border: 1px solid #385b7e; border-radius: 50px; color: #a5c7ef; background: #152c48; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status.good { border-color: #386b59; background: #163a31; color: #9fe9c7; }
.status.bad { border-color: #884957; background: #381d2a; color: #ffb1bb; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 20px; color: var(--muted); font-size: 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-panel { max-width: 760px; }
.detail-dialog { width: min(100% - 32px, 770px); max-height: 85vh; padding: 26px; overflow-y: auto; border: 1px solid #375678; border-radius: 16px; color: var(--text); background: #101e30; box-shadow: 0 30px 90px #000a; }
.detail-dialog::backdrop { background: rgb(1 7 14 / 0.8); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.dialog-header h2 { margin: 0 0 14px; }
.detail-answer { padding: 13px 0; border-bottom: 1px solid var(--stroke); font-size: 12px; line-height: 1.6; }
.detail-answer b { color: var(--gold); }
.detail-answer p { margin: 4px 0; }
.detail-answer .correct { color: var(--good); }
.detail-answer .incorrect { color: var(--bad); }

/* 08. RESPONSIVE AND PRINT */
@media (max-width: 920px) {
    .site-header { padding-inline: 24px; }
    .site-footer { padding-inline: 24px; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr 0.82fr; }
    .exam-layout { grid-template-columns: 1fr 235px; }
    .question-grid { gap: 5px; }
}
@media (max-width: 720px) {
    .site-header { min-height: 70px; padding: 12px 16px; }
    .brand-logo { width: 43px; height: 43px; }
    .brand-copy strong { font-size: 10px; }
    .brand-copy small { font-size: 7px; }
    .top-nav { gap: 12px; }
    .top-nav a, .exam-header-tag { font-size: 9px; }
    .exam-header-tag { padding: 8px; }
    .page-container { width: min(100% - 28px, 560px); }
    .page-pad { padding-top: 30px; padding-bottom: 50px; }
    .hero-emblem { display: none; }
    .content-grid, .exam-layout { grid-template-columns: 1fr; }
    .stats-strip > div { padding: 16px 5px; }
    .stat-value { font-size: 24px; }
    .stat-label { font-size: 9px; }
    .panel { padding: 22px; }
    .question-panel { min-height: 0; }
    .question-title { font-size: 19px; }
    .exam-topbar h1 { font-size: 24px; }
    .timer { min-width: 100px; padding: 10px; font-size: 23px; }
    .exam-side { order: -1; }
    .question-grid { grid-template-columns: repeat(15, minmax(31px, 1fr)); overflow-x: auto; }
    .number-button { min-height: 32px; }
    .legend { margin-bottom: 16px; }
    .exam-side .tiny { display: none; }
    .dashboard-heading { display: block; }
    .dashboard-heading h1 { font-size: 26px; }
    .admin-person { margin-top: 18px; flex-wrap: wrap; }
    .toolbar-filters { flex-wrap: wrap; }
    .toolbar-filters select { flex: 1; }
    .site-footer { justify-content: center; align-items: center; flex-wrap: wrap; text-align: center; padding: 20px; font-size: 9px; }
    .result-panel { padding: 24px 16px; }
    .result-panel h1 { font-size: 25px; }
    .result-actions { flex-wrap: wrap; }
}
@media (max-width: 400px) {
    .question-actions { flex-wrap: wrap; }
    .question-actions .button { flex: 1; }
    .result-meta { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; }
    .score-ring { width: 156px; height: 156px; }
}
@media print {
    body { background: #fff; color: #111; }
    .site-header, .site-footer, .result-actions, .notice-card { display: none !important; }
    .result-panel { box-shadow: none; border: none; color: #111; }
    .result-panel .muted, .result-meta small { color: #333; }
    .result-meta > div { background: #fff; color: #111; }
    .score-ring strong { color: #111; }
}
