/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f4f8;
    color: #1a2a3a;
    min-height: 100vh;
}

/* === SCREENS === */
.screen { display: flex; flex-direction: column; min-height: 100vh; }
.hidden { display: none !important; }

/* === LOGIN === */
#login-screen {
    background: linear-gradient(135deg, #0b1d3a 0%, #1a3a5c 50%, #2a5a7c 100%);
    justify-content: center; align-items: center;
}
.login-card {
    background: rgba(255,255,255,0.95); border-radius: 16px; padding: 3rem 2rem;
    text-align: center; max-width: 400px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.logo { font-size: 4rem; margin-bottom: 0.5rem; }
.login-card h1 { color: #0b1d3a; font-size: 1.6rem; margin-bottom: 0.3rem; }
.login-card .subtitle { color: #5a7a9a; font-size: 0.9rem; margin-bottom: 2rem; }
#login-form input {
    width: 100%; padding: 0.8rem 1rem; border: 2px solid #d0dae4; border-radius: 8px;
    font-size: 1rem; margin-bottom: 1rem; outline: none; transition: border-color 0.2s;
}
#login-form input:focus { border-color: #2a5a7c; }
.error { color: #d32f2f; font-size: 0.85rem; margin-top: 0.5rem; }

/* === BUTTONS === */
.btn {
    display: inline-block; padding: 0.75rem 2rem; border: none; border-radius: 8px;
    font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: #1a3a5c; color: #fff; }
.btn-primary:hover { background: #0b2d4a; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-large { width: 100%; max-width: 400px; padding: 1rem; font-size: 1.1rem; }
.btn-back {
    background: none; border: none; color: #1a3a5c; font-size: 1rem;
    cursor: pointer; padding: 0.5rem; font-weight: 600;
}
.btn-back:hover { color: #0b2d4a; }

/* === HEADER === */
header {
    background: #fff; padding: 1rem 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center; position: sticky; top: 0; z-index: 10;
}
.logo-small { font-size: 2rem; }
header h1 { color: #0b1d3a; font-size: 1.4rem; }
header h2 { color: #0b1d3a; font-size: 1.2rem; margin: 0.3rem 0; }
header .subtitle { color: #5a7a9a; font-size: 0.85rem; }

/* === PROGRESS === */
.progress-bar {
    width: 100%; max-width: 500px; height: 6px; background: #e0e8f0;
    border-radius: 3px; margin: 0.5rem auto 0.3rem;
}
.progress-fill { height: 100%; background: #2a7a5c; border-radius: 3px; transition: width 0.3s; width: 0%; }
.progress-text { color: #5a7a9a; font-size: 0.8rem; }

/* === HOME === */
.home-content { flex: 1; padding: 2rem 1.5rem; max-width: 800px; margin: 0 auto; width: 100%; }
.intro { text-align: center; color: #5a7a9a; margin-bottom: 2rem; line-height: 1.6; }
.qcm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.qcm-card {
    background: #fff; border-radius: 12px; padding: 1.5rem; text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06); cursor: pointer; transition: all 0.2s;
    border: 2px solid transparent;
}
.qcm-card:hover { border-color: #2a5a7c; transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.qcm-card .qcm-num { font-size: 2rem; font-weight: 700; color: #1a3a5c; }
.qcm-card .qcm-label { color: #5a7a9a; font-size: 0.85rem; margin-top: 0.3rem; }
.qcm-card .qcm-chapters { color: #8a9aaa; font-size: 0.75rem; margin-top: 0.5rem; line-height: 1.4; }

/* === QUIZ === */
.quiz-content { flex: 1; padding: 1rem 1.5rem; max-width: 700px; margin: 0 auto; width: 100%; }
.question-block {
    background: #fff; border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.question-text { font-weight: 700; font-size: 1rem; margin-bottom: 0.75rem; color: #0b1d3a; line-height: 1.5; }
.question-hint { font-size: 0.8rem; color: #8a9aaa; font-style: italic; margin-bottom: 0.5rem; }
.option-label {
    display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.6rem 0.8rem;
    border-radius: 8px; cursor: pointer; transition: background 0.15s; margin-bottom: 0.3rem;
}
.option-label:hover { background: #f0f4f8; }
.option-label input[type="checkbox"] {
    width: 20px; height: 20px; margin-top: 2px; accent-color: #1a3a5c; flex-shrink: 0;
}
.option-text { font-size: 0.95rem; line-height: 1.4; }
.quiz-footer {
    padding: 1rem 1.5rem; text-align: center; background: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05); position: sticky; bottom: 0;
}

/* === RESULTS === */
.results-content { flex: 1; padding: 1.5rem; max-width: 700px; margin: 0 auto; width: 100%; }
.score-card {
    background: #fff; border-radius: 16px; padding: 2rem; text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08); margin-bottom: 1.5rem;
}
.score-number { font-size: 3rem; font-weight: 800; }
.score-good { color: #2a7a5c; }
.score-ok { color: #c07a00; }
.score-bad { color: #c03030; }
.score-label { color: #5a7a9a; font-size: 1rem; margin-top: 0.3rem; }
.score-bar {
    width: 100%; height: 10px; background: #e0e8f0; border-radius: 5px; margin-top: 1rem; overflow: hidden;
}
.score-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s; }

.result-block {
    background: #fff; border-radius: 12px; padding: 1.25rem; margin-bottom: 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04); border-left: 4px solid #ccc;
}
.result-block.correct { border-left-color: #2a7a5c; }
.result-block.incorrect { border-left-color: #c03030; }
.result-question { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; color: #0b1d3a; }
.result-your-answer { font-size: 0.85rem; margin-bottom: 0.3rem; }
.result-your-answer.wrong { color: #c03030; }
.result-your-answer.right { color: #2a7a5c; }
.result-correct { font-size: 0.85rem; color: #2a7a5c; font-weight: 600; margin-bottom: 0.4rem; }

/* Result options - all 4 shown */
.result-option {
    font-size: 0.9rem; padding: 0.35rem 0.6rem; border-radius: 6px; margin-bottom: 0.2rem; line-height: 1.4;
}
.opt-correct-picked { background: #e8f5e9; color: #1b5e20; font-weight: 600; }
.opt-correct-missed { background: #e8f5e9; color: #2e7d32; font-weight: 600; }
.opt-wrong-picked { background: #fce4ec; color: #b71c1c; text-decoration: line-through; }
.opt-neutral { color: #90a4ae; }
.result-expl {
    font-size: 0.85rem; color: #5a7a9a; font-style: italic; line-height: 1.5;
    background: #f8fafb; padding: 0.5rem 0.75rem; border-radius: 6px; margin-top: 0.3rem;
}
.result-ref { font-weight: 700; color: #1a3a5c; font-style: normal; }

/* === FOOTER === */
footer { text-align: center; padding: 1.5rem; color: #8a9aaa; font-size: 0.8rem; }

/* === MOBILE === */
@media (max-width: 600px) {
    .login-card { padding: 2rem 1.5rem; }
    .qcm-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .question-text { font-size: 0.95rem; }
    .score-number { font-size: 2.5rem; }
    header h1 { font-size: 1.2rem; }
    .btn-large { font-size: 1rem; }
}
