/* ========================================
   PRINCE2 Lernplattform — Styles
   ======================================== */

:root {
    --bg: #f5f3f0;
    --surface: #ffffff;
    --surface-alt: #faf9f7;
    --border: #e8e4df;
    --border-light: #f0ece7;
    --text: #1a1714;
    --text-secondary: #6b6560;
    --text-muted: #9e9790;
    --accent: #2d5a27;
    --accent-light: #e8f0e7;
    --accent-hover: #234a1f;
    --danger: #b33d3d;
    --danger-light: #fdf0f0;
    --success: #2d5a27;
    --success-light: #e8f0e7;
    --warning: #a67c00;
    --warning-light: #fef9e7;
    --nav-answered: #2d5a27;
    --nav-current: #1a1714;
    --nav-unanswered: #e8e4df;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(26, 23, 20, 0.06);
    --shadow-md: 0 4px 16px rgba(26, 23, 20, 0.08);
    --shadow-lg: 0 8px 32px rgba(26, 23, 20, 0.1);
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- SCREEN MANAGEMENT ---- */
.screen { display: none; }
.screen.active { display: block; }

/* ========================================
   LOGIN / AUTH SCREEN
   ======================================== */
#login-screen {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(45, 90, 39, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(166, 124, 0, 0.04) 0%, transparent 50%),
        var(--bg);
}
#login-screen.active { display: flex; }

.auth-container {
    max-width: 440px;
    width: 100%;
}

.auth-logo {
    margin-bottom: 1.5rem;
}
.auth-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}
.auth-title span {
    font-weight: 300;
    font-style: italic;
    color: var(--text-secondary);
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.auth-form { /* container for each form variant */ }

.form-group {
    margin-bottom: 1.25rem;
}
.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    color: var(--text);
}
.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.12);
}
.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(179, 61, 61, 0.1);
}
/* .form-error styles moved to bottom of file */

.form-static {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    background: var(--surface-alt);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
}

/* Password display card */
.password-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
.password-card-icon {
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.password-card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.password-card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}
.password-value-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.password-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'DM Sans', monospace;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    user-select: all;
}
.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.copy-feedback {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
    height: 1.2rem;
}
.copy-feedback.visible { opacity: 1; }

.auth-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.4;
}
.auth-hint.warning {
    color: var(--warning);
    margin-top: 1rem;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-full { width: 100%; }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-outline:hover {
    border-color: var(--text-secondary);
    color: var(--text);
}

.btn-sm {
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-body);
    cursor: pointer;
    padding: 0.5rem;
    margin-top: 0.75rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}
.btn-text:hover { color: var(--danger); }

/* ========================================
   APP HEADER (shared for dashboard/learn)
   ======================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    min-height: 56px;
}
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.header-mode-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
}
.brand-text {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.btn-header {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-header:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s;
}
.btn-back:hover { color: var(--text); }

.learn-counter {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ========================================
   DASHBOARD
   ======================================== */
#dashboard-screen.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.dashboard-main {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.dashboard-welcome {
    margin-bottom: 2rem;
}
.welcome-title {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}
.welcome-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.stat-card-dash {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.1rem 1rem;
    text-align: center;
    transition: box-shadow 0.2s;
}
.stat-card-dash:hover { box-shadow: var(--shadow-sm); }
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
}
.stat-icon-total { background: #eef0f8; color: #4a5a8a; }
.stat-icon-done { background: var(--warning-light); color: var(--warning); }
.stat-icon-correct { background: var(--success-light); color: var(--success); }
.stat-icon-exams { background: #f3eef8; color: #7a5aaf; }

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 0.2rem;
}
.stat-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Progress overview */
.progress-overview {
    margin-bottom: 1.5rem;
}
.progress-overview-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.progress-bar-track {
    height: 4px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
}
.progress-bar-track.large { height: 8px; }
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 100px;
    transition: width 0.4s ease;
}

/* Extra stats row */
.dash-extra-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.85rem 1rem;
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.extra-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.extra-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.extra-stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

/* Mode Cards */
.mode-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.mode-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.25rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s;
}
.mode-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.mode-card-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mode-learn .mode-card-icon { background: var(--accent-light); color: var(--accent); }
.mode-exam .mode-card-icon { background: #eef0f8; color: #4a5a8a; }
.mode-resume .mode-card-icon { background: var(--warning-light); color: var(--warning); }

.mode-card-content { flex: 1; }
.mode-card-content h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.2rem;
}
.mode-card-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.mode-card-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.mode-card:hover .mode-card-arrow { transform: translateX(3px); }

/* ========================================
   LEARN MODE
   ======================================== */
#learn-screen.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.learn-main {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.learn-progress-section {
    margin-bottom: 1.25rem;
}

.learn-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.learn-question-number {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.35rem;
}
.learn-reference {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.learn-question-text {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 1.5rem;
    white-space: pre-line;
}

/* Learn answers */
.learn-answers {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.learn-answer-option {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.learn-answer-option:hover:not(.disabled) {
    border-color: var(--accent);
    background: var(--accent-light);
}
.learn-answer-option.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}
.learn-answer-option.disabled {
    cursor: default;
}
.learn-answer-option.correct-answer {
    border-color: var(--success);
    background: var(--success-light);
}
.learn-answer-option.wrong-answer {
    border-color: var(--danger);
    background: var(--danger-light);
}

.learn-answer-marker {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: all 0.15s;
    background: var(--surface);
    font-size: 0.75rem;
    font-weight: 700;
}
.learn-answer-option.selected .learn-answer-marker {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.learn-answer-option.correct-answer .learn-answer-marker {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.learn-answer-option.wrong-answer .learn-answer-marker {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.learn-answer-text {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text);
    padding-top: 1px;
}

/* Feedback */
.learn-feedback {
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.feedback-status {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.feedback-status.correct { color: var(--success); }
.feedback-status.wrong { color: var(--danger); }
.feedback-status.partial { color: var(--warning); }
.feedback-explanation {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Learn actions */
.learn-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.btn-bookmark {
    margin-left: auto;
}
.btn-bookmark.active {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning);
}
.btn-bookmark.active svg {
    fill: var(--warning);
}

.learn-nav-strip {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

/* ========================================
   EXAM SCREEN
   ======================================== */
#exam-screen {
    min-height: 100vh;
}
#exam-screen.active {
    display: flex;
    flex-direction: column;
}

.exam-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
}
.header-participant {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.timer-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.timer-box.warning {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning);
}
.timer-box.danger {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
    animation: pulse-timer 1s ease-in-out infinite;
}
@keyframes pulse-timer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.exam-body {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.progress-section {
    margin-bottom: 1.25rem;
}
.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Question Nav */
.question-nav-wrapper {
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}
.question-nav-wrapper::-webkit-scrollbar { height: 4px; }
.question-nav-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 100px;
}
.question-nav {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: 2px solid var(--nav-unanswered);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.nav-btn:hover {
    border-color: var(--text-muted);
    color: var(--text);
}
.nav-btn.answered {
    background: var(--nav-answered);
    border-color: var(--nav-answered);
    color: #fff;
}
.nav-btn.current {
    border-color: var(--nav-current);
    color: var(--nav-current);
    box-shadow: 0 0 0 2px rgba(26, 23, 20, 0.15);
}
.nav-btn.current.answered {
    background: var(--nav-answered);
    border-color: var(--nav-current);
    color: #fff;
}

/* Question Cards */
.question-card {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.question-card.active {
    display: block;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-number {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.question-text {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 1.5rem;
    white-space: pre-line;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.answer-option:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.answer-option.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}

.answer-checkbox {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: all 0.15s;
    background: var(--surface);
}
.answer-option.selected .answer-checkbox {
    background: var(--accent);
    border-color: var(--accent);
}
.answer-checkbox svg {
    opacity: 0;
    transition: opacity 0.15s;
}
.answer-option.selected .answer-checkbox svg {
    opacity: 1;
}

.answer-label {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text);
    padding-top: 1px;
}

/* Exam bottom nav */
.exam-bottom-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* Submit */
.submit-section {
    text-align: center;
    margin-top: 0.5rem;
}
.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-submit:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ========================================
   RESULT SCREEN
   ======================================== */
#result-screen {
    min-height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(45, 90, 39, 0.06) 0%, transparent 50%),
        var(--bg);
}
#result-screen.active { display: flex; }

.result-container {
    max-width: 520px;
    width: 100%;
    text-align: center;
}

.result-header-section { margin-bottom: 2rem; }
.result-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    margin-bottom: 1rem;
    background: var(--accent-light);
    color: var(--accent);
}
.result-badge.pass { background: var(--success-light); color: var(--success); }
.result-badge.fail { background: var(--danger-light); color: var(--danger); }
.result-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.result-participant {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.score-circle-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}
.score-circle {
    position: relative;
    width: 160px;
    height: 160px;
}
.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.score-ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}
.score-ring-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 1.5s ease;
}

.score-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-percent {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.score-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 0.75rem;
}
.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.result-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   REVIEW SCREEN
   ======================================== */
#review-screen.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Review reuses learn-card styles plus these: */
.review-answer-option {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    user-select: none;
}
.review-answer-option.correct-answer {
    border-color: var(--success);
    background: var(--success-light);
}
.review-answer-option.wrong-selected {
    border-color: var(--danger);
    background: var(--danger-light);
}
.review-answer-option.user-selected {
    border-color: var(--accent);
    background: var(--accent-light);
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(26, 23, 20, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeInModal 0.2s ease;
}
@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.modal-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.modal-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.modal-btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
}
.modal-btn:hover { border-color: var(--text-secondary); }
.modal-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.modal-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.modal-btn.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.modal-btn.danger:hover {
    background: #993333;
    border-color: #993333;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
    .auth-title { font-size: 2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-number { font-size: 1.25rem; }
    .welcome-title { font-size: 1.5rem; }
    .exam-header { padding: 0.7rem 1rem; }
    .header-participant { display: none; }
    .question-card { padding: 1.25rem; }
    .learn-card { padding: 1.25rem; }
    .nav-btn { width: 32px; height: 32px; font-size: 0.75rem; }
    .result-stats { grid-template-columns: 1fr; gap: 0.5rem; }
    .result-title { font-size: 1.6rem; }
    .brand-text { display: none; }
    .header-center { position: static; transform: none; }
    .dash-extra-stats { gap: 1rem; }
}

@media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .mode-card { padding: 1rem; }
}

/* ========================================
   AUTH TABS
   ======================================== */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.auth-tab {
    flex: 1;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: none;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.auth-tab.active {
    background: var(--accent);
    color: #fff;
}
.auth-tab:not(.active):hover {
    background: var(--surface-alt);
}

/* ========================================
   PASSWORD REQUIREMENTS
   ======================================== */
.password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-top: 0.5rem;
}
.pw-req {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: color 0.2s;
}
.pw-req.met {
    color: var(--success);
}
.pw-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.2s;
}
.pw-req.met .pw-dot {
    background: var(--success);
}

/* ========================================
   FORM ERROR GLOBAL
   ======================================== */
.form-error {
    display: none;
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.35rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    background: var(--danger-light);
    border-radius: var(--radius-sm);
}
.form-error.visible { display: block; }

/* ========================================
   MODE CARD BOOKMARKS
   ======================================== */
.mode-card.mode-bookmarks {
    border-left-color: var(--warning);
}
.mode-card.mode-bookmarks .mode-card-icon {
    color: var(--warning);
}
