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

:root {
    --primary: #1a6b3c;
    --primary-dark: #145230;
    --primary-light: #e8f5e9;
    --accent: #c9a84b;
    --accent-light: #f5eec9;
    --bg: #f8faf8;
    --card: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #e0e0e0;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ===== LOGIN PAGE ===== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a6b3c 0%, #145230 50%, #0f3d25 100%);
    padding: 20px;
}

.login-container {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 440px;
    padding: 40px 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 8px;
}

.login-header h1 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"],
.login-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    outline: none;
    background: #fff;
}

.login-form input:focus,
.login-form select:focus {
    border-color: var(--accent);
}

.role-selector {
    display: flex;
    gap: 12px;
}

.role-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.role-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.role-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(26,107,60,0.15);
}

.role-card input { display: none; }
.role-icon { font-size: 28px; }
.role-label { font-weight: 600; font-size: 14px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #219a52; }

.btn-warning {
    background: var(--warning);
    color: white;
}
.btn-warning:hover { background: #e08e0b; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; padding: 14px; font-size: 16px; }

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-light);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover { text-decoration: underline; }

.login-back { margin-top: 12px; }

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* ===== DASHBOARD ===== */
.dash-body {
    background: var(--bg);
}

.dash-nav {
    background: var(--primary);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.dash-nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.dash-brand {
    color: white;
    font-size: 18px;
    font-weight: 700;
}

.dash-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-avatar {
    font-size: 24px;
    color: white;
}

.dash-username {
    color: white;
    font-weight: 500;
    font-size: 14px;
}

.dash-user .btn-outline {
    border-color: rgba(255,255,255,0.5);
    color: white;
    padding: 4px 12px;
    font-size: 12px;
}

.dash-user .btn-outline:hover {
    background: white;
    color: var(--primary);
}

.dash-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px;
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, #1e7e47 100%);
    color: white;
    border-radius: var(--radius);
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}

.welcome-text h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.welcome-text p {
    font-size: 14px;
    opacity: 0.9;
}

.welcome-stats {
    display: flex;
    gap: 12px;
}

.stat-badge {
    background: rgba(255,255,255,0.15);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.progress-section {
    margin: 20px 0;
}

.progress-bar-bg {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border-radius: 4px;
    transition: width 1s ease;
}

.progress-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 6px;
    text-align: right;
}

/* ===== TANGGA (STAIRCASE) ===== */
.section-title {
    font-size: 20px;
    margin-bottom: 4px;
    color: var(--text);
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.tangga-container {
    margin-top: 8px;
}

.tangga-step {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--border);
    transition: all 0.2s;
}

.tangga-step:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.tangga-step.status-passed {
    border-left-color: var(--success);
}

.tangga-step.status-active {
    border-left-color: var(--accent);
    background: #fffbf0;
}

.tangga-step.status-locked {
    border-left-color: #ccc;
    opacity: 0.7;
}

.tangga-step.status-ready {
    border-left-color: var(--primary);
}

.tangga-number {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-num {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.tangga-body {
    flex: 1;
}

.tangga-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.tangga-header h4 {
    font-size: 16px;
    color: var(--text);
}

.tangga-badge {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 50px;
    font-weight: 600;
}

.badge-lulus { background: #d4edda; color: #155724; }
.badge-sedang { background: #fff3cd; color: #856404; }
.badge-terkunci { background: #f8d7da; color: #721c24; }
.badge-belum { background: #e8f5e9; color: #1a6b3c; }
.badge-selesai { background: #cce5ff; color: #004085; }

.tangga-desc {
    font-size: 13px;
    color: var(--text-light);
    margin: 4px 0 8px;
}

.tangga-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.tangga-action {
    min-width: 120px;
    text-align: center;
}

.start-btn {
    animation: pulse-btn 2s infinite;
}

@keyframes pulse-btn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(26,107,60,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(26,107,60,0); }
}

.terkunci-hint {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ===== SOAL (QUESTION) ===== */
.soal-body {
    background: #f5f7fa;
}

.soal-topbar {
    background: var(--primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.soal-topbar-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.soal-info {
    display: flex;
    gap: 16px;
    align-items: center;
}

.soal-module-title {
    font-weight: 700;
    font-size: 15px;
}

.soal-user {
    font-size: 13px;
    opacity: 0.8;
}

.soal-timer {
    background: rgba(255,255,255,0.2);
    padding: 6px 18px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    transition: background 0.3s;
}

.soal-progress-bg {
    height: 4px;
    background: rgba(255,255,255,0.2);
}

.soal-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.5s ease;
}

.soal-progress-label {
    max-width: 900px;
    margin: 0 auto;
    padding: 4px 20px;
    font-size: 12px;
    opacity: 0.8;
    text-align: right;
}

.soal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
}

.soal-card {
    display: none;
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    flex: 1;
}

.soal-card.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.soal-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    display: inline-block;
    padding: 2px 12px;
    border-radius: 50px;
    margin-bottom: 16px;
}

.soal-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

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

.option-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-card:hover {
    border-color: var(--primary);
    background: #f0f8f2;
}

.option-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-card input { display: none; }

.option-label {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--text);
}

.option-card.selected .option-label {
    background: var(--primary);
    color: white;
}

.option-text {
    font-size: 16px;
    color: var(--text);
}

.soal-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Navigator Cepat */
.soal-navigator {
    width: 120px;
    min-width: 120px;
}

.navigator-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    text-align: center;
}

.navigator-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.nav-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-dot.answered {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.nav-dot.current {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ===== HASIL (RESULT) ===== */
.hasil-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.hasil-header {
    text-align: center;
    padding: 40px 20px 30px;
}

.hasil-lulus { background: linear-gradient(135deg, #27ae60, #1e8449); color: white; }
.hasil-gagal { background: linear-gradient(135deg, #e74c3c, #c0392b); color: white; }
.hasil-terkunci { background: linear-gradient(135deg, #7f8c8d, #636e72); color: white; }

.hasil-icon { font-size: 48px; margin-bottom: 12px; }
.hasil-header h2 { font-size: 22px; margin-bottom: 8px; }

.hasil-skor { margin: 16px 0; }
.skor-angka { font-size: 64px; font-weight: 800; }
.skor-label { font-size: 24px; opacity: 0.7; }

.hasil-status-text { font-size: 14px; opacity: 0.9; margin-bottom: 8px; }
.hasil-status-badge {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
}

.hasil-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 24px;
    background: var(--bg);
}

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

.stat-icon { font-size: 24px; display: block; }
.stat-val { display: block; font-size: 20px; font-weight: 700; color: var(--text); margin: 4px 0; }
.stat-label { font-size: 12px; color: var(--text-light); }

.hasil-action {
    padding: 20px;
    text-align: center;
}

.terkunci-msg {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* Review */
.review-section { margin: 24px 0; }

.review-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--danger);
}

.review-card.correct { border-left-color: var(--success); }
.review-card.wrong { border-left-color: var(--danger); }

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

.review-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 50px;
}

.review-status { font-size: 14px; font-weight: 600; }
.review-question { font-size: 15px; margin-bottom: 12px; }

.review-answers {
    display: flex;
    gap: 20px;
    font-size: 13px;
    margin-bottom: 12px;
}

.jawab-user { color: var(--text); }
.jawab-kunci { color: var(--success); }

.review-pembahasan {
    background: #f0f7f3;
    border-radius: 8px;
    padding: 14px;
    border-left: 3px solid var(--accent);
}

.pembahasan-label {
    font-weight: 700;
    font-size: 13px;
    color: var(--primary);
}

.review-pembahasan p { font-size: 13px; color: var(--text); margin-top: 4px; }

/* ===== PARENT ===== */
.anak-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.anak-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 24px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    min-width: 160px;
}

.anak-card:hover, .anak-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.anak-avatar { font-size: 36px; }
.anak-nama { font-weight: 700; font-size: 15px; }
.anak-nis { font-size: 12px; color: var(--text-light); }
.anak-sekolah { font-size: 11px; color: var(--text-light); }

.progress-ring-section { margin: 20px 0; }

.ring-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: var(--shadow);
}

.ring-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.ring-info h4 { font-size: 18px; margin-bottom: 4px; }
.ring-info p { font-size: 14px; color: var(--text-light); }
.text-warning { color: var(--warning); font-weight: 600; }

.progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--card);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    gap: 12px;
}

.progress-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.progress-icon { font-size: 20px; }
.progress-nama { font-weight: 600; font-size: 14px; }
.progress-status { font-size: 11px; padding: 2px 10px; border-radius: 50px; font-weight: 600; white-space: nowrap; }

.progress-item-action { min-width: 100px; text-align: right; }

.log-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

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

.log-icon { font-size: 16px; }
.log-date { color: var(--text-light); font-size: 12px; margin-left: auto; }
.log-alasan { color: var(--text-light); font-size: 12px; font-style: italic; }

/* ===== UTILITY ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group { flex: 1; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.hint {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

.dash-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade { animation: fadeIn 0.4s ease; }
.animate-slide-up {
    animation: fadeInUp 0.4s ease both;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .welcome-card { flex-direction: column; text-align: center; }
    .welcome-stats { justify-content: center; }
    
    .tangga-step { flex-direction: column; text-align: center; gap: 12px; }
    .tangga-header { justify-content: center; }
    .tangga-meta { justify-content: center; }
    .tangga-action { min-width: auto; }
    
    .form-row { flex-direction: column; gap: 0; }
    
    .soal-container { flex-direction: column; }
    .soal-navigator { width: 100%; order: -1; }
    .navigator-grid { justify-content: center; }
    
    .hasil-stats { flex-wrap: wrap; }
    .ring-card { flex-direction: column; text-align: center; }
    .progress-item { flex-direction: column; text-align: center; }
    .progress-item-action { width: 100%; text-align: center; }
    
    .anak-grid { justify-content: center; }
}
