@import url('../theme.css?v=20260803d');

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

body.es-app {
    min-height: 100vh;
    padding: 0;
}

body.es-app .container {
    overflow: visible;
}

body.es-app .quiz-resume-note {
    margin: 0;
    padding: 12px 20px;
    background: var(--es-brand-soft);
    border-bottom: 1px solid #d4bc6a;
    color: var(--es-learn-heading);
    font-size: var(--es-font-size-sm);
    font-weight: 600;
    text-align: center;
}

body.es-app .score-display {
    background: var(--es-learn-panel-bg);
    padding: 14px 20px;
    text-align: center;
    font-size: var(--es-font-size-base);
    color: var(--es-learn-heading);
    font-weight: 600;
    border-bottom: 2px solid #9eb8d9;
}

body.es-app .score-display span {
    color: var(--es-learn-stat);
    font-weight: 800;
}

body.es-app main:not(.training-slide) {
    padding: 28px 24px 36px;
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow);
    margin-top: 0;
}

body.es-app .module-nav + .score-display + main:not(.training-slide),
body.es-app .module-nav + main:not(.training-slide) {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}

body.es-app .module-nav {
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-bottom: none;
    border-radius: var(--es-radius) var(--es-radius) 0 0;
    box-shadow: var(--es-shadow);
}

body.es-app #questionDisplay {
    margin-bottom: 24px;
    font-family: var(--es-font-heading);
    font-size: 1.25rem;
    line-height: 1.65;
    color: var(--es-learn-heading);
    font-weight: 700;
    padding: 16px 18px;
    background: var(--es-accent-soft);
    border-left: 4px solid var(--es-learn-subheading);
    border-radius: 0 var(--es-radius-sm) var(--es-radius-sm) 0;
}

body.es-app #answersDisplay {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.es-app .answer-btn {
    background: var(--es-surface);
    border: 2px solid #c5daf0;
    padding: 16px 18px;
    border-radius: var(--es-radius-sm);
    cursor: pointer;
    text-align: left;
    font-size: var(--es-font-size-base);
    line-height: 1.55;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    color: var(--es-text);
    font-family: var(--es-font-ui);
    font-weight: 500;
}

body.es-app .answer-btn:hover:not(:disabled):not(.answer-btn-wrong) {
    background: var(--es-learn-panel-bg);
    border-color: var(--es-learn-subheading);
    color: var(--es-learn-heading);
}

body.es-app .answer-btn-wrong {
    opacity: 0.55;
    border-color: rgba(180, 35, 24, 0.35) !important;
    background: #fdecec !important;
}

body.es-app .exit-container {
    text-align: center;
    padding: 36px 24px;
    background: var(--es-surface);
    border: 1px solid var(--es-border);
    border-radius: var(--es-radius);
    box-shadow: var(--es-shadow);
}

body.es-app .exit-container h3 {
    margin-bottom: 16px;
    font-family: var(--es-font-heading);
    color: var(--es-learn-subheading);
    font-size: 1.35rem;
    font-weight: 700;
}

body.es-app .exit-container p {
    color: var(--es-text);
    font-size: var(--es-font-size-base);
}

body.es-app .quiz-result-pass {
    color: var(--es-success);
    font-weight: 600;
}

body.es-app .quiz-result-fail {
    color: var(--es-danger);
    font-weight: 600;
}

body.es-app .exit-actions button,
body.es-app .exit-container button,
body.es-app .exit-actions a.btn-exit-link,
body.es-app .exit-container a.btn-exit-link {
    background: var(--es-accent);
    color: #fff;
    border: 1px solid var(--es-accent);
}

body.es-app .exit-actions .btn-secondary {
    background: var(--es-surface);
    color: var(--es-text);
    border: 1px solid var(--es-border);
}

body.es-app .exit-actions button:hover,
body.es-app .exit-container button:hover,
body.es-app .exit-actions a.btn-exit-link:hover,
body.es-app .exit-container a.btn-exit-link:hover {
    background: var(--es-accent-hover);
}

body.es-app .exit-actions .btn-secondary:hover {
    background: var(--es-surface-muted);
}

body.es-app .saved-notice {
    color: var(--es-success);
}

body.es-app #exitButton {
    background: var(--es-accent);
}

body.es-app #exitButton:hover {
    background: var(--es-accent-hover);
}

body.es-app .citation {
    color: var(--es-accent);
}

.answer-btn:active {
    transform: scale(0.99);
}

.answer-btn:disabled {
    cursor: not-allowed;
}

.answer-btn-wrong:hover {
    background: rgba(220, 53, 69, 0.12) !important;
    border-color: rgba(220, 53, 69, 0.5) !important;
}

.feedback-retry-note {
    margin: 12px 0 0;
    font-size: 0.95em;
    font-weight: normal;
    color: var(--es-learn-heading);
}

body.es-app .modal-content {
    background-color: #fff;
    border-top: 4px solid var(--es-learn-subheading);
}

#feedbackText {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.correct-answer {
    color: var(--es-success);
}

.incorrect-answer {
    color: var(--es-danger);
}

#feedbackDetails {
    font-size: 1em;
    line-height: 1.7;
    color: var(--es-text);
}

#feedbackDetails strong {
    color: var(--es-learn-heading);
}

.feedback-cancel-btn {
    padding: 10px 20px;
    border: 2px solid var(--es-accent);
    border-radius: 6px;
    background: var(--es-learn-panel-bg);
    color: var(--es-learn-heading);
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
}

.feedback-cancel-btn:hover {
    background: var(--es-accent);
    color: #fff;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background-color: white;
    margin: auto;
    padding: 24px;
    border-radius: var(--es-radius, 8px);
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.25);
    max-width: min(600px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: slideIn 0.3s ease;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -55%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

#feedbackText {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.correct-answer {
    color: #28a745;
}

.incorrect-answer {
    color: #dc3545;
}

#feedbackDetails {
    font-size: 1em;
    line-height: 1.7;
    color: #333;
}

#feedbackDetails p {
    margin-bottom: 12px;
}

#feedbackDetails strong {
    color: var(--es-text, #0f2a44);
}

.feedback-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #dee2e6;
}

.feedback-cancel-btn {
    padding: 10px 20px;
    border: 1px solid #adb5bd;
    border-radius: 6px;
    background: #f8f9fa;
    color: #333;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
}

.feedback-cancel-btn:hover {
    background: #e9ecef;
}

.reset-confirm-modal {
    z-index: 1100;
}

.reset-confirm-content {
    text-align: left;
}

.reset-confirm-content h3 {
    font-size: 1.35em;
    color: #9a7b1a;
    margin-bottom: 16px;
}

.reset-confirm-message {
    font-size: 1em;
    line-height: 1.65;
    color: #333;
    margin-bottom: 24px;
}

.reset-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.reset-confirm-btn {
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.reset-confirm-cancel {
    background: #e9ecef;
    color: #1a2332;
}

.reset-confirm-cancel:hover {
    background: #dee2e6;
}

.reset-confirm-ok {
    background: #c0392b;
    color: white;
}

.reset-confirm-ok:hover {
    background: #a93226;
}

em {
    font-style: italic;
}

#exitButton {
    background: #2b6cb0;
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.1em;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s ease;
}

#exitButton:hover {
    background: #1e4f85;
}

.exit-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    margin-top: 20px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.exit-actions button,
.exit-container button,
.exit-actions a.btn-exit-link,
.exit-container a.btn-exit-link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    border: none;
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 600px) {
    body.es-app header h1 {
        font-size: 1.6rem;
    }

    body.es-app header h2 {
        font-size: 1rem;
    }

    .modal-content {
        max-width: 90vw;
        padding: 20px;
    }

    body.es-app main {
        padding: 20px 16px;
    }

    .answer-btn {
        padding: 14px 16px;
        font-size: 0.95em;
    }
}
