/* Mercury Insurance IT Assessment — Core Styles */

:root {
    --mercury-blue: #003366;
    --mercury-blue-light: #004d99;
    --mercury-gold: #C5A03F;
    --mercury-gold-light: #d4b561;
    --bg-primary: #f5f6fa;
    --bg-white: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --border: #ddd;
    --success: #27ae60;
    --danger: #c0392b;
    --warning: #f39c12;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

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

body {
    font-family: 'Segoe UI', Calibri, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.screen { display: none !important; }
.screen.active { display: flex !important; }

/* ============ WELCOME SCREEN ============ */
#welcome-screen {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--mercury-blue) 0%, #001a33 100%);
    padding: 20px;
}

#assessment-screen.active { display: block !important; }
#results-screen.active { display: block !important; }

.welcome-container {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 48px;
    max-width: 640px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.welcome-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo-svg { width: 180px; height: 50px; }
.logo-svg-sm { width: 140px; height: 36px; }

.welcome-badge {
    background: var(--mercury-gold);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 4px 10px;
    border-radius: 4px;
}

.welcome-container h1 {
    font-size: 28px;
    color: var(--mercury-blue);
    margin-bottom: 4px;
}

.welcome-container h2 {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 28px;
}

.welcome-info {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
}

.info-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 14px;
}

.info-icon {
    font-size: 24px;
    min-width: 36px;
    text-align: center;
}

.info-text {
    display: flex;
    flex-direction: column;
}

.info-text strong { font-size: 14px; color: var(--mercury-blue); }
.info-text span { font-size: 11px; color: var(--text-muted); }

.welcome-sections {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 28px;
}

.welcome-sections h3 {
    font-size: 14px;
    color: var(--mercury-blue);
    margin-bottom: 8px;
}

.welcome-sections ol {
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    columns: 2;
}

.welcome-sections li { margin-bottom: 4px; }

.form-group {
    margin-bottom: 16px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--mercury-blue);
}

/* ============ BUTTONS ============ */
.btn-primary {
    background: var(--mercury-blue);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-primary:hover { background: var(--mercury-blue-light); }

.btn-secondary {
    background: transparent;
    color: var(--mercury-blue);
    border: 2px solid var(--mercury-blue);
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--mercury-blue);
    color: #fff;
}

.btn-submit {
    background: var(--mercury-gold);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-submit:hover { background: var(--mercury-gold-light); }

/* ============ ASSESSMENT HEADER ============ */
.assessment-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-white);
    padding: 12px 24px;
    border-bottom: 2px solid var(--mercury-blue);
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.header-center { flex: 1; display: flex; justify-content: center; }

.section-tabs {
    display: flex;
    gap: 4px;
}

.section-tab {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    white-space: nowrap;
}

.section-tab:hover { background: #e8e9ee; }

.section-tab.active {
    background: var(--mercury-blue);
    color: #fff;
}

.section-tab.completed {
    background: #e8f5e9;
    color: var(--success);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timer {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--mercury-blue);
    background: var(--bg-primary);
    padding: 8px 16px;
    border-radius: var(--radius);
    min-width: 90px;
    text-align: center;
}

.timer.warning { color: var(--warning); background: #fff8e1; }
.timer.danger { color: var(--danger); background: #fde8e8; animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.candidate-name-display {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============ ASSESSMENT MAIN ============ */
.assessment-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 22px;
    color: var(--mercury-blue);
    margin-bottom: 8px;
}

.section-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

#question-counter {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--mercury-gold);
    border-radius: 3px;
    transition: width 0.3s;
    width: 0%;
}

/* ============ QUESTION CONTAINER ============ */
.question-container {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
    min-height: 400px;
}

.question-scenario {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #f0f4f8;
    border-left: 4px solid var(--mercury-blue);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* MCQ Styles */
.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.mcq-option:hover {
    border-color: var(--mercury-blue-light);
    background: #f0f4f8;
}

.mcq-option.selected {
    border-color: var(--mercury-blue);
    background: #e8eef5;
}

.mcq-option input[type="radio"],
.mcq-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--mercury-blue);
}

.mcq-option label {
    cursor: pointer;
    flex: 1;
}

/* ============ QUESTION NAV ============ */
.question-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
}

#prev-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 36px;
    max-width: 460px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.modal h3 {
    font-size: 22px;
    color: var(--mercury-blue);
    margin-bottom: 12px;
}

.modal p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.warning-text {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    color: #856404;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ============ RESULTS SCREEN ============ */
#results-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--mercury-blue) 0%, #001a33 100%);
    padding: 40px 20px;
}

.results-container {
    max-width: 680px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 16px;
    padding: 48px;
    box-shadow: var(--shadow-lg);
}

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

.results-header h1 {
    font-size: 26px;
    color: var(--mercury-blue);
    margin: 12px 0 8px;
}

.candidate-result-name {
    font-size: 16px;
    color: var(--text-secondary);
}

.results-score-card {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 28px;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 32px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 6px solid var(--mercury-blue);
    flex-shrink: 0;
}

.score-circle.pass { border-color: var(--success); }
.score-circle.fail { border-color: var(--danger); }

.score-percentage {
    font-size: 32px;
    font-weight: 700;
    color: var(--mercury-blue);
}

.score-circle.pass .score-percentage { color: var(--success); }
.score-circle.fail .score-percentage { color: var(--danger); }

.score-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-details {
    flex: 1;
}

.score-status {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.score-status.pass { color: var(--success); }
.score-status.fail { color: var(--danger); }

.score-points, .score-time, .score-grade {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.results-breakdown {
    margin-bottom: 28px;
}

.results-breakdown h3 {
    font-size: 18px;
    color: var(--mercury-blue);
    margin-bottom: 16px;
}

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

.breakdown-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-primary);
    border-radius: var(--radius);
}

.breakdown-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
}

.breakdown-bar-container {
    flex: 2;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.breakdown-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s;
}

.breakdown-bar.excellent { background: var(--success); }
.breakdown-bar.good { background: var(--mercury-blue); }
.breakdown-bar.pass { background: var(--warning); }
.breakdown-bar.fail { background: var(--danger); }

.breakdown-score {
    font-size: 13px;
    font-weight: 700;
    min-width: 44px;
    text-align: right;
}

.results-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ============ PRINT STYLES ============ */
.print-only { display: none; }

@media print {
    .screen { display: none !important; }
    .print-only {
        display: block !important;
        padding: 20px;
        font-size: 11px;
    }
    .print-header {
        text-align: center;
        border-bottom: 2px solid #003366;
        padding-bottom: 12px;
        margin-bottom: 20px;
    }
    .print-header h1 { font-size: 18px; color: #003366; }
    .print-header h2 { font-size: 13px; color: #555; font-weight: normal; }
    .print-section { margin-bottom: 16px; page-break-inside: avoid; }
    .print-section h3 { font-size: 13px; border-bottom: 1px solid #ccc; padding-bottom: 4px; margin-bottom: 8px; }
    .print-question { margin-bottom: 10px; padding: 6px 0; border-bottom: 1px dotted #ddd; }
    .print-correct { color: #27ae60; }
    .print-wrong { color: #c0392b; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .welcome-container { padding: 28px; }
    .welcome-info { flex-direction: column; }
    .welcome-sections ol { columns: 1; }
    .assessment-header { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
    .header-center { order: 3; width: 100%; }
    .section-tabs { overflow-x: auto; width: 100%; }
    .assessment-main { padding: 16px 12px; }
    .question-container { padding: 20px; }
    .results-score-card { flex-direction: column; text-align: center; }
}
