/* ===========================
   UTBK/SNBT Test — Neubrutalist CSS
   =========================== */

:root {
    --black: #1a1a1a;
    --white: #ffffff;
    --cream: #fef9ef;
    --yellow: #ffe156;
    --pink: #ff6b9d;
    --green: #06d6a0;
    --blue: #4361ee;
    --purple: #7c3aed;
    --orange: #ff9f1c;
    --lavender: #c4b5fd;
    --sky: #bae6fd;
    --red: #ef4444;
    --border: 3px solid var(--black);
    --shadow: 5px 5px 0px var(--black);
    --shadow-sm: 3px 3px 0px var(--black);
    --radius: 12px;
    --font: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--cream);
    color: var(--black);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===========================
   PAGE SYSTEM
   =========================== */
.page {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   LOGO
   =========================== */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--black);
    margin-bottom: 24px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--yellow);
    border: var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
}

.logo-text {
    font-weight: 800;
    font-size: 22px;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: var(--white);
    color: var(--black);
    box-shadow: var(--shadow-sm);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-full {
    width: 100%;
}

/* ===========================
   START PAGE
   =========================== */
.start-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.start-card {
    background: var(--white);
    border: var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 32px 24px;
}

.start-badge {
    display: inline-block;
    background: var(--orange);
    color: var(--black);
    border: var(--border);
    border-radius: 99px;
    padding: 6px 16px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 16px;
}

.start-card h1 {
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 12px;
    line-height: 1.2;
}

.start-desc {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.subtest-preview {
    text-align: left;
    margin-bottom: 24px;
    background: var(--cream);
    border: var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.subtest-preview h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subtest-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtest-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.subtest-list-item .subtest-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.subtest-list-item .subtest-timer {
    margin-left: auto;
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.start-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    text-align: left;
}

.start-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--green);
}

.start-feature span {
    color: var(--black);
}

.start-note {
    margin-top: 12px;
    font-size: 13px;
    color: #888;
}

/* ===========================
   SUBTEST INTRO PAGE
   =========================== */
.subtest-intro-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.subtest-progress-bar {
    height: 6px;
    background: #e5e5e5;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
}

.subtest-progress-fill {
    height: 100%;
    background: var(--blue);
    transition: width 0.4s ease;
    border-radius: 0 3px 3px 0;
}

.subtest-intro-card {
    background: var(--white);
    border: var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 32px 24px;
    margin-top: 40px;
    text-align: center;
}

.subtest-intro-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subtest-intro-card h2 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 12px;
}

.subtest-intro-card p {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.subtest-intro-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 28px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 900;
    color: var(--blue);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
}

/* ===========================
   QUESTION PAGE
   =========================== */
.question-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* Timer Bar */
.timer-bar {
    height: 4px;
    background: #e5e5e5;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
}

.timer-bar-fill {
    height: 100%;
    background: var(--green);
    transition: width 1s linear;
    border-radius: 0 2px 2px 0;
}

.timer-bar-fill.warning {
    background: var(--orange);
}

.timer-bar-fill.danger {
    background: var(--red);
    animation: pulse-bar 0.5s ease infinite alternate;
}

@keyframes pulse-bar {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Header */
.question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 8px;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.subtest-badge {
    background: var(--blue);
    color: var(--white);
    border: 2px solid var(--black);
    border-radius: 8px;
    padding: 4px 10px;
    font-weight: 800;
    font-size: 13px;
}

.question-counter {
    font-weight: 700;
    font-size: 14px;
    color: #666;
}

.timer-display {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    border: var(--border);
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 800;
    font-size: 16px;
    box-shadow: var(--shadow-sm);
}

.timer-display.warning {
    background: var(--yellow);
}

.timer-display.danger {
    background: var(--red);
    color: var(--white);
}

.timer-display.danger svg {
    stroke: var(--white);
}

/* Difficulty Badge */
.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.difficulty-badge.easy {
    background: #dcfce7;
    color: #166534;
    border: 2px solid #166534;
}

.difficulty-badge.medium {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #92400e;
}

.difficulty-badge.hard {
    background: #fecaca;
    color: #991b1b;
    border: 2px solid #991b1b;
}

/* Question */
.question-body {
    transition: all 0.3s ease;
}

.question-body.slide-out {
    opacity: 0;
    transform: translateX(-30px);
}

.question-body.slide-in {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.question-text {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: 20px;
    white-space: pre-line;
    background: var(--white);
    border: var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: var(--white);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    transition: all 0.15s ease;
}

.option-btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px var(--black);
    background: var(--cream);
}

.option-btn.selected {
    background: var(--sky);
    border-color: var(--blue);
    box-shadow: 0 0 0 2px var(--blue);
    transform: translate(1px, 1px);
}

.option-letter {
    width: 30px;
    height: 30px;
    border: 2px solid var(--black);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    background: var(--cream);
}

.option-btn.selected .option-letter {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

/* Navigation */
.question-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.question-nav .btn {
    flex: 1;
}

/* Question Dots */
.question-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.q-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--black);
    background: var(--white);
    cursor: pointer;
    transition: all 0.15s ease;
}

.q-dot.answered {
    background: var(--blue);
}

.q-dot.current {
    background: var(--yellow);
    transform: scale(1.3);
}

/* ===========================
   SUBTEST RESULT MINI
   =========================== */
.subtest-result-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

.subtest-result-card {
    background: var(--white);
    border: var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 32px 24px;
}

.subtest-result-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: var(--border);
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    color: var(--white);
    margin: 0 auto 16px;
}

.subtest-result-card h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 16px;
}

.subtest-result-score {
    margin-bottom: 16px;
}

.big-score {
    font-size: 48px;
    font-weight: 900;
    color: var(--blue);
    display: block;
}

.score-detail {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.subtest-result-bar {
    height: 16px;
    background: #e5e5e5;
    border: 2px solid var(--black);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 24px;
}

.subtest-result-bar-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 99px;
    transition: width 0.8s ease;
}

/* ===========================
   LOADING PAGE
   =========================== */
.loading-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 80px 20px;
    text-align: center;
}

.loading-card {
    background: var(--white);
    border: var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 40px 24px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e5e5;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-card h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 24px;
}

.loading-steps {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #999;
    transition: all 0.3s ease;
}

.loading-step.active {
    color: var(--blue);
}

.loading-step.done {
    color: var(--green);
}

.loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.loading-step.active .loading-dot {
    background: var(--blue);
    animation: pulse 0.6s ease infinite alternate;
}

.loading-step.done .loading-dot {
    background: var(--green);
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.3); }
}

/* ===========================
   RESULT PAGE
   =========================== */
.result-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.result-header {
    text-align: center;
    margin-bottom: 32px;
}

.result-header .logo {
    margin-bottom: 16px;
}

.result-header h1 {
    font-size: 26px;
    font-weight: 900;
}

/* Overall Score */
.result-overall-card {
    background: var(--blue);
    color: var(--white);
    border: var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 32px;
}

.overall-level {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(255,255,255,0.2);
    display: inline-block;
    padding: 6px 16px;
    border-radius: 99px;
    margin-bottom: 20px;
}

.overall-score-ring {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
}

.score-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.2);
    stroke-width: 10;
}

.ring-fill {
    fill: none;
    stroke: var(--yellow);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 1.5s ease;
}

.ring-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-pct {
    font-size: 40px;
    font-weight: 900;
    display: block;
    line-height: 1;
}

.ring-suffix {
    font-size: 18px;
    font-weight: 700;
    opacity: 0.8;
}

.overall-message {
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Sections */
.result-section {
    margin-bottom: 32px;
}

.result-section h2 {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    margin-top: -8px;
}

/* Subtest Score Cards */
.subtest-scores {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subtest-score-card {
    background: var(--white);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.subtest-score-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.subtest-score-name {
    font-weight: 700;
    font-size: 15px;
}

.subtest-score-pct {
    font-weight: 900;
    font-size: 18px;
    color: var(--blue);
}

.subtest-score-bar {
    height: 10px;
    background: #e5e5e5;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}

.subtest-score-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.8s ease;
}

.subtest-score-detail {
    font-size: 12px;
    color: #888;
    font-weight: 600;
}

.subtest-score-level {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 8px;
}

.level-good { background: #dcfce7; color: #166534; }
.level-ok { background: #fef3c7; color: #92400e; }
.level-bad { background: #fecaca; color: #991b1b; }

/* Strength / Weakness */
.strength-weakness-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 540px) {
    .strength-weakness-grid {
        grid-template-columns: 1fr;
    }
}

.sw-card {
    background: var(--white);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}

.sw-card h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 12px;
}

.sw-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.sw-item:last-child {
    border-bottom: none;
}

.sw-item-pct {
    font-weight: 800;
}

.sw-strength .sw-item-pct { color: var(--green); }
.sw-weakness .sw-item-pct { color: var(--red); }

/* Recommendations */
.rec-card {
    background: var(--white);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.rec-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rec-subtest-badge {
    padding: 4px 10px;
    border: 2px solid var(--black);
    border-radius: 8px;
    font-weight: 800;
    font-size: 12px;
}

.rec-subtest-name {
    font-weight: 700;
    font-size: 15px;
}

.rec-level-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.rec-text {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 10px;
}

.rec-resources {
    font-size: 13px;
    line-height: 1.6;
    color: #666;
    background: var(--cream);
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    padding: 10px 12px;
}

.rec-resources strong {
    color: var(--black);
}

/* Combined Analysis */
.major-analysis-card {
    background: var(--white);
    border: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
}

.major-analysis-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.major-analysis-header h3 {
    font-size: 18px;
    font-weight: 800;
}

.dual-score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.dual-score-item {
    text-align: center;
    padding: 12px;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
}

.dual-score-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}

.dual-score-value {
    font-size: 28px;
    font-weight: 900;
}

.dual-score-value.minat { color: var(--purple); }
.dual-score-value.akademik { color: var(--blue); }

.major-advice {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    padding: 12px;
    background: var(--cream);
    border: 2px solid var(--orange);
    border-radius: 8px;
    margin-bottom: 12px;
}

.major-subtests-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subtest-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid;
}

.subtest-chip.strong {
    background: #dcfce7;
    border-color: #166534;
    color: #166534;
}

.subtest-chip.moderate {
    background: #fef3c7;
    border-color: #92400e;
    color: #92400e;
}

.subtest-chip.weak {
    background: #fecaca;
    border-color: #991b1b;
    color: #991b1b;
}

/* Wrong Answers Review */
.wrong-subtest-group {
    margin-bottom: 20px;
}

.wrong-subtest-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--blue);
}

.wrong-card {
    background: var(--white);
    border: var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
}

.wrong-card-question {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 10px;
    white-space: pre-line;
}

.wrong-answers-row {
    display: flex;
    gap: 12px;
    font-size: 13px;
    margin-bottom: 8px;
}

.wrong-yours {
    flex: 1;
    padding: 8px 10px;
    background: #fecaca;
    border-radius: 6px;
    font-weight: 600;
}

.wrong-correct {
    flex: 1;
    padding: 8px 10px;
    background: #dcfce7;
    border-radius: 6px;
    font-weight: 600;
}

.wrong-explanation {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
    padding: 10px 12px;
    background: var(--cream);
    border-radius: 6px;
    border-left: 3px solid var(--blue);
}

/* CTA Section */
.result-cta-section {
    margin-top: 40px;
}

.result-cta-card {
    background: var(--yellow);
    border: var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 32px 24px;
    text-align: center;
}

.result-cta-card h3 {
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 8px;
}

.result-cta-card p {
    font-size: 15px;
    color: #444;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ===========================
   TOAST
   =========================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--black);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    z-index: 1000;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 480px) {
    .start-card h1 {
        font-size: 24px;
    }

    .question-text {
        font-size: 15px;
        padding: 16px;
    }

    .result-header h1 {
        font-size: 22px;
    }

    .big-score {
        font-size: 40px;
    }

    .dual-score-value {
        font-size: 24px;
    }
}
