/* ==========================================================================
   Tes Kepribadian — sistem desain (CSS kustom, tanpa framework/font eksternal)
   Mobile-first · breakpoint 600px & 1024px · mode gelap via prefers-color-scheme
   ========================================================================== */

/* ---------- 1. Token ---------- */
:root {
    color-scheme: light;

    /* Permukaan */
    --bg: #f5f6fb;
    --bg-accent: #eef0fe;
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --surface-3: #eef0f6;
    --border: #e3e6ef;
    --border-strong: #cdd2df;

    /* Teks */
    --text: #151a2d;
    --text-2: #4a5168;
    --text-3: #5b6275;

    /* Merek (indigo) */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: #eef0ff;
    --primary-soft-2: #e0e3ff;
    --primary-text: #3730a3;
    --on-primary: #ffffff;

    /* Status */
    --success: #0b7350;
    --success-soft: #e6f6ef;
    --warning: #9a5b00;
    --warning-soft: #fff4dc;
    --danger: #d23b3b;
    --danger-hover: #b52f2f;
    --danger-solid: #c53030;
    --danger-soft: #fdeceb;
    --info: #2563eb;
    --info-soft: #e8f0fe;
    --focus: #8b85ff;

    /* Warna tipe (hanya hasil/analisis — jangan di halaman soal) */
    --type-s: #e8a317;
    --type-k: #d64545;
    --type-m: #3b6fd4;
    --type-p: #2f9e6b;

    /* Tipografi */
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.375rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.25rem;

    /* Ruang, bentuk, bayangan */
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 20px;
    --s6: 24px;
    --s8: 32px;
    --s10: 40px;
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-full: 999px;
    --sh-1: 0 1px 2px rgba(17, 24, 56, 0.06);
    --sh-2: 0 1px 2px rgba(17, 24, 56, 0.05), 0 4px 12px rgba(17, 24, 56, 0.06);
    --sh-3: 0 2px 4px rgba(17, 24, 56, 0.06), 0 16px 40px rgba(17, 24, 56, 0.12);
    --ring: 0 0 0 4px rgba(79, 70, 229, 0.18);

    --tap: 44px;
    --sidebar-w: 256px;
    --topbar-h: 60px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0d1020;
        --bg-accent: #15193a;
        --surface: #151a2e;
        --surface-2: #1a2036;
        --surface-3: #222942;
        --border: #2a3150;
        --border-strong: #3a4266;
        --text: #eef0fa;
        --text-2: #b7bdd6;
        --text-3: #8890ad;
        --primary: #7c74ff;
        --primary-hover: #948dff;
        --primary-soft: #23264d;
        --primary-soft-2: #2d3163;
        --primary-text: #c7c3ff;
        --on-primary: #0d1020;
        --success: #3ccf91;
        --success-soft: #133328;
        --warning: #f2b54a;
        --warning-soft: #3a2c12;
        --danger: #ff6b6b;
        --danger-hover: #ff8585;
        --danger-solid: #c53030;
        --danger-soft: #3d1a1d;
        --info: #6aa1ff;
        --info-soft: #172846;
        --focus: #a7a1ff;
        --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
        --sh-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px rgba(0, 0, 0, 0.3);
        --sh-3: 0 2px 4px rgba(0, 0, 0, 0.4), 0 20px 48px rgba(0, 0, 0, 0.5);
        --ring: 0 0 0 4px rgba(124, 116, 255, 0.28);
    }
}

/* ---------- 2. Dasar ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-md);
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 var(--s3);
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text);
}

h1 {
    font-size: var(--fs-xl);
    font-weight: 750;
}

h2 {
    font-size: var(--fs-lg);
    font-weight: 700;
}

h3 {
    font-size: var(--fs-md);
    font-weight: 700;
}

p {
    margin: 0 0 var(--s3);
}

a {
    color: var(--primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

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

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

::selection {
    background: var(--primary-soft-2);
}

[hidden] {
    display: none !important;
}

.icon {
    flex: 0 0 auto;
    vertical-align: middle;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.no-scroll {
    overflow: hidden;
}

.grow {
    flex: 1;
    min-width: 0;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: var(--s2);
    top: -100px;
    z-index: 100;
    padding: var(--s2) var(--s4);
    color: var(--on-primary);
    background: var(--primary);
    border-radius: var(--r-sm);
}

.skip-link:focus {
    top: var(--s2);
}

.muted {
    color: var(--text-3);
}

.text-sm {
    font-size: var(--fs-sm);
}

.num {
    font-variant-numeric: tabular-nums;
}

/* Logo */
.brand-mark .bm-1 {
    fill: var(--primary);
}

.brand-mark .bm-2 {
    fill: var(--primary);
    opacity: 0.55;
}

.brand-mark .bm-3 {
    fill: var(--primary);
    opacity: 0.35;
}

.brand-mark .bm-4 {
    fill: var(--primary);
    opacity: 0.8;
}

/* ---------- 3. Tombol ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    min-height: var(--tap);
    padding: 0 var(--s5);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    box-shadow: var(--sh-1);
    cursor: pointer;
    transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    color: var(--text);
    background: var(--surface-2);
}

.btn:active {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* Indikator memuat saat formulir sedang dikirim (app.js memberi aria-busy). */
.btn[aria-busy="true"] {
    position: relative;
    color: transparent !important;
}

.btn[aria-busy="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid currentColor;
    border-color: var(--text-3) transparent var(--text-3) transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-primary[aria-busy="true"]::after,
.btn-danger[aria-busy="true"]::after {
    border-color: #fff transparent #fff transparent;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    color: var(--on-primary);
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.25), 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    color: var(--on-primary);
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-danger {
    color: #fff;
    background: var(--danger-solid);
    border-color: var(--danger-solid);
}

.btn-danger:hover {
    color: #fff;
    background: #a82828;
    border-color: #a82828;
}

.btn-soft-danger {
    color: var(--danger);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.btn-soft-danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--surface-3);
}

.btn-sm {
    min-height: 36px;
    padding: 0 var(--s3);
    font-size: var(--fs-sm);
}

.btn-lg {
    min-height: 52px;
    padding: 0 var(--s6);
    font-size: var(--fs-md);
    border-radius: var(--r);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap);
    height: var(--tap);
    padding: 0;
    color: var(--text-2);
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-icon:hover {
    color: var(--text);
    background: var(--surface-3);
}

/* ---------- 4. Kartu ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-2);
    margin-bottom: var(--s6);
}

.card-body {
    padding: var(--s5);
}

.card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    margin: 0;
    font-size: var(--fs-md);
}

.card-header p {
    margin: 2px 0 0;
    font-size: var(--fs-sm);
    color: var(--text-3);
}

.card-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--s2);
    padding: var(--s4) var(--s5);
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.card-form {
    max-width: 680px;
}

@media (min-width: 600px) {
    .card-body {
        padding: var(--s6);
    }

    .card-header,
    .card-footer {
        padding-left: var(--s6);
        padding-right: var(--s6);
    }
}

/* Status kosong */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--s10) var(--s5);
    text-align: center;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--s4);
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: var(--r-lg);
}

.empty h3 {
    margin-bottom: var(--s1);
}

.empty p {
    max-width: 380px;
    color: var(--text-3);
    font-size: var(--fs-sm);
}

/* ---------- 5. Formulir ---------- */
.form .field + .field {
    margin-top: var(--s5);
}

.field label,
.field .label {
    display: block;
    margin-bottom: 6px;
    font-size: var(--fs-sm);
    font-weight: 650;
    color: var(--text);
}

.input,
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="datetime-local"],
.field select,
.field textarea {
    display: block;
    width: 100%;
    min-height: var(--tap);
    padding: 10px 14px;
    font: inherit;
    font-size: 16px; /* cegah zoom otomatis iOS */
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    box-shadow: var(--sh-1);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-3);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: var(--text-3);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.field input:disabled {
    color: var(--text-3);
    background: var(--surface-3);
    cursor: not-allowed;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
    border-color: var(--danger);
}

.field.has-error input:focus {
    box-shadow: 0 0 0 4px rgba(210, 59, 59, 0.15);
}

.field-hint {
    margin: 6px 0 0;
    font-size: var(--fs-sm);
    color: var(--text-3);
}

.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--danger);
}

/* Input dengan tombol di dalamnya (mis. tampilkan password) */
.input-group {
    position: relative;
}

.input-group input {
    padding-right: 52px !important;
}

.input-group .btn-icon {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* Sakelar */
.switch-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s4);
    padding: var(--s4);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
}

.switch-row .switch-text strong {
    display: block;
    font-size: var(--fs-sm);
}

.switch-row .switch-text span {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-3);
}

.switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: var(--tap);
    margin: -10px 0;
    cursor: pointer;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.field label.switch {
    display: inline-flex;
    margin-bottom: 0;
}

.switch-track {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 44px;
    height: 26px;
    background: var(--border-strong);
    border-radius: var(--r-full);
    transition: background-color 0.2s var(--ease);
}

.switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s var(--ease);
}

.switch input:checked + .switch-track {
    background: var(--primary);
}

.switch input:checked + .switch-track::after {
    transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
    box-shadow: var(--ring);
}

.switch input:disabled {
    cursor: not-allowed;
}

.switch input:disabled + .switch-track {
    opacity: 0.5;
}

/* ---------- 6. Alert, badge, avatar ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    margin-bottom: var(--s5);
    font-size: var(--fs-sm);
    border: 1px solid transparent;
    border-radius: var(--r);
    animation: fade-in 0.25s var(--ease);
}

.alert .icon {
    margin-top: 1px;
}

.alert-body {
    flex: 1;
    min-width: 0;
}

.alert .alert-close {
    width: 28px;
    height: 28px;
    margin: -4px -6px -4px 0;
    color: inherit;
    opacity: 0.7;
}

.alert-success {
    color: var(--success);
    background: var(--success-soft);
    border-color: color-mix(in srgb, var(--success) 25%, transparent);
}

.alert-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}

.alert-warning {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: color-mix(in srgb, var(--warning) 30%, transparent);
}

.alert-info {
    color: var(--info);
    background: var(--info-soft);
    border-color: color-mix(in srgb, var(--info) 25%, transparent);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    font-size: var(--fs-xs);
    font-weight: 650;
    line-height: 1.6;
    white-space: nowrap;
    color: var(--text-2);
    background: var(--surface-3);
    border-radius: var(--r-full);
}

.badge-dot::before {
    content: "";
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}

.badge-success {
    color: var(--success);
    background: var(--success-soft);
}

.badge-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.badge-danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.badge-primary {
    color: var(--primary-text);
    background: var(--primary-soft);
}

.avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: var(--fs-xs);
    font-weight: 750;
    letter-spacing: 0.02em;
    color: var(--primary-text);
    background: var(--primary-soft-2);
    border-radius: 50%;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

/* ---------- 7. Tabel (mobile: kartu) ---------- */
.table-wrap {
    overflow-x: auto;
    border-radius: inherit;
}

.card > .table-wrap:first-child {
    border-radius: var(--r-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.table th,
.table td {
    padding: 14px var(--s5);
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: var(--fs-xs);
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
    background: var(--surface-2);
}

.table tbody tr {
    transition: background-color 0.15s;
}

.table tbody tr:hover {
    background: var(--surface-2);
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.table-actions > * + * {
    margin-left: var(--s1);
}

.person {
    display: flex;
    align-items: center;
    gap: var(--s3);
    min-width: 0;
}

.person-name {
    display: block;
    font-weight: 650;
    color: var(--text);
    overflow-wrap: anywhere;
}

.person-meta {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-3);
}

.chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

@media (max-width: 767px) {
    .table-cards thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .table-cards,
    .table-cards tbody,
    .table-cards tr,
    .table-cards td {
        display: block;
        width: 100%;
    }

    .table-cards tr {
        padding: var(--s4) var(--s5);
        border-bottom: 1px solid var(--border);
    }

    .table-cards tbody tr:last-child {
        border-bottom: 0;
    }

    .table-cards td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--s3);
        padding: 6px 0;
        border: 0;
        text-align: right;
    }

    .table-cards td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-size: var(--fs-xs);
        font-weight: 650;
        color: var(--text-3);
        text-align: left;
    }

    .table-cards td.td-main {
        display: block;
        padding-bottom: var(--s3);
        text-align: left;
    }

    .table-cards td.td-main::before {
        display: none;
    }

    .table-cards .table-actions {
        justify-content: flex-end;
        padding-top: var(--s3);
    }
}

/* ---------- 8. Statistik ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: var(--s4);
    margin-bottom: var(--s6);
}

.stat {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--s4);
    padding: var(--s5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-2);
}

.stat-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    color: var(--primary);
    background: var(--primary-soft);
}

.stat-icon.is-success {
    color: var(--success);
    background: var(--success-soft);
}

.stat-icon.is-warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.stat-label {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-3);
}

.stat-value {
    display: block;
    font-size: var(--fs-2xl);
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-hint {
    display: block;
    margin-top: 2px;
    font-size: var(--fs-xs);
    color: var(--text-3);
}

@media (max-width: 599px) {
    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--s2);
    }

    .stat {
        flex-direction: column;
        gap: var(--s2);
        padding: var(--s3);
        border-radius: var(--r);
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        border-radius: var(--r-sm);
    }

    .stat-icon .icon {
        width: 18px;
        height: 18px;
    }

    .stat-label {
        font-size: var(--fs-xs);
        line-height: 1.3;
    }

    .stat-value {
        font-size: var(--fs-xl);
    }

    .stat-hint {
        display: none;
    }
}

/* Daftar sederhana */
.list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 14px var(--s5);
    border-bottom: 1px solid var(--border);
}

.list-item:last-child {
    border-bottom: 0;
}

@media (min-width: 600px) {
    .list-item {
        padding-left: var(--s6);
        padding-right: var(--s6);
    }
}

/* ---------- 9. Halaman publik (peserta, login) ---------- */
.layout-public {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(900px 500px at 10% -10%, var(--primary-soft-2), transparent 60%),
        radial-gradient(700px 420px at 110% 10%, var(--bg-accent), transparent 60%),
        var(--bg);
}

.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: var(--s4) var(--s4) 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 750;
    font-size: var(--fs-md);
    letter-spacing: -0.01em;
    color: var(--text);
    text-decoration: none;
}

.brand:hover {
    color: var(--text);
}

.brand small {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0;
}

.public-main {
    display: flex;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: var(--s6) var(--s4) var(--s8);
}

.public-footer {
    padding: var(--s4) var(--s4) var(--s6);
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--text-3);
}

/* Panel autentikasi: satu kolom di mobile, dua kolom di desktop */
.auth {
    display: grid;
    width: 100%;
    max-width: 960px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-3);
    animation: rise 0.35s var(--ease);
}

.auth-aside {
    display: none;
}

.auth-main {
    padding: var(--s8) var(--s5);
}

.auth-main .auth-head {
    margin-bottom: var(--s6);
}

.auth-head h1 {
    margin-bottom: var(--s1);
    font-size: var(--fs-2xl);
}

.auth-head p {
    margin: 0;
    color: var(--text-3);
}

.auth-form .btn-block {
    margin-top: var(--s6);
}

.auth-note {
    display: flex;
    align-items: center;
    gap: var(--s2);
    margin: var(--s5) 0 0;
    font-size: var(--fs-xs);
    color: var(--text-3);
}

@media (min-width: 600px) {
    .auth-main {
        padding: var(--s10);
    }
}

@media (min-width: 880px) {
    .auth {
        grid-template-columns: 1.05fr 1fr;
    }

    .auth-aside {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: var(--s10);
        overflow: hidden;
        color: #fff;
        background:
            radial-gradient(500px 300px at 0% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
            linear-gradient(150deg, #4f46e5 0%, #6d28d9 55%, #312e81 100%);
    }

    .auth-aside::after {
        content: "";
        position: absolute;
        right: -80px;
        bottom: -80px;
        width: 280px;
        height: 280px;
        border: 40px solid rgba(255, 255, 255, 0.07);
        border-radius: 50%;
    }

    .auth-aside h2 {
        margin: var(--s8) 0 var(--s3);
        font-size: var(--fs-2xl);
        color: #fff;
    }

    .auth-aside p {
        max-width: 340px;
        color: rgba(255, 255, 255, 0.82);
    }

    .auth-aside .brand,
    .auth-aside .brand small {
        color: #fff;
    }

    .auth-aside .brand-mark rect {
        fill: #fff;
    }

    .auth-points {
        display: grid;
        gap: var(--s3);
        margin: var(--s6) 0 0;
        padding: 0;
        list-style: none;
    }

    .auth-points li {
        display: flex;
        align-items: center;
        gap: var(--s3);
        font-size: var(--fs-sm);
        color: rgba(255, 255, 255, 0.92);
    }

    .auth-points .icon {
        padding: 6px;
        width: 30px;
        height: 30px;
        background: rgba(255, 255, 255, 0.14);
        border-radius: var(--r-sm);
    }

    .auth-main {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: var(--s10) 56px;
    }

    .auth-main .brand-mobile {
        display: none;
    }
}

.brand-mobile {
    margin-bottom: var(--s6);
}

/* Halaman masuk peserta */
.hero {
    width: 100%;
    max-width: 520px;
    text-align: center;
    animation: rise 0.35s var(--ease);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--s4);
    padding: 6px 12px;
    font-size: var(--fs-xs);
    font-weight: 650;
    color: var(--primary-text);
    background: var(--primary-soft);
    border-radius: var(--r-full);
}

.hero h1 {
    margin-bottom: var(--s3);
    font-size: var(--fs-2xl);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hero-lead {
    margin: 0 auto var(--s6);
    max-width: 440px;
    color: var(--text-2);
}

@media (min-width: 600px) {
    .hero h1 {
        font-size: var(--fs-3xl);
    }

    .hero-lead {
        font-size: var(--fs-lg);
    }
}

.token-card {
    padding: var(--s6) var(--s5);
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-3);
}

@media (min-width: 600px) {
    .token-card {
        padding: var(--s8);
    }
}

.token-card .btn-block {
    margin-top: var(--s5);
}

.token-input {
    display: block;
    width: 100%;
    height: 72px;
    padding: 0 0 0 0.6em;
    font-family: var(--mono);
    font-size: 2.25rem !important;
    font-weight: 700;
    letter-spacing: 0.6em;
    text-align: center;
    text-transform: uppercase;
    color: var(--text);
    background: var(--surface-2);
    border: 2px solid var(--border-strong);
    border-radius: var(--r);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.token-input::placeholder {
    color: var(--border-strong);
    letter-spacing: 0.6em;
}

.token-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

.steps {
    display: grid;
    gap: var(--s3);
    margin: var(--s8) 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
    counter-reset: step;
}

@media (min-width: 600px) {
    .steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

.steps li {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s4);
    font-size: var(--fs-sm);
    color: var(--text-2);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--r);
    counter-increment: step;
}

.steps li::before {
    content: counter(step);
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: var(--fs-xs);
    font-weight: 750;
    color: var(--primary-text);
    background: var(--primary-soft);
    border-radius: 50%;
}

.link-row {
    margin: var(--s4) 0 0;
    font-size: var(--fs-sm);
    text-align: center;
    color: var(--text-3);
}

/* Halaman galat */
.error-page {
    width: 100%;
    max-width: 440px;
    padding: var(--s8) var(--s6);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-3);
}

.error-code {
    display: block;
    margin-bottom: var(--s2);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--primary);
}

/* ---------- 10. Layout admin ---------- */
.layout-admin {
    min-height: 100vh;
    min-height: 100dvh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: var(--s2);
    height: var(--topbar-h);
    padding: 0 var(--s3);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}

.topbar .brand {
    flex: 1;
    min-width: 0;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    max-width: 86vw;
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: var(--sh-3);
    transform: translateX(-105%);
    transition: transform 0.25s var(--ease);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar.is-open {
    transform: translateX(0);
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-h);
    padding: 0 var(--s3) 0 var(--s5);
}

.sidebar-section {
    padding: var(--s2) var(--s3);
}

.sidebar-label {
    padding: var(--s3) var(--s3) var(--s2);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(10, 12, 30, 0.45);
    animation: fade-in 0.2s var(--ease);
}

.nav-list {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--s3);
    min-height: var(--tap);
    padding: 0 var(--s3);
    font-size: var(--fs-sm);
    font-weight: 550;
    color: var(--text-2);
    text-decoration: none;
    border-radius: var(--r-sm);
    transition: background-color 0.15s, color 0.15s;
}

.nav-link .icon {
    color: var(--text-3);
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-3);
}

.nav-link.is-active {
    font-weight: 650;
    color: var(--primary-text);
    background: var(--primary-soft);
}

.nav-link.is-active .icon {
    color: var(--primary);
}

.nav-link.is-disabled {
    color: var(--text-3);
    cursor: default;
}

.nav-link.is-disabled:hover {
    background: transparent;
}

.nav-soon {
    margin-left: auto;
    padding: 1px 7px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-3);
    background: var(--surface-3);
    border-radius: var(--r-full);
}

.sidebar-foot {
    margin-top: auto;
    padding: var(--s3);
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s2);
}

.user-card .person-name {
    font-size: var(--fs-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card > div {
    flex: 1;
    min-width: 0;
}

.admin-main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--s5) var(--s4) var(--s10);
}

.admin-main:focus {
    outline: none;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s4);
    margin-bottom: var(--s6);
}

.page-head h1 {
    margin: 0;
    font-size: var(--fs-xl);
}

.page-head p {
    margin: 4px 0 0;
    color: var(--text-3);
    font-size: var(--fs-sm);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--s3);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-3);
    text-decoration: none;
}

.back-link:hover {
    color: var(--text);
}

@media (max-width: 599px) {
    .page-head .page-actions,
    .page-head .page-actions .btn {
        width: 100%;
    }
}

@media (min-width: 600px) {
    .admin-main {
        padding: var(--s8) var(--s6) var(--s10);
    }

    .page-head h1 {
        font-size: var(--fs-2xl);
    }
}

@media (min-width: 1024px) {
    .topbar,
    .sidebar-close,
    .sidebar-backdrop {
        display: none !important;
    }

    .layout-admin {
        display: grid;
        grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        height: 100vh;
        height: 100dvh;
        max-width: none;
        box-shadow: none;
        transform: none;
        transition: none;
    }

    .admin-main {
        padding: var(--s10) var(--s10) var(--s10);
    }
}

/* ---------- 10b. Komponen sesi & utilitas ---------- */
.ta-right,
.table .ta-right {
    text-align: right;
}

.lead-text {
    max-width: 720px;
    margin: calc(-1 * var(--s3)) 0 var(--s6);
    color: var(--text-2);
}

.stack {
    display: grid;
    gap: var(--s3);
}

.field textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.5;
}

.input-narrow {
    max-width: 220px;
}

.field-grid {
    display: grid;
    gap: var(--s4);
    margin-top: var(--s4);
}

.field-grid .field + .field {
    margin-top: 0;
}

.field-span {
    margin: 0;
}

@media (min-width: 600px) {
    .field-grid {
        grid-template-columns: 1fr 1fr;
    }

    .field-span {
        grid-column: 1 / -1;
    }
}

.alert-inline {
    margin: var(--s3) 0 0;
}

.form-sections .card {
    margin-bottom: var(--s5);
}

.form-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: flex-end;
    gap: var(--s2);
    padding: var(--s3) 0;
    background: linear-gradient(to top, var(--bg) 70%, transparent);
}

@media (max-width: 599px) {
    .form-bar .btn {
        flex: 1;
    }
}

/* Pilihan bersegmen (radio) */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    background: var(--surface-3);
    border-radius: var(--r);
}

.segmented-item {
    position: relative;
    margin: 0 !important;
    font-weight: 600 !important;
}

.segmented-item input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.segmented-item span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 var(--s4);
    font-size: var(--fs-sm);
    color: var(--text-2);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.segmented-item input:checked + span {
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--sh-1);
}

.segmented-item input:focus-visible + span {
    box-shadow: var(--ring);
}

/* Pencarian */
.search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    display: inline-flex;
    color: var(--text-3);
    transform: translateY(-50%);
    pointer-events: none;
}

.search input {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px 8px 38px;
    font: inherit;
    font-size: 16px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
    background: var(--surface);
}

/* Kode / token kecil */
.code-pill {
    display: inline-block;
    padding: 2px 8px;
    font-family: var(--mono);
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--primary-text);
    background: var(--primary-soft);
    border-radius: var(--r-sm);
}

.code-pill.is-muted {
    color: var(--text-3);
    background: var(--surface-3);
}

/* Baris tabel yang dapat diklik penuh */
.row-link {
    position: relative;
}

.row-link .stretched {
    text-decoration: none;
}

.row-link .stretched::after {
    content: "";
    position: absolute;
    inset: 0;
}

.row-link .stretched:hover {
    color: var(--primary);
}

.row-link:hover .stretched {
    color: var(--primary);
}

.card-footer-split {
    align-items: center;
    justify-content: space-between;
}

/* Paginasi */
.pager {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pager-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    border-radius: var(--r-sm);
}

.pager-link:hover {
    color: var(--text);
    background: var(--surface-3);
}

.pager-link.is-active {
    color: var(--on-primary);
    background: var(--primary);
}

.pager-link.is-disabled {
    color: var(--border-strong);
}

/* Detail sesi */
.stat-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

@media (max-width: 599px) {
    .stat-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.detail-grid {
    display: grid;
    gap: 0 var(--s6);
}

@media (min-width: 1100px) {
    .detail-grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        align-items: start;
    }
}

.share-block + .share-block {
    margin-top: var(--s6);
    padding-top: var(--s6);
    border-top: 1px dashed var(--border);
}

.share-block.is-dim .token-display {
    opacity: 0.45;
}

.share-label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2);
    margin-bottom: var(--s2);
    font-size: var(--fs-sm);
    font-weight: 650;
}

.share-row {
    display: flex;
    gap: var(--s2);
    align-items: stretch;
}

.token-display {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 0 var(--s4) 0 calc(var(--s4) + 0.4em);
    font-family: var(--mono);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 0.4em;
    color: var(--primary-text);
    background: var(--primary-soft);
    border: 1px dashed color-mix(in srgb, var(--primary) 40%, transparent);
    border-radius: var(--r);
    user-select: all;
}

.link-display {
    flex: 1;
    min-width: 0;
    min-height: var(--tap);
    padding: 0 var(--s3);
    font-family: var(--mono);
    font-size: var(--fs-sm);
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.share-row .btn {
    flex: 0 0 auto;
}

.share-row .btn.is-copied {
    color: var(--success);
    border-color: var(--success);
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    margin-top: var(--s2);
    padding: 0;
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-3);
    background: none;
    border: 0;
    cursor: pointer;
}

.link-btn:hover {
    color: var(--primary);
}

.dl {
    margin: 0;
}

.dl > div {
    display: grid;
    gap: 2px;
    padding: 12px var(--s5);
    border-bottom: 1px solid var(--border);
}

.dl > div:last-child {
    border-bottom: 0;
}

@media (min-width: 600px) {
    .dl > div {
        grid-template-columns: 150px 1fr;
        gap: var(--s4);
        padding-left: var(--s6);
        padding-right: var(--s6);
    }
}

.dl dt {
    font-size: var(--fs-sm);
    color: var(--text-3);
}

.dl dd {
    margin: 0;
    font-size: var(--fs-sm);
    font-weight: 550;
}

.meter {
    display: block;
    width: 100%;
    max-width: 240px;
    height: 6px;
    margin-top: 6px;
    overflow: hidden;
    background: var(--surface-3);
    border-radius: var(--r-full);
}

.meter-fill {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: inherit;
}

.meter-fill.w-0 {
    width: 0%;
}

.meter-fill.w-5 {
    width: 5%;
}

.meter-fill.w-10 {
    width: 10%;
}

.meter-fill.w-15 {
    width: 15%;
}

.meter-fill.w-20 {
    width: 20%;
}

.meter-fill.w-25 {
    width: 25%;
}

.meter-fill.w-30 {
    width: 30%;
}

.meter-fill.w-35 {
    width: 35%;
}

.meter-fill.w-40 {
    width: 40%;
}

.meter-fill.w-45 {
    width: 45%;
}

.meter-fill.w-50 {
    width: 50%;
}

.meter-fill.w-55 {
    width: 55%;
}

.meter-fill.w-60 {
    width: 60%;
}

.meter-fill.w-65 {
    width: 65%;
}

.meter-fill.w-70 {
    width: 70%;
}

.meter-fill.w-75 {
    width: 75%;
}

.meter-fill.w-80 {
    width: 80%;
}

.meter-fill.w-85 {
    width: 85%;
}

.meter-fill.w-90 {
    width: 90%;
}

.meter-fill.w-95 {
    width: 95%;
}

.meter-fill.w-100 {
    width: 100%;
}

.card-danger {
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

.card-danger .card-header h2 {
    color: var(--danger);
}

.select-all {
    user-select: all;
}

@media (max-width: 599px) {
    .share-row .btn span {
        display: none;
    }

    .token-display {
        font-size: 2rem;
    }
}

/* ---------- 10c. Peserta: masuk, kode, petunjuk ---------- */
.hero-wide {
    max-width: 600px;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin: var(--s6) 0 var(--s4);
    font-size: var(--fs-sm);
    color: var(--text-3);
}

.divider-text::before,
.divider-text::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.link-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: var(--s2);
}

.link-row .icon {
    margin-top: 2px;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--fs-md);
}

.resume-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s4);
    padding: var(--s6) var(--s5);
    text-align: center;
    background: var(--surface);
    border: 2px solid var(--primary-soft-2);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-3);
    animation: rise 0.35s var(--ease);
}

.resume-card h2 {
    margin-bottom: var(--s1);
    font-size: var(--fs-xl);
}

.resume-name {
    color: var(--primary-text);
}

.resume-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s2);
    margin-top: var(--s4);
}

.resume-note {
    margin: var(--s4) 0 0;
}

@media (max-width: 599px) {
    .resume-actions,
    .resume-actions .btn,
    .resume-actions .inline-form {
        width: 100%;
    }

    .resume-actions .inline-form .btn {
        display: flex;
        width: 100%;
    }
}

.code-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s5);
    padding: var(--s6) var(--s4);
    background: var(--primary-soft);
    border: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent);
    border-radius: var(--r-lg);
}

.code-label {
    font-size: var(--fs-sm);
    font-weight: 650;
    color: var(--primary-text);
}

.code-value {
    padding-left: 0.35em;
    font-family: var(--mono);
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.35em;
    color: var(--primary-text);
    user-select: all;
}

.instr-title {
    margin: var(--s6) 0 var(--s3);
    font-size: var(--fs-lg);
}

.instr-list {
    display: grid;
    gap: var(--s3);
    margin: 0 0 var(--s6);
    padding: 0;
    list-style: none;
}

.instr-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.instr-list .icon {
    margin-top: 2px;
    padding: 3px;
    width: 22px;
    height: 22px;
    color: var(--success);
    background: var(--success-soft);
    border-radius: 50%;
}

.consent {
    display: flex !important;
    align-items: flex-start;
    gap: var(--s3);
    margin-bottom: var(--s4);
    padding: var(--s4);
    font-weight: 600 !important;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
}

.consent input {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.consent:has(input:checked) {
    background: var(--primary-soft);
    border-color: var(--primary-soft-2);
}

.token-toggle {
    margin-top: var(--s5);
    padding-top: var(--s4);
    border-top: 1px solid var(--border);
}

.token-toggle summary {
    min-height: var(--tap);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.token-toggle[open] summary {
    margin-bottom: var(--s3);
}

.token-toggle .btn-block {
    margin-top: var(--s3);
}

.token-input-sm {
    height: 60px;
    font-size: 1.75rem !important;
}

.alert a {
    font-weight: 700;
    color: inherit;
}

/* Hasil / terima kasih */
.empty-icon-lg {
    width: 72px;
    height: 72px;
    margin-bottom: var(--s5);
    color: var(--success);
    background: var(--success-soft);
    border-radius: 50%;
}

.note-box {
    margin: var(--s5) 0;
    padding: var(--s5);
    background: var(--warning-soft);
    border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
    border-radius: var(--r-lg);
}

.note-box h2 {
    display: flex;
    align-items: center;
    gap: var(--s2);
    margin-bottom: var(--s3);
    font-size: var(--fs-md);
    color: var(--warning);
}

.note-box ul {
    display: grid;
    gap: var(--s2);
    margin: 0;
    padding-left: 1.2em;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.code-reminder {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    margin: var(--s5) 0;
    padding: var(--s4);
    font-size: var(--fs-sm);
    background: var(--primary-soft);
    border-radius: var(--r);
}

.code-reminder .icon {
    margin-top: 2px;
    color: var(--primary);
}

.code-reminder p {
    margin: 0;
}

.finish-form {
    margin-top: var(--s5);
    text-align: center;
}

.finish-form p {
    margin: var(--s3) 0 0;
}

/* Status simpan otomatis */
.save-status {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-3);
}

.save-status.is-saving {
    color: var(--text-3);
}

.save-status.is-saved {
    color: var(--success);
}

.save-status.is-error {
    color: var(--danger);
    white-space: normal;
}

/* ---------- 10d. Peserta: halaman soal ---------- */
.layout-tes .public-main {
    display: block;
    max-width: none;
    padding: 0;
}

.tes-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}

.tes-bar-inner,
.tes-main,
.tes-nav-inner {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding-left: var(--s4);
    padding-right: var(--s4);
}

.tes-bar-inner {
    padding-top: var(--s3);
    padding-bottom: var(--s3);
}

.tes-who {
    display: flex;
    align-items: center;
    gap: var(--s3);
}

.tes-who-name,
.tes-who-meta {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tes-who-name {
    font-size: var(--fs-sm);
}

.tes-who-meta {
    font-size: var(--fs-xs);
    color: var(--text-3);
}

.tes-progress {
    margin-top: var(--s3);
}

.tes-progress-text {
    display: flex;
    justify-content: space-between;
    gap: var(--s2);
    margin-bottom: 6px;
    font-size: var(--fs-sm);
}

.progress {
    display: block;
    width: 100%;
    height: 8px;
    overflow: hidden;
    color: var(--primary);
    background: var(--surface-3);
    border: 0;
    border-radius: var(--r-full);
    -webkit-appearance: none;
    appearance: none;
}

.progress::-webkit-progress-bar {
    background: var(--surface-3);
    border-radius: var(--r-full);
}

.progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: var(--r-full);
    transition: width 0.3s var(--ease);
}

.progress::-moz-progress-bar {
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    border-radius: var(--r-full);
}

.tes-main {
    padding-top: var(--s5);
    padding-bottom: var(--s6);
}

.tes-hint {
    display: flex;
    align-items: flex-start;
    gap: var(--s2);
    margin-bottom: var(--s5);
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.tes-hint .icon {
    margin-top: 2px;
    color: var(--primary);
}

.q-card {
    position: relative;
    margin: 0 0 var(--s4);
    padding: var(--s4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    scroll-margin-top: 140px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.q-card.is-answered {
    border-color: var(--primary-soft-2);
}

.q-card.is-missing {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

.q-head {
    float: left;
    width: 100%;
    margin-bottom: var(--s3);
    padding: 0;
}

.q-head + * {
    clear: both;
}

.q-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: var(--fs-sm);
    font-weight: 750;
    color: var(--text-2);
    background: var(--surface-3);
    border-radius: var(--r-full);
    transition: background-color 0.2s, color 0.2s;
}

.q-card.is-answered .q-num {
    color: var(--on-primary);
    background: var(--primary);
}

.q-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s2);
}

@media (min-width: 768px) {
    .q-card {
        padding: var(--s5);
    }

    .q-options {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: var(--s3);
    }
}

.option {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.option-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    height: 100%;
    min-height: 68px;
    padding: var(--s3) var(--s3) var(--s3) var(--s3);
    padding-right: 30px;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: var(--r);
    transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
}

.option:hover .option-body {
    border-color: var(--border-strong);
    background: var(--surface);
}

.option:active .option-body {
    transform: scale(0.98);
}

.option-en {
    font-size: var(--fs-md);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    overflow-wrap: anywhere;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.option-id {
    font-size: var(--fs-xs);
    line-height: 1.35;
    color: var(--text-3);
}

.option-check {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--on-primary);
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s, transform 0.15s var(--ease);
}

.option-check .icon {
    width: 13px;
    height: 13px;
    stroke-width: 3;
}

.option input:checked ~ .option-body {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.option input:checked ~ .option-body .option-en {
    color: var(--primary-text);
}

.option input:checked ~ .option-check {
    opacity: 1;
    transform: scale(1);
}

.option input:focus-visible ~ .option-body {
    box-shadow: var(--ring);
}

/* Layar sempit (≤400px): beri ruang untuk kata panjang (mis. "Unenthusiastic"). Tanda centang pindah ke sudut luar kartu. */
@media (max-width: 400px) {
    .q-card {
        padding: var(--s3);
    }

    .option-body {
        padding: 10px;
    }

    .option-en {
        font-size: 0.875rem;
        letter-spacing: -0.01em;
    }

    .option-check {
        top: -6px;
        right: -6px;
        box-shadow: 0 0 0 2px var(--surface);
    }
}


.tes-nav {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--border);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}

.tes-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2);
    padding-top: var(--s3);
    padding-bottom: var(--s3);
}

.page-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text-3);
    text-decoration: none;
    background: var(--surface-3);
    border-radius: 50%;
}

.page-dot.is-done {
    color: var(--success);
    background: var(--success-soft);
}

.page-dot.is-current {
    color: var(--on-primary);
    background: var(--primary);
}

.layout-tes .public-footer {
    padding-bottom: var(--s4);
}

@media (max-width: 599px) {
    /* Di HP: tombol lebar berlabel; posisi halaman sudah tampil di bilah atas. */
    .page-dots {
        display: none;
    }

    .tes-nav .btn-lg {
        flex: 1;
        padding: 0 var(--s3);
    }

    .code-value {
        font-size: 2.25rem;
    }
}

/* ---------- 10e. Hasil analisis (peserta & admin) ---------- */
/* Warna tipe hanya dipakai di hasil/analisis (SPEC 9.1). */
.t-S {
    --tc: var(--type-s);
}

.t-K {
    --tc: var(--type-k);
}

.t-M {
    --tc: var(--type-m);
}

.t-P {
    --tc: var(--type-p);
}

.result-page {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.result-hero {
    margin-bottom: var(--s6);
    text-align: center;
}

.result-hero h1 {
    font-size: var(--fs-2xl);
    font-weight: 800;
}

.result-headline {
    margin-bottom: var(--s2);
    font-size: var(--fs-xl);
    font-weight: 700;
    line-height: 1.35;
    color: var(--primary-text);
}

.result-hero-admin {
    text-align: left;
}

.result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s2);
    margin-top: var(--s5);
}

@media (max-width: 599px) {
    .result-actions .btn {
        width: 100%;
    }

    .result-hero h1 {
        font-size: var(--fs-xl);
    }

    .result-headline {
        font-size: var(--fs-lg);
    }
}

.howto {
    max-width: 520px;
    margin: var(--s4) auto 0;
    font-size: var(--fs-sm);
    text-align: left;
    color: var(--text-2);
}

.howto summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
}

.howto ol {
    margin: var(--s3) 0 0;
    padding-left: 1.2em;
}

.type-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    vertical-align: middle;
    background: var(--tc, var(--text-3));
    border-radius: 50%;
}

.bars {
    display: grid;
    gap: var(--s3);
    margin: 0 0 var(--s2);
    padding: 0;
    list-style: none;
}

.bar-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 32px;
    align-items: center;
    gap: var(--s3);
}

.bar-label {
    font-size: var(--fs-sm);
    font-weight: 650;
    white-space: nowrap;
}

.bar {
    display: block;
    width: 100%;
    height: 18px;
    overflow: hidden;
    border-radius: var(--r-full);
}

.bar-bg {
    fill: var(--surface-3);
}

.bar-str {
    fill: var(--tc);
}

.bar-weak {
    fill: var(--tc);
    fill-opacity: 0.4;
}

.bar-value {
    font-weight: 750;
    text-align: right;
}

.bar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: var(--s5);
}

.legend-swatch {
    display: inline-block;
    width: 18px;
    height: 10px;
    background: var(--text-2);
    border-radius: 3px;
}

.legend-swatch.is-weak {
    opacity: 0.4;
}

.score-table th[scope="row"] {
    font-weight: 600;
    white-space: nowrap;
    color: var(--text);
    background: transparent;
    font-size: var(--fs-sm);
    letter-spacing: 0;
    text-transform: none;
}

.score-table tr.is-top {
    background: color-mix(in srgb, var(--tc) 10%, transparent);
}

@media (max-width: 599px) {
    .score-table th,
    .score-table td {
        padding: 10px 4px;
        font-size: var(--fs-sm);
    }

    .score-table thead th {
        font-size: 0.6875rem;
        letter-spacing: 0;
        text-transform: none;
    }

    .score-table th:first-child,
    .score-table td:first-child {
        padding-left: 0;
    }

    .score-table .nick {
        display: none;
    }

    .score-table .type-dot {
        margin-right: 6px;
    }

    .bar-row {
        grid-template-columns: 92px minmax(0, 1fr) 24px;
        gap: var(--s2);
    }
}

.dl-compact > div {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.dl-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    padding: var(--s2) 0;
}

.dl-inline > div {
    display: block !important;
    border-bottom: 0 !important;
    padding: var(--s2) var(--s5) !important;
}

.type-card {
    overflow: hidden;
    border-top: 4px solid var(--tc);
}

.type-head {
    display: flex;
    align-items: flex-start;
    gap: var(--s4);
    padding: var(--s5);
    background: color-mix(in srgb, var(--tc) 8%, var(--surface));
}

.type-head h2 {
    margin-bottom: var(--s1);
    font-size: var(--fs-xl);
}

.type-head p {
    margin: 0;
    color: var(--text-2);
}

.type-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    font-size: var(--fs-xl);
    font-weight: 800;
    color: #fff;
    background: var(--tc);
    border-radius: var(--r);
}

.type-grid {
    display: grid;
    gap: var(--s5);
    padding: var(--s5);
}

@media (min-width: 700px) {
    .type-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.type-grid h3 {
    display: flex;
    align-items: center;
    gap: var(--s2);
    margin-bottom: var(--s2);
    font-size: var(--fs-sm);
    color: var(--text);
}

.type-grid h3 .icon {
    color: var(--tc);
}

.type-grid ul {
    margin: 0;
    padding-left: 1.2em;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.type-grid li + li {
    margin-top: 4px;
}

.type-grid p {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.h-sm {
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--fs-md);
}

.respect {
    display: flex;
    align-items: flex-start;
    gap: var(--s2);
    margin: var(--s2) 0 var(--s5);
}

.result-page .note-box {
    margin-top: 0;
    margin-bottom: var(--s6);
}

.word-list {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 900px) {
    .word-list {
        grid-template-columns: 1fr 1fr;
        column-gap: var(--s6);
    }
}

.word-list li {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 8px var(--s5);
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--border);
}

.word-no {
    width: 24px;
    font-weight: 700;
    color: var(--text-3);
    text-align: right;
}

.type-tag {
    flex: 0 0 auto;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-2);
}

/* ---------- 10f. Analisis sesi & daftar peserta ---------- */
.t-TIE {
    --tc: #8b93a7;
}

.page-head-tight {
    margin-bottom: var(--s4);
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: var(--s6);
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--s2);
    min-height: var(--tap);
    margin-bottom: -1px;
    padding: 0 var(--s4);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-3);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.tab:hover {
    color: var(--text);
}

.tab.is-active {
    color: var(--primary-text);
    border-bottom-color: var(--primary);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
    padding: var(--s4) var(--s5);
    border-bottom: 1px solid var(--border);
}

.filter-bar .search {
    flex: 1 1 220px;
}

.select-sm {
    min-height: 40px;
    padding: 6px 30px 6px 10px;
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.select-sm:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}

@media (max-width: 599px) {
    .filter-bar .select-sm {
        flex: 1 1 calc(50% - var(--s2));
        min-width: 0;
    }
}

.type-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px 2px 8px;
    font-size: var(--fs-xs);
    font-weight: 650;
    color: var(--text);
    background: color-mix(in srgb, var(--tc) 14%, transparent);
    border-radius: var(--r-full);
}

.type-chip .type-dot {
    width: 8px;
    height: 8px;
    margin-right: 6px;
}

.narrative p {
    margin-bottom: var(--s2);
    color: var(--text-2);
}

.narrative p:last-child {
    margin-bottom: 0;
    font-size: var(--fs-sm);
    color: var(--text-3);
}

.analysis-grid {
    display: grid;
    gap: 0 var(--s6);
}

@media (min-width: 1100px) {
    .analysis-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        align-items: start;
    }
}

.donut-wrap {
    display: grid;
    gap: var(--s5);
    align-items: center;
}

@media (min-width: 520px) {
    .donut-wrap {
        grid-template-columns: 150px minmax(0, 1fr);
    }

    .donut {
        width: 150px;
        height: 150px;
    }
}

.donut {
    display: block;
    width: 180px;
    height: 180px;
    margin: 0 auto;
    transform: rotate(0deg);
}

.donut-ring {
    stroke: var(--surface-3);
}

.donut-seg {
    stroke: var(--tc);
}

.donut-num {
    font-size: 8px;
    font-weight: 800;
    fill: var(--text);
}

.donut-cap {
    font-size: 3px;
    fill: var(--text-3);
}

.legend {
    display: grid;
    gap: var(--s2);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--fs-sm);
}

.legend li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s2);
}

.legend .type-dot {
    margin-right: 0;
}

.legend .num {
    white-space: nowrap;
    text-align: right;
}

.pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: var(--s4);
}

.pattern-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--s4);
    background: var(--surface-2);
    border-radius: var(--r);
}

.pattern-name {
    font-weight: 650;
}

.stat-unit {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-3);
}

.stack {
    display: block;
    width: 100%;
    min-width: 120px;
    height: 12px;
    overflow: hidden;
    border-radius: var(--r-full);
}

.stack rect {
    fill: var(--tc);
}

@media (max-width: 767px) {
    .group-table .stack {
        width: 60%;
    }
}

/* ---------- 10g. Pengelolaan data ---------- */
.choice-list {
    display: grid;
    gap: var(--s2);
}

.choice {
    display: flex !important;
    align-items: flex-start;
    gap: var(--s3);
    margin: 0 !important;
    padding: var(--s3) var(--s4);
    font-weight: 400 !important;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    cursor: pointer;
}

.choice input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--danger);
}

.choice > span {
    display: grid;
    gap: 2px;
}

.choice:has(input:checked) {
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.danger-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2);
}

.word-grid {
    display: grid;
    gap: var(--s4);
}

@media (min-width: 1100px) {
    .word-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.word-row {
    margin: 0;
    padding: var(--s4);
}

.word-row-head {
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s3);
}

.word-row-fields {
    display: grid;
    gap: var(--s3);
}

@media (min-width: 600px) {
    .word-row-fields {
        grid-template-columns: 1fr 1fr;
    }
}

.word-field + .word-field {
    margin-top: 0 !important;
}

.word-field label {
    font-size: var(--fs-sm);
}

.word-field input {
    min-height: 40px !important;
    padding: 6px 10px !important;
}

.log-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.log-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    padding: var(--s3) var(--s5);
    border-bottom: 1px solid var(--border);
}

.log-list li:last-child {
    border-bottom: 0;
}

.log-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2);
    font-size: var(--fs-sm);
}

.log-list time {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 599px) {
    .log-list li {
        flex-wrap: wrap;
    }

    .log-list time {
        width: 100%;
        padding-left: 44px;
    }
}

/* ---------- 10h. Mode situs (tes coba umum) ---------- */
.site-mode {
    border-left: 4px solid var(--border-strong);
}

.site-mode.is-open {
    border-left-color: var(--success);
}

.site-mode .switch-row {
    background: transparent;
    border: 0;
    padding: 0;
}

.site-mode .switch-text strong .icon {
    margin-top: -2px;
}

.site-mode-meta {
    margin: var(--s3) 0 0;
}

.text-ok {
    color: var(--success);
}

/* ---------- 11. Animasi ---------- */
@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- 10i. Landing page (halaman depan) ---------- */
/* Warna tipe boleh tampil di sini (bukan halaman soal). */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

.is-landing .public-header {
    position: sticky;
    top: 0;
    z-index: 20;
    max-width: none;
    padding: var(--s3) max(var(--s4), calc((100% - 1120px) / 2 + var(--s4)));
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.is-landing [id] {
    scroll-margin-top: 84px;
}

.is-landing .public-main {
    display: block;
    max-width: none;
    padding: 0;
}

.lp-nav {
    display: flex;
    align-items: center;
    gap: var(--s1);
}

.lp-nav a:not(.btn) {
    display: none;
    padding: 8px 12px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    border-radius: var(--r-full);
}

.lp-nav a:not(.btn):hover {
    color: var(--text);
    background: var(--surface-3);
}

@media (min-width: 768px) {
    .lp-nav a:not(.btn) {
        display: inline-flex;
    }

    .lp-nav-cta {
        margin-left: var(--s2);
    }
}

.lp-wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 var(--s4);
}

/* Hero */
.lp-hero {
    position: relative;
    overflow: hidden;
    padding: var(--s8) 0 var(--s10);
}

.lp-hero::before,
.lp-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.22;
    animation: lp-float 14s ease-in-out infinite alternate;
    pointer-events: none;
}

.lp-hero::before {
    top: -120px;
    left: -140px;
    background: var(--type-s);
}

.lp-hero::after {
    top: 120px;
    right: -220px;
    background: var(--type-m);
    animation-delay: -7s;
}

.lp-hero-grid {
    display: grid;
    align-items: center;
    gap: var(--s8);
}

.lp-hero-main.hero {
    max-width: 560px;
    margin: 0 auto;
    animation: none;
}

.lp-title {
    font-size: clamp(1.9rem, 6.5vw, 3.1rem) !important;
    line-height: 1.1;
}

.lp-grad {
    background: linear-gradient(100deg, var(--type-s), var(--type-k) 35%, var(--type-m) 68%, var(--type-p));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lp-facts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--s2);
    margin: var(--s5) 0 0;
    padding: 0;
    list-style: none;
}

.lp-facts li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-2);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
}

.lp-facts .icon {
    color: var(--primary);
}

/* Masuk bertahap saat halaman dibuka */
.lp-in {
    animation: rise 0.6s var(--ease) both;
}

.lp-d1 {
    animation-delay: 0.05s;
}

.lp-d2 {
    animation-delay: 0.15s;
}

.lp-d3 {
    animation-delay: 0.25s;
}

.lp-d4 {
    animation-delay: 0.35s;
}

.lp-d5 {
    animation-delay: 0.45s;
}

/* Orbit empat temperamen */
.lp-visual {
    display: none;
}

.lp-orbit {
    position: relative;
    width: min(420px, 100%);
    aspect-ratio: 1;
    margin: 0 auto;
    animation: fade-in 0.8s var(--ease) 0.3s both;
}

.lp-ring {
    position: absolute;
    border: 1px dashed var(--border-strong);
    border-radius: 50%;
}

.lp-ring-1 {
    inset: 12%;
}

.lp-ring-2 {
    inset: 32%;
    border-style: solid;
    border-color: var(--border);
}

.lp-core {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: var(--sh-3);
    transform: translate(-50%, -50%);
    animation: lp-pulse 4s ease-in-out infinite;
}

.lp-spin {
    position: absolute;
    inset: 12%;
    animation: lp-rotate 48s linear infinite;
}

.lp-planet {
    position: absolute;
    width: 88px;
    height: 88px;
    margin: -44px 0 0 -44px;
}

.lp-pos-1 {
    top: 0;
    left: 50%;
}

.lp-pos-2 {
    top: 50%;
    left: 100%;
}

.lp-pos-3 {
    top: 100%;
    left: 50%;
}

.lp-pos-4 {
    top: 50%;
    left: 0;
}

.lp-planet-in {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #fff;
    background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--tc) 70%, #fff), var(--tc) 65%);
    border-radius: 50%;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--tc) 45%, transparent);
    animation: lp-rotate 48s linear infinite reverse;
}

.lp-planet-in strong {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.lp-planet-in small {
    margin-top: 2px;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    opacity: 0.95;
}

@media (min-width: 960px) {
    .lp-hero {
        padding: var(--s10) 0 72px;
    }

    .lp-hero::before,
    .lp-hero::after {
        opacity: 0.35;
    }

    .lp-hero-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    }

    .lp-hero-main.hero {
        margin: 0;
        text-align: left;
    }

    .lp-hero-main .hero-lead {
        margin-left: 0;
    }

    .lp-facts {
        justify-content: flex-start;
    }

    .lp-visual {
        display: block;
    }
}

/* Bagian */
.lp-section {
    padding: 56px 0;
}

.lp-section-alt {
    background: color-mix(in srgb, var(--surface) 55%, transparent);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .lp-section {
        padding: 88px 0;
    }
}

.lp-head {
    max-width: 640px;
    margin: 0 auto var(--s8);
    text-align: center;
}

.lp-kicker {
    display: inline-block;
    margin-bottom: var(--s2);
    font-size: var(--fs-xs);
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.lp-section h2 {
    margin-bottom: var(--s3);
    font-size: clamp(1.5rem, 4.5vw, 2.1rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.lp-head p,
.lp-about-text p {
    color: var(--text-2);
}

/* Kartu temperamen */
.lp-types {
    display: grid;
    gap: var(--s4);
}

@media (min-width: 640px) {
    .lp-types {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1060px) {
    .lp-types {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.lp-type {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--s3);
    padding: var(--s5);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-2);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.lp-type::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--tc);
}

.lp-type:hover {
    border-color: color-mix(in srgb, var(--tc) 50%, var(--border));
    box-shadow: 0 18px 40px color-mix(in srgb, var(--tc) 22%, transparent);
    transform: translateY(-4px);
}

.lp-type-top {
    display: flex;
    align-items: center;
    gap: var(--s3);
}

.lp-type-top h3 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: 750;
}

.lp-type-badge {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 48px;
    height: 48px;
    font-size: var(--fs-xl);
    font-weight: 800;
    color: #fff;
    background: var(--tc);
    border-radius: 14px;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--tc) 40%, transparent);
}

.lp-type-nick {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-3);
}

.lp-type-want {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    margin: 0;
    padding: 5px 10px;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--text);
    background: color-mix(in srgb, var(--tc) 16%, transparent);
    border-radius: var(--r-full);
}

.lp-type-want .icon {
    color: var(--tc);
}

.lp-type-desc {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

.lp-type-list {
    display: grid;
    gap: 6px;
    margin: auto 0 0;
    padding: var(--s3) 0 0;
    list-style: none;
    border-top: 1px solid var(--border);
}

.lp-type-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: var(--fs-sm);
}

.lp-type-list .icon {
    flex: 0 0 auto;
    margin-top: 3px;
    color: var(--tc);
}

.lp-blend {
    display: flex;
    align-items: flex-start;
    gap: var(--s3);
    max-width: 720px;
    margin: var(--s8) auto 0;
    padding: var(--s4) var(--s5);
    font-size: var(--fs-sm);
    color: var(--text-2);
    background: var(--primary-soft);
    border-radius: var(--r-lg);
}

.lp-blend .icon {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--primary);
}

/* Tentang */
.lp-about {
    display: grid;
    gap: var(--s8);
}

@media (min-width: 900px) {
    .lp-about {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
        align-items: center;
        gap: 56px;
    }
}

.lp-how {
    display: grid;
    gap: var(--s3);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: how;
}

.lp-how li {
    position: relative;
    display: grid;
    gap: 4px;
    padding: var(--s4) var(--s5) var(--s4) 64px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    counter-increment: how;
}

.lp-how li::before {
    content: counter(how);
    position: absolute;
    top: var(--s4);
    left: var(--s4);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font-weight: 800;
    color: var(--on-primary);
    background: var(--primary);
    border-radius: 10px;
}

.lp-how span {
    font-size: var(--fs-sm);
    color: var(--text-2);
}

/* FAQ */
.lp-faq-grid {
    display: grid;
    gap: var(--s8);
}

@media (min-width: 900px) {
    .lp-faq-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
        align-items: start;
        gap: 56px;
    }
}

.lp-faq {
    display: grid;
    gap: var(--s2);
    margin-top: var(--s5);
}

.lp-faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    transition: border-color 0.2s var(--ease);
}

.lp-faq-item[open] {
    border-color: var(--primary);
}

.lp-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3);
    min-height: var(--tap);
    padding: var(--s4) var(--s5);
    font-weight: 650;
    cursor: pointer;
    list-style: none;
}

.lp-faq-item summary::-webkit-details-marker {
    display: none;
}

.lp-faq-item summary .icon {
    flex: 0 0 auto;
    color: var(--text-3);
    transition: transform 0.2s var(--ease);
}

.lp-faq-item[open] summary .icon {
    color: var(--primary);
    transform: rotate(180deg);
}

.lp-faq-item p {
    margin: 0;
    padding: 0 var(--s5) var(--s5);
    font-size: var(--fs-sm);
    color: var(--text-2);
    animation: fade-in 0.25s var(--ease);
}

.lp-note {
    padding: var(--s6);
    background: linear-gradient(160deg, var(--primary-soft), var(--surface));
    border: 1px solid var(--primary-soft-2);
    border-radius: var(--r-xl);
}

@media (min-width: 900px) {
    .lp-note {
        position: sticky;
        top: 88px;
    }
}

.lp-note-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: var(--s3);
    color: var(--type-k);
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--sh-1);
}

.lp-note h3 {
    margin-bottom: var(--s3);
    font-size: var(--fs-lg);
    font-weight: 750;
}

.lp-note ul {
    display: grid;
    gap: var(--s2);
    margin: 0;
    padding-left: 1.1em;
    font-size: var(--fs-sm);
    color: var(--text-2);
}

/* Ajakan akhir */
.lp-cta-wrap {
    padding-top: 0;
}

.lp-cta {
    position: relative;
    overflow: hidden;
    padding: var(--s10) var(--s5);
    text-align: center;
    color: #fff;
    background: linear-gradient(120deg, #4f46e5, #7c3aed 55%, #db2777);
    background-size: 200% 200%;
    border-radius: var(--r-xl);
    box-shadow: var(--sh-3);
    animation: lp-shift 12s ease-in-out infinite alternate;
}

.lp-cta h2 {
    color: #fff;
}

.lp-cta p {
    margin: 0 auto var(--s6);
    max-width: 460px;
    color: rgba(255, 255, 255, 0.88);
}

.lp-cta-btn {
    color: #312e81;
    background: #fff;
    border-color: #fff;
}

.lp-cta-btn:hover {
    color: #1e1b4b;
    background: #f1f0ff;
}

/* Muncul saat di-scroll (app.js menambah .js-reveal pada <html>) */
.js-reveal .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js-reveal .reveal.is-visible {
    opacity: 1;
    transform: none;
}

.js-reveal .reveal.lp-d2 {
    transition-delay: 0.1s;
}

.js-reveal .reveal.lp-d3 {
    transition-delay: 0.2s;
}

.js-reveal .reveal.lp-d4 {
    transition-delay: 0.3s;
}

/* Kartu tipe: jeda muncul memakai transisi, bukan animasi hero. */
.lp-type.lp-d1,
.lp-type.lp-d2,
.lp-type.lp-d3,
.lp-type.lp-d4 {
    animation-delay: 0s;
}

@keyframes lp-rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes lp-float {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(60px, 40px) scale(1.15);
    }
}

@keyframes lp-pulse {
    0%,
    100% {
        box-shadow: var(--sh-3), 0 0 0 0 color-mix(in srgb, var(--primary) 30%, transparent);
    }

    50% {
        box-shadow: var(--sh-3), 0 0 0 18px color-mix(in srgb, var(--primary) 0%, transparent);
    }
}

@keyframes lp-shift {
    from {
        background-position: 0% 50%;
    }

    to {
        background-position: 100% 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .js-reveal .reveal {
        opacity: 1;
        transform: none;
    }

    .lp-spin,
    .lp-planet-in,
    .lp-hero::before,
    .lp-hero::after,
    .lp-cta {
        animation: none;
    }
}

/* ---------- 12. Cetak / PDF (A4) ---------- */
.print-only {
    display: none !important;
}

@page {
    size: A4;
    margin: 14mm 14mm 16mm;
}

@media print {
    :root {
        color-scheme: light;
        --bg: #fff;
        --surface: #fff;
        --surface-2: #f6f7fb;
        --surface-3: #eceef4;
        --border: #d9dce6;
        --text: #111827;
        --text-2: #374151;
        --text-3: #6b7280;
        --primary: #4f46e5;
        --primary-soft: #eef0ff;
        --primary-soft-2: #e0e3ff;
        --primary-text: #3730a3;
        --warning: #8a5a00;
        --warning-soft: #fff7e6;
        --info: #1d4ed8;
        --info-soft: #eef4ff;
    }

    html,
    body {
        font-size: 11pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar,
    .topbar,
    .sidebar-backdrop,
    .page-actions,
    .table-actions,
    .public-header,
    .public-footer,
    .skip-link,
    .alert-close,
    .no-print,
    .btn {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    body,
    .layout-public,
    .layout-admin {
        display: block;
        background: #fff !important;
    }

    .public-main,
    .admin-main {
        display: block;
        max-width: none;
        padding: 0 !important;
    }

    .card,
    .stat,
    .note-box,
    .alert {
        box-shadow: none !important;
        break-inside: avoid;
    }

    .card {
        margin-bottom: 10pt;
        border-color: var(--border);
    }

    .card-body,
    .card-header {
        padding: 8pt 10pt !important;
    }

    .type-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .print-head {
        margin-bottom: 12pt;
        padding-bottom: 8pt;
        border-bottom: 2px solid var(--primary);
    }

    .print-brand {
        display: flex;
        align-items: center;
        gap: 8pt;
        margin-bottom: 6pt;
        font-size: 12pt;
    }

    .print-meta {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
    }

    .print-meta th {
        width: 14%;
        padding: 2pt 6pt 2pt 0;
        text-align: left;
        color: var(--text-3);
        font-weight: 600;
    }

    .print-meta td {
        padding: 2pt 12pt 2pt 0;
    }

    .print-foot {
        margin-top: 12pt;
        padding-top: 6pt;
        font-size: 9pt;
        color: var(--text-3);
        border-top: 1px solid var(--border);
    }

    .result-hero {
        padding: 0;
        text-align: left;
    }

    .result-hero h1 {
        font-size: 18pt;
    }

    /* Lebih padat agar ringkasan + skor muat di halaman pertama. */
    .result-hero {
        margin-bottom: 8pt;
    }

    .result-headline {
        font-size: 13pt;
    }

    .note-box {
        margin-bottom: 10pt !important;
        padding: 8pt 12pt;
    }

    .note-box ul {
        gap: 2pt;
        font-size: 9.5pt;
    }

    .bars {
        gap: 4pt;
    }

    .bar {
        height: 9pt;
    }

    .bar-legend {
        margin-bottom: 6pt;
    }

    .table th,
    .table td {
        padding: 3pt 8pt;
        font-size: 9.5pt;
    }

    .dl > div {
        padding-top: 3pt !important;
        padding-bottom: 3pt !important;
    }

    .type-head,
    .type-grid {
        padding: 8pt 10pt;
        gap: 8pt;
    }

    .word-list li {
        padding: 2pt 8pt;
    }

    /* Kertas A4 terbaca sebagai layar sempit: kembalikan tabel & grid ke tata letak lebar. */
    .table-cards {
        display: table;
    }

    .table-cards thead {
        position: static;
        display: table-header-group;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
    }

    .table-cards tbody {
        display: table-row-group;
    }

    .table-cards tr {
        display: table-row;
        padding: 0;
    }

    .table-cards td {
        display: table-cell;
        padding: 3pt 8pt;
        text-align: left;
        border-bottom: 1px solid var(--border);
    }

    .table-cards td.ta-right {
        text-align: right;
    }

    .table-cards td[data-label]::before {
        display: none;
    }

    .stat-grid,
    .stat-grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6pt;
    }

    .stat {
        padding: 6pt 8pt;
    }

    .analysis-grid {
        display: block;
    }

    .donut-wrap {
        grid-template-columns: 130px minmax(0, 1fr);
    }

    .donut {
        width: 130px;
        height: 130px;
    }

    a {
        color: inherit;
        text-decoration: none;
    }
}
