/* Тема „Хвърчащите хора“ за изпитната система NPPL(M).
 * Само визуален слой — не променя въпроси, логика, профили или напредък.
 * Цветове и шрифт като на сайта и учебника: небесносиньо, тъмносиньо, Inter, Caveat.
 */
:root {
    --bg: #f5f8fb;
    --bg-secondary: #eef3f7;
    --border: #dbe4ec;
    --border-light: #e9eff4;
    --text: #1f2937;
    --text-secondary: #5b6472;
    --text-muted: #8a94a3;

    --primary: #1f8fc4;
    --primary-dark: #1a365d;
    --primary-light: #e8f4f8;
    --primary-gradient: linear-gradient(135deg, #3CB4E5 0%, #2898c8 100%);

    --success: #15803d;
    --success-light: #ecfdf5;
    --success-gradient: linear-gradient(135deg, #22a356 0%, #15803d 100%);
    --error: #c2410c;
    --error-light: #fff3ed;
    --error-gradient: linear-gradient(135deg, #f0753e 0%, #c2410c 100%);
    --warning: #b45309;
    --warning-light: #fff8e8;
    --info: #1f8fc4;
    --info-light: #e8f4f8;
    --info-gradient: linear-gradient(135deg, #3CB4E5 0%, #2898c8 100%);

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 2px 8px rgba(15, 23, 42, .04);
    --shadow: 0 4px 16px rgba(15, 23, 42, .07);
    --shadow-md: 0 10px 28px rgba(15, 23, 42, .10);

    --tfp-sky: #3CB4E5;
    --tfp-sky-dark: #2898c8;
    --tfp-navy: #1a365d;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: var(--bg) !important;
    padding-top: 0 !important;
    -webkit-font-smoothing: antialiased;
}

/* ---------- brand bar (added by tfp-theme.js) ---------- */
.tfp-brandbar {
    position: sticky; top: 0; z-index: 900;
    display: flex; align-items: center; gap: 14px;
    padding: 8px max(16px, calc((100vw - 1100px) / 2));
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.tfp-brandbar .tfp-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--tfp-navy); flex: none; }
.tfp-brandbar .tfp-brand img { width: 40px; height: 40px; object-fit: contain; }
.tfp-brandbar .tfp-brand span { font-family: 'Caveat', cursive; font-size: 1.4rem; font-weight: 700; white-space: nowrap; }
.tfp-brandbar .tfp-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.tfp-brandbar .tfp-title strong { color: var(--tfp-navy); font-size: 1rem; }
.tfp-brandbar .tfp-title small { color: var(--text-secondary); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tfp-brandbar .tfp-links { display: flex; gap: 8px; flex: none; }
.tfp-brandbar .tfp-links a {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
    text-decoration: none; font-weight: 600; font-size: .85rem; white-space: nowrap;
    border: 1px solid #cfe3ee; color: var(--tfp-navy); background: #fff;
}
.tfp-brandbar .tfp-links a.primary { background: var(--primary-gradient); border-color: transparent; color: #fff; }
.tfp-brandbar .tfp-links svg { width: 17px; height: 17px; }

/* ---------- header: compact hero in site colours ---------- */
.container { max-width: 1100px !important; padding: 0 16px !important; }
.header {
    background: linear-gradient(135deg, #0f2a4a 0%, #1a365d 50%, #1f5f8f 100%) !important;
    box-shadow: none !important;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
    padding: 22px 26px !important;
    margin: 0 0 22px !important;
    text-align: left !important;
}
.header .header-logo { display: none !important; }
.header h1 { font-size: 1.6rem !important; margin: 0 0 4px !important; font-weight: 800; letter-spacing: -.01em; }
.header p { font-size: 1rem !important; margin: 0 0 6px !important; color: #d6ebf6; opacity: 1 !important; }
.header > div > div:not(.nppl-badge) { font-size: .78rem !important; color: #a9cfe6; opacity: 1 !important; margin-top: 6px !important; }
.nppl-badge {
    display: inline-block; margin-top: 10px !important; padding: 5px 12px !important; border-radius: 999px !important;
    background: rgba(255, 255, 255, .12) !important; border: 1px solid rgba(255, 255, 255, .25) !important;
    font-size: .8rem !important; font-weight: 600; color: #fff !important;
}
/* while a test is running the hero is reduced to a thin strip */
body.tfp-testing .header { padding: 10px 20px !important; margin-bottom: 14px !important; }
body.tfp-testing .header p,
body.tfp-testing .header > div > div,
body.tfp-testing .header .nppl-badge { display: none !important; }
body.tfp-testing .header h1 { font-size: 1.05rem !important; margin: 0 !important; }

/* ---------- buttons ---------- */
.btn { border-radius: 999px !important; font-weight: 600 !important; box-shadow: none !important; min-width: 0 !important; }
.btn-primary { background: var(--primary-gradient) !important; color: #fff !important; box-shadow: 0 6px 16px rgba(60, 180, 229, .28) !important; }
.btn-secondary { background: #fff !important; color: var(--tfp-navy) !important; border: 1px solid var(--border) !important; }
.btn-secondary:hover:not(:disabled) { background: var(--primary-light) !important; border-color: var(--tfp-sky) !important; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid rgba(60, 180, 229, .45) !important; outline-offset: 2px;
}

/* login / register tabs → segmented pills */
#loginRegisterTabs { border-bottom: 0 !important; gap: 6px !important; padding: 5px !important; background: var(--bg-secondary); border-radius: 999px; width: fit-content; max-width: 100%; }
#loginRegisterTabs .btn { border-radius: 999px !important; padding: 10px 20px !important; box-shadow: none !important; }
#loginRegisterTabs .btn-secondary { background: transparent !important; border-color: transparent !important; }

/* ---------- cards & forms ---------- */
.student-info-section, .student-form, .settings-panel, .questions-area, .progress-container, .results-container,
.mode-card, .subject-card, .dashboard-card, .stat-card {
    border-radius: var(--radius-lg) !important;
}
.student-info-section, .progress-container, .results-container {
    background: #fff !important; border: 1px solid var(--border-light) !important; box-shadow: var(--shadow-sm) !important;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], select, textarea {
    border-radius: 12px !important; border: 1px solid var(--border) !important; font-family: inherit !important;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
    border-color: var(--tfp-sky) !important; box-shadow: 0 0 0 3px rgba(60, 180, 229, .18) !important;
}
h2, h3 { color: var(--tfp-navy); }

/* ---------- progress ---------- */
.progress-bar { background: #e6eef4 !important; border-radius: 999px !important; overflow: hidden; }
.progress-fill, .progress-bar > div { background: var(--primary-gradient) !important; border-radius: 999px !important; }

/* ---------- question & answers ---------- */
.question {
    border-radius: var(--radius-lg) !important; border: 1px solid var(--border-light) !important;
    border-left: 5px solid var(--tfp-sky) !important; box-shadow: var(--shadow-sm) !important;
    padding: 22px 24px !important;
}
.question-number { color: var(--tfp-sky-dark) !important; font-weight: 700 !important; }
.question h3, .question .question-text, .question-text { color: var(--tfp-navy) !important; font-size: 1.15rem !important; line-height: 1.5 !important; }
.answer-label {
    border-radius: 14px !important; border: 1.5px solid var(--border) !important; background: #fff !important;
    padding: 14px 16px !important; min-height: 52px; transition: border-color .15s, background .15s, transform .1s;
}
.answer-label:hover { border-color: var(--tfp-sky) !important; background: #f5fbfe !important; }
.answer-label:active { transform: scale(.995); }
.answer-label input[type="radio"] { accent-color: var(--tfp-sky-dark); width: 18px; height: 18px; }
.answer-text { font-size: 1rem !important; line-height: 1.45 !important; }
.answer-label.selected { border-color: var(--tfp-sky-dark) !important; background: var(--primary-light) !important; }
.answer-label.correct { border-color: #22a356 !important; background: #ecfdf5 !important; }
.answer-label.incorrect { border-color: #e2683a !important; background: #fff3ed !important; }

/* ---------- modals ---------- */
.mode-selection-modal-content, .modal-content, .admin-modal-content {
    border-radius: 20px !important; box-shadow: 0 30px 80px rgba(15, 23, 42, .25) !important; border: 0 !important;
}
.mode-card { border: 1.5px solid var(--border-light) !important; background: #fff !important; transition: border-color .15s, transform .15s, box-shadow .15s !important; }
.mode-card:hover { border-color: var(--tfp-sky) !important; transform: translateY(-2px); box-shadow: var(--shadow) !important; }
.mode-card h3, .mode-card h4 { color: var(--tfp-navy) !important; }

/* ---------- toasts ---------- */
.toast { border-radius: 14px !important; border-left-width: 5px !important; font-family: inherit; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
    .tfp-brandbar { gap: 8px; padding: 6px 10px; }
    .tfp-brandbar .tfp-brand span, .tfp-brandbar .tfp-title small, .tfp-brandbar .tfp-links a span { display: none; }
    .tfp-brandbar .tfp-links a { width: 36px; padding: 0; justify-content: center; }
    .container { padding: 0 10px !important; }
    .header { padding: 16px 18px !important; border-radius: 0 0 14px 14px !important; }
    .header h1 { font-size: 1.3rem !important; }
    .header p { font-size: .9rem !important; }
    .question { padding: 16px !important; }
    .question h3, .question .question-text, .question-text { font-size: 1.05rem !important; }
    .answer-label { padding: 12px 13px !important; }
    #loginRegisterTabs { width: 100%; }
    #loginRegisterTabs .btn { flex: 1 1 auto; padding: 9px 12px !important; font-size: .9rem !important; }
}
@media print { .tfp-brandbar { display: none !important; } }

/* instructions toggle (📖) sits under the brand bar */
.sidebar-toggle { top: 66px !important; left: 12px !important; background: var(--tfp-navy) !important; box-shadow: var(--shadow) !important; }
@media (max-width: 640px) { .sidebar-toggle { top: 58px !important; } }

/* user menu inside the dark header, under the brand bar */
.user-menu-container { top: 14px !important; right: 18px !important; }
.user-menu-btn { background: rgba(255,255,255,.12) !important; border-color: rgba(255,255,255,.3) !important; color: #fff !important; }
body.tfp-testing .user-menu-container { top: 4px !important; }
#mainHeader { position: relative; }
/* leave room for the 📖 button when the container touches the screen edge */
@media (max-width: 1180px) { .header { padding-left: 76px !important; } }
@media (max-width: 640px) { .header { padding-left: 70px !important; } .user-menu-container { top: 8px !important; right: 8px !important; } }
.header { overflow: visible !important; }
#headerVersion { margin-left: .3em; }
@media (max-width: 1180px) { body.tfp-testing .header { padding-left: 76px !important; } }
@media (max-width: 640px) { body.tfp-testing .header { padding-left: 70px !important; } }

/* coloured modal headers keep white titles */
.wrong-answer-header *, .correct-answer-header * { color: #fff !important; }
.header h1 { color: #fff !important; }
.wrong-answer-header { background: linear-gradient(135deg, #f0753e 0%, #c2410c 100%) !important; }
.correct-answer-header { background: linear-gradient(135deg, #22a356 0%, #15803d 100%) !important; }
.wrong-answer-content, .correct-answer-content { border-radius: 20px !important; overflow: hidden; }

/* phones: tabs in one row, header lighter, menu clear of the title */
@media (max-width: 640px) {
    #loginRegisterTabs { flex-direction: row !important; flex-wrap: nowrap !important; border-radius: 14px !important; width: 100% !important; }
    #loginRegisterTabs .btn { flex: 1 1 0 !important; min-width: 0 !important; width: auto !important; padding: 9px 4px !important; font-size: .78rem !important; white-space: normal !important; line-height: 1.2 !important; border-radius: 10px !important; }
    .header h1 { padding-right: 64px; }
    .header .nppl-badge { display: none !important; }
    .header > div > div:not(.nppl-badge) { font-size: .72rem !important; }
    .user-menu-container .user-name { display: none !important; }
}
.question-timer, .timer, #timer { font-family: inherit !important; font-variant-numeric: tabular-nums; }
