/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* The brand orange, dark enough for white text on it and for text on white or grey (5.1:1 and 4.7:1, WCAG AA);
       the original bright orange stays for decoration only */
    --orange: #B0540B;
    --orange-bright: #E8751A;
    --orange-light: #FFF3E8;
    --orange-dark: #8A430A;
    --focus: #8A430A;
    /* Links: one colour everywhere (7.6:1 on white), never the browser's blue */
    --link: var(--orange-dark);
    --grey-bg: #f5f5f5;
    --grey-light: #eee;
    --grey-border: #d0d0d0;
    --grey-dark: #555;
    --text: #222;
    --text-muted: #666;
    --white: #fff;
    /* Danger and success: errors, deletions, «certo» (all AA on white and on their own backgrounds) */
    --danger: #c0392b;
    --danger-dark: #8b2020;
    --danger-bg: #fde8e8;
    --danger-border: #e08080;
    --success-dark: #1b5e20;
    --success-bg: #e8f5e9;
    --radius: 8px;
}

html { font-size: 16px; }
body { font-family: 'Segoe UI', Arial, sans-serif; color: var(--text); background: var(--grey-bg); }
/* Every link in one colour, underlined (class rules such as .btn, the sidebar or the guide cards set their own) */
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--orange); }
summary { cursor: pointer; }

/* ── Site Header ──────────────────────────────────────────────────────── */
.site-header {
    background: var(--orange);
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-brand { font-size: 1.3rem; font-weight: 700; letter-spacing: 0.04em; }

/* ── Admin sidebar (Pages/Admin/AdminNav, _Layout) ────────────────────── */
.admin-shell { display: flex; align-items: flex-start; min-height: 100vh; }
.admin-shell > .page-content { flex: 1 1 auto; min-width: 0; }
.sidebar {
    order: -1; /* after the content in the document, on its left on screen */
    flex: 0 0 230px;
    width: 230px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Neutral, so the orange marks only where she is (the active item) and the page's main action */
    background: var(--white);
    color: var(--text);
    border-right: 1px solid var(--grey-border);
}
.sidebar-brand { display: block; padding: 1.25rem 1.25rem 1rem; color: var(--orange); text-decoration: none; border-top: 4px solid var(--orange); }
.sidebar-brand:hover { color: var(--orange-dark); }
.sidebar-name { display: block; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.03em; line-height: 1.25; }
.sidebar-role { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.sidebar-toggle { display: none; }
.sidebar-nav { flex: 1; padding-bottom: 0.5rem; }
.sidebar-group-title {
    display: block;
    padding: 0.9rem 1.25rem 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}
.sidebar-nav a, .sidebar-foot a, .sidebar-logout button {
    display: block;
    width: 100%;
    padding: 0.5rem 1.25rem 0.5rem calc(1.25rem - 3px);
    border: none;
    border-left: 3px solid transparent;
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.sidebar-nav a:hover, .sidebar-foot a:hover, .sidebar-logout button:hover { background: var(--grey-bg); color: var(--text); }
.sidebar-nav a[aria-current="page"], .sidebar-foot a[aria-current="page"] {
    background: var(--orange-light);
    border-left-color: var(--orange);
    color: var(--orange-dark);
    font-weight: 600;
}
.sidebar-foot { border-top: 1px solid var(--grey-border); padding: 0.5rem 0 0.75rem; }
.sidebar-logout { margin: 0; }

@media (max-width: 960px) {
    .admin-shell { flex-direction: column; align-items: stretch; }
    .admin-shell > .page-content { flex: 0 0 auto; width: 100%; }
    .sidebar {
        position: static;
        flex: 0 0 auto; /* in the column, the desktop's 230px basis would be the bar's height */
        width: auto;
        height: auto;
        overflow: visible;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    .sidebar-brand { flex: 1; padding: 0.75rem 1.25rem; }
    .sidebar-name { font-size: 1.1rem; }
    .sidebar-toggle {
        display: block;
        appearance: none;
        -webkit-appearance: none;
        position: relative;
        width: 2.5rem;
        height: 2.5rem;
        margin: 0 1rem 0 0;
        border: 1px solid var(--grey-border);
        border-radius: 6px;
        background: transparent;
        color: var(--text);
        cursor: pointer;
    }
    .sidebar { border-right: none; border-bottom: 1px solid var(--grey-border); }
    .sidebar-brand { border-top: none; border-left: 4px solid var(--orange); }
    .sidebar-toggle::before { content: "\2630"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
    .sidebar-toggle:checked::before { content: "\2715"; }
    .sidebar-nav, .sidebar-foot { display: none; flex-basis: 100%; }
    .sidebar-toggle:checked ~ .sidebar-nav, .sidebar-toggle:checked ~ .sidebar-foot { display: block; }
    .sidebar-nav { padding-bottom: 0.25rem; }
    .sidebar-group-title { padding-top: 0.6rem; }
}

/* ── Timer Bar ────────────────────────────────────────────────────────── */
.timer-bar {
    background: #333;
    color: white;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.timer-label { opacity: 0.8; }
.timer-display { font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.timer-bar.timer-urgent { background: var(--danger); }
.timer-bar[hidden] { display: none; }
/* Paused from the preview bar (Pages/Shared/_PreviewBar) */
.timer-bar.timer-paused { background: #6c757d; }
.timer-bar.timer-paused .timer-display::after { content: " (em pausa)"; font-size: 0.85rem; font-weight: 400; }
@media (prefers-reduced-motion: no-preference) {
    .timer-bar.timer-urgent .timer-display { animation: blink 1s step-start infinite; }
}
@keyframes blink { 50% { opacity: 0.5; } }
.timer-instructions-btn {
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}
.timer-instructions-btn:hover { background: rgba(255,255,255,0.25); }

/* ── Instructions Modal ──────────────────────────────────────────────── */
.instructions-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.instructions-modal-dialog {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}
.instructions-modal-dialog .section-name {
    display: inline-block;
    background: var(--orange);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}
.instructions-modal-dialog h2 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.instructions-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}
.instructions-modal-close:hover { color: #333; }

/* ── Page Layout ──────────────────────────────────────────────────────── */
.page-content {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}
.page-content.full-width { max-width: 100%; }

/* ── Card ─────────────────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.card-sm { padding: 1.25rem 1.5rem; }

/* ── Headings ─────────────────────────────────────────────────────────── */
h1 { font-size: 2rem; color: var(--orange); margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; color: var(--text); margin-bottom: 1rem; }
h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 0.75rem; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.95rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="search"], textarea, select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--grey-border);
    border-radius: var(--radius);
    font-size: 1rem;
    max-width: 100%;
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(232,117,26,0.15);
}
/* The keyboard's place is always visible */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-header :focus-visible { outline-color: var(--white); }
/* «Saltar para o conteúdo»: the first stop of the keyboard, hidden until then */
.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    z-index: 1000;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: var(--white);
    color: var(--orange-dark);
    font-weight: 600;
}
.skip-link:focus { top: 0.5rem; }
textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
/* One filled button per screen (the main action); the others outlined in grey; deleting outlined in red */
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-dark); color: var(--white); }
.btn-outline, .btn-secondary {
    background: var(--white);
    border: 1.5px solid var(--grey-border);
    color: var(--text);
}
.btn-outline:hover, .btn-secondary:hover { background: var(--grey-bg); border-color: var(--grey-dark); color: var(--text); }
.btn-lg { padding: 0.85rem 2.5rem; font-size: 1.15rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-danger { background: var(--white); border: 1.5px solid var(--danger); color: var(--danger-dark); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-sm { padding: 0.3rem 0.85rem; font-size: 0.85rem; }
/* A test's «Submeter» */
.btn-submit-lg { padding: 0.9rem 2rem; font-size: 1.1rem; }

/* ── Icon Buttons (table row actions) ───────────────────────────────── */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    color: inherit;
    text-decoration: none;
}
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon-view { color: var(--orange); border: 1.5px solid var(--orange); }
.btn-icon-view:hover { background: var(--orange); color: var(--white); }
.btn-icon-muted { color: var(--text-muted); }
.btn-icon-muted:hover { background: var(--grey-bg); color: var(--text); }
.btn-icon-danger { color: var(--danger); }
.btn-icon-danger:hover { background: var(--danger-bg); color: var(--danger-dark); }

/* ── Alerts ───────────────────────────────────────────────────────────── */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.alert-error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger-dark); }
.alert-success { background: var(--success-bg); border: 1px solid #80c880; color: var(--success-dark); }
.alert-info { background: var(--orange-light); border: 1px solid #f0b070; color: #7a3a00; }
.alert a { color: inherit; }

/* ── Tables ───────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th { background: var(--grey-bg); color: var(--text); padding: 0.65rem 0.75rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--grey-border); }
td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--grey-light); }
tr:hover td { background: var(--orange-light); }

/* Clients list and Painel: bulk selection */
.select-col { width: 2.5rem; }
.select-col input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--orange-dark); cursor: pointer; }
#delete-selected:disabled, #archive-selected:disabled { opacity: 0.5; cursor: not-allowed; }

/* Painel: session filters */
.session-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.session-filters input[type="search"], .session-filters select { padding: 0.4rem 0.65rem; font-size: 0.9rem; }
.session-filters input[type="search"] { flex: 1 1 11rem; width: auto; }
.session-filters select { width: auto; max-width: 12rem; }

/* ── Status Badges ────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-pending { background: var(--grey-light); color: var(--grey-dark); }
.badge-progress { background: #fff3cd; color: #856404; }
.badge-done { background: #d4edda; color: #155724; }
.badge-interrupted { background: var(--danger-bg); color: var(--danger-dark); }
.badge-archived { background: var(--white); color: var(--grey-dark); border: 1px solid #ccc; }
/* O Baú e a Árvore never finish: open while the session is active, closed once archived */
.badge-open { background: #e3f2f1; color: #1d5c57; }
.badge-closed { background: var(--grey-light); color: var(--grey-dark); }
/* The test's badge (Pages/Shared/_SessionTypeBadge): one colour per family of TestRoutes.Groups, white text (AA) */
.badge-type { color: var(--white); }
.badge-type-acolhimento { background: #4a5560; }

/* The «Protocolo de Acolhimento»'s red alerts (Data/Intake): the student list's marker, the banner on the student's
   page and the counts on the session page; colour states also have words */
.intake-alert-marker {
    display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.5rem; border-radius: 999px;
    background: var(--danger-dark); color: var(--white); font-size: 0.75rem; font-weight: 700; vertical-align: middle;
}
.intake-banner { border: 2px solid var(--danger); background: var(--danger-bg); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1rem; }
.intake-banner h2 { color: var(--danger-dark); margin: 0 0 0.4rem; font-size: 1.15rem; }
.intake-banner ul { margin: 0.2rem 0 0.5rem; padding-left: 1.2rem; }
.intake-banner-guidance { font-weight: 600; font-size: 0.9rem; margin: 0.4rem 0; }
.intake-banner.intake-banner-reviewed { border-width: 1px; }
.intake-count { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.5rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.intake-count-red { background: var(--danger-bg); color: var(--danger-dark); border: 1px solid var(--danger); }
.intake-count-orange { background: var(--orange-light); color: var(--orange-dark); border: 1px solid var(--orange); }
.intake-count-yellow { background: #fdf8e3; color: #6b5606; border: 1px solid #b8960b; }
.intake-alerts { margin: 0.4rem 0; padding-left: 1.2rem; }
.intake-alerts-red li { color: var(--danger-dark); }
.badge-type-raciocinio { background: var(--orange-dark); }
.badge-type-orientacao { background: #1f4e79; }
.badge-type-personalidade { background: #6a3d7a; }
.badge-type-estudo { background: #2d6a4f; }
/* The client page's follow-up records (Pages/Admin/_InteractionItem) */
.badge-interaction { color: var(--white); }
.badge-interaction-note { background: #5c636a; }
.badge-interaction-phone { background: #1f4e79; }
.badge-interaction-meeting { background: #2d6a4f; }
.badge-interaction-session { background: #0f6b72; }
.badge-interaction-email { background: #6a3d7a; }
.badge-interaction-observation { background: var(--orange-dark); }
/* The session lists' actions: every row has the same icons, so they line up */
td.actions-cell { width: 7.5rem; white-space: nowrap; }

/* ── Section Cover (instructions screen) ─────────────────────────────── */
.section-cover {
    text-align: center;
    padding: 3rem 2rem;
}
.section-cover .section-name {
    display: inline-block;
    background: var(--orange);
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}
.section-cover h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.section-cover .timer-info {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}
.section-cover .instructions {
    max-width: 700px;
    margin: 0 auto 2.5rem;
    text-align: left;
    background: var(--orange-light);
    border-left: 4px solid var(--orange);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    line-height: 1.7;
}
.instructions .example-box {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: #f5f0ff;
    border-radius: 8px;
    border-left: 3px solid #7c5cbf;
}
.instructions .example-box p { margin: 0.3rem 0; }
.instructions .example-box .example-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: #7c5cbf;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.instructions .example-box .example-series {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.instructions .example-box .example-answer {
    color: #5a3d8a;
    font-weight: 600;
}
.instructions .tip-box {
    margin: 1rem 0;
    padding: 0.6rem 1rem;
    background: #e8f4f8;
    border-radius: 8px;
    font-size: 0.93rem;
}
.instructions .tip-box p { margin: 0.3rem 0; }

/* ── RA question image ────────────────────────────────────────────────── */
.ra-question { margin-bottom: 2.5rem; }
.ra-question img {
    width: 100%;
    max-width: 720px;
    display: block;
    border: 1px solid var(--grey-border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.ra-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.ra-option {
    position: relative;
    flex: 1;
    min-width: 80px;
    max-width: 130px;
    padding: 0.6rem 1rem;
    border: 2px solid var(--grey-border);
    border-radius: var(--radius);
    background: white;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}
.ra-option:hover { border-color: var(--orange); color: var(--orange); }
.ra-option.selected { background: var(--orange); color: white; border-color: var(--orange); }
/* Hidden but still a radio button: the keyboard and screen readers reach it */
.ra-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.ra-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ── RV question ──────────────────────────────────────────────────────── */
.rv-question {
    border: 1px solid var(--grey-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    background: white;
}
.rv-question-number {
    display: inline-block;
    background: var(--orange);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    margin-right: 0.5rem;
}
.rv-stem {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.rv-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}
.rv-option label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--grey-border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.95rem;
    transition: all 0.15s;
}
.rv-option label:hover { border-color: var(--orange); background: var(--orange-light); }
.rv-option input[type="radio"]:checked + label,
.rv-option label:has(input[type="radio"]:checked) {
    border-color: var(--orange);
    background: var(--orange-light);
    font-weight: 600;
}
.rv-option input[type="radio"] { accent-color: var(--orange); width: 16px; height: 16px; }

/* ── RN question ──────────────────────────────────────────────────────── */
.rn-question {
    border: 1px solid var(--grey-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.rn-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 42px;
    background: var(--grey-bg);
    border: 1px solid var(--grey-border);
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0 0.75rem;
}
.rn-blank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 42px;
}
.rn-blank input {
    width: 64px;
    height: 42px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    border: 2px solid var(--grey-border);
    border-radius: 6px;
    background: #fffaf5;
}
.rn-blank input:focus { border-color: var(--orange); }
.rn-sep { font-size: 1.1rem; color: var(--text-muted); }
.rn-q-number {
    font-weight: 700;
    color: var(--orange);
    min-width: 30px;
    font-size: 1rem;
}

/* ── RP question ──────────────────────────────────────────────────────── */
.rp-question {
    border: 1px solid var(--grey-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    background: white;
}
.rp-problem-text {
    font-size: 0.97rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--text);
}
.rp-answer-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

/* ── Stop page ────────────────────────────────────────────────────────── */
.stop-page {
    text-align: center;
    padding: 3rem 1rem;
}
.stop-page h2 { color: #333; font-size: 1.6rem; margin-bottom: 1rem; }
.stop-page p { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.05rem; }

/* ── Done page ────────────────────────────────────────────────────────── */
.done-page { text-align: center; padding: 3rem 1rem; }
.done-page .checkmark { font-size: 4rem; color: var(--orange); margin-bottom: 1rem; }
.done-page h1 { color: #333; }

/* ── Admin PIN display ────────────────────────────────────────────────── */
.pin-display {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--orange);
    font-variant-numeric: tabular-nums;
    background: var(--orange-light);
    border: 2px solid var(--orange);
    border-radius: var(--radius);
    padding: 0.75rem 2rem;
    display: inline-block;
    margin: 1rem 0;
}

/* ── Login page ───────────────────────────────────────────────────────── */
.login-wrap {
    max-width: 420px;
    margin: 4rem auto;
}
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo h1 { font-size: 2.5rem; margin-bottom: 0; }
.login-logo p { color: var(--text-muted); font-size: 1rem; margin-top: 0.25rem; }

/* ── Link-style Button ────────────────────────────────────────────────── */
.btn-link { background: none; border: none; color: var(--orange); cursor: pointer; text-decoration: underline; font-size: 0.95rem; padding: 0; }
.btn-link:hover { color: var(--orange-dark); }

/* ── Utilities ────────────────────────────────────────────────────────── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.m-0 { margin: 0; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }
.text-center { text-align: center; }
.small { font-size: 0.85rem; }
.flex { display: flex; flex-wrap: wrap; }
/* Wide tables scroll on their own on a phone, instead of the whole page */
/* position: relative keeps the absolutely positioned bits inside (the visually hidden labels of the headers) */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
/* Form fields that shouldn't take the whole line */
select.w-auto, input.w-auto { width: auto; }
input.w-short { width: 6rem; }

/* ── Responsive Guard ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .card { padding: 1rem; }
    table { font-size: 0.85rem; }
    th, td { padding: 0.5rem 0.5rem; }
}

/* ── Client Search Dropdown ── */
.search-container { position: relative; }
.search-results {
    position: absolute;
    z-index: 50;
    width: 100%;
    border: 1px solid var(--grey-border);
    border-radius: var(--radius);
    background: var(--white);
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.search-result-item {
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    font-size: 0.92rem;
}
.search-result-item:hover, .search-result-item:focus { background: var(--orange-light); }
button.search-result-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    font: inherit;
    color: inherit;
}
.search-no-results { padding: 0.5rem 0.85rem; margin: 0; font-size: 0.9rem; }
/* The Painel's choice of client: the profile the session goes to, or an ad-hoc session */
.client-choice { font-size: 0.85rem; margin-top: 0.3rem; }
.client-choice-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0.3rem 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--orange-light);
}
.client-choice-chip button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0.1rem 0.3rem;
}

/* ── Client Interactions ── */
.interaction-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--grey-border);
}
.interaction-item:last-child { border-bottom: none; }
.interaction-item p { margin-top: 0.3rem; white-space: pre-wrap; }

/* ── Release Notes (Pages/Admin/ReleaseNotes: months, each entry a <details>, the latest open) ── */
.release-index { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; margin-bottom: 1.5rem; font-size: 0.95rem; }
.release-month { margin-bottom: 2rem; scroll-margin-top: 1rem; }
.release-month > h2 { margin-bottom: 0.75rem; }
.release-note {
    background: var(--white);
    border-left: 4px solid var(--orange);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 1rem 2rem;
    margin-bottom: 1rem;
}
.release-note > summary { list-style-position: outside; margin-left: 0.25rem; }
.release-note > summary h3 { display: inline; font-size: 1.1rem; margin: 0; }
.release-note[open] > summary { margin-bottom: 0.75rem; }
.release-note p { color: var(--text-muted); margin-bottom: 0.75rem; }
.release-note ul { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.release-note li { margin-bottom: 0.4rem; line-height: 1.5; }
.release-note .release-hint { font-size: 0.88rem; margin-bottom: 0; }

/* ── Help guides (Pages/Admin/Ajuda) ── */
.help-link { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.5rem; color: var(--orange); font-weight: 600; text-decoration: none; white-space: nowrap; }
.help-link:hover { color: var(--orange-dark); text-decoration: underline; }
.help-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.1rem; height: 1.1rem; border-radius: 50%;
    background: var(--orange); color: var(--white); font-size: 0.75rem; font-weight: 700;
}
.guide-card { display: block; color: inherit; text-decoration: none; border-left: 4px solid var(--orange); transition: box-shadow 0.15s; }
.guide-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.14); }
.guide-card h2 { margin-bottom: 0.4rem; }
.guide-card p { margin-bottom: 0.6rem; }
.guide-start { color: var(--orange); font-weight: 600; font-size: 0.9rem; }
a.qf-progress-step { text-decoration: none; }
a.qf-progress-step:hover { box-shadow: 0 0 0 2px var(--orange); }
.guide-step-count { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.guide-text { line-height: 1.65; margin-bottom: 1.25rem; }
.guide-text p + p { margin-top: 0.6rem; }
.guide-note { background: var(--orange-light); border-left: 3px solid var(--orange); padding: 0.6rem 0.9rem; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.95rem; }
.guide-shot { display: block; width: 100%; height: auto; border: 1px solid var(--grey-border); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* ── Credentials Footer ── */
.credentials-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
/* The instrument's bibliographic reference, under the credentials (ViewData["FooterReference"]) */
.credentials-footer .footer-reference { max-width: 760px; margin: 0.5rem auto 0; font-size: 0.72rem; }

/* ── Questionnaire inputs (Pages/Shared/_QuestionInput) ── */
.q { padding: 1rem 0; border-bottom: 1px solid var(--grey-light); }
.q:last-child { border-bottom: none; }
.q-title { font-weight: 600; margin-bottom: 0.6rem; line-height: 1.45; }
.q-num { color: var(--orange); margin-right: 0.2rem; }

/* «Frase 12 de 44» / «Item 23 de 180» above each item of the inventories, so a student can say which one they mean */
.item-number { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.02em; margin-bottom: 0.1rem; }
.q-hint { font-weight: 400; color: var(--text-muted); font-size: 0.88rem; }
.q-error { background: #fff3f3; box-shadow: -4px 0 0 var(--danger-border); padding-left: 0.75rem; padding-right: 0.75rem; border-radius: 4px; }
.q-error > .q-title { color: var(--danger-dark); }

.q-options { display: grid; gap: 0.4rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.q-options-inline { display: flex; flex-wrap: wrap; }
.q-options-stack { grid-template-columns: 1fr; }
.q-option {
    display: flex; align-items: flex-start; gap: 0.5rem;
    padding: 0.55rem 0.8rem; margin: 0;
    border: 1px solid var(--grey-border); border-radius: 6px;
    font-weight: 400; font-size: 0.95rem; line-height: 1.35;
    cursor: pointer; background: var(--white);
    transition: border-color 0.15s, background 0.15s;
}
.q-option:hover { border-color: var(--orange); }
.q-option:has(input:checked) { border-color: var(--orange); background: var(--orange-light); font-weight: 600; }
.q-option:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.q-option input, .q-cell input { accent-color: var(--orange); width: 18px; height: 18px; margin-top: 0.05rem; flex-shrink: 0; }
.q-consent { border-width: 2px; }
.q-other { margin-top: 0.5rem; }
.q-other[hidden] { display: none; }

/* Grids: table layout on wide screens, stacked rows with labelled pills on phones */
.q-grid { --q-cell-w: 6.5rem; }
.q-grid-dual { --q-cell-w: 6.5rem; }
.q-grid-check { --q-cell-w: 9rem; }
.q-grid-head, .q-grid-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) calc(var(--q-cols) * var(--q-cell-w));
    align-items: center;
    gap: 0.5rem;
}
.q-grid-head { position: sticky; top: 0; z-index: 2; background: var(--white); padding: 0.4rem 0; border-bottom: 2px solid var(--orange); font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.q-grid-cells { display: grid; grid-template-columns: repeat(var(--q-cols), 1fr); text-align: center; }
.q-grid-group-title { color: var(--orange); }
.q-grid-row { padding: 0.35rem 0; border-bottom: 1px solid #f0f0f0; }
.q-grid-row:hover { background: #fafafa; }
.q-grid-label { font-size: 0.95rem; }
.q-row-hint { display: block; font-size: 0.8rem; color: var(--text-muted); }
.q-cell-group { display: contents; }
.q-cell { display: flex; justify-content: center; align-items: center; margin: 0; padding: 0.35rem 0; cursor: pointer; font-weight: 400; }
.q-cell span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.q-clear {
    margin-left: 0.4rem; padding: 0.05rem 0.45rem; border: 1px solid var(--grey-border); border-radius: 4px;
    background: var(--white); color: var(--text-muted); font-size: 0.75rem; cursor: pointer;
}
.q-clear:hover { border-color: var(--orange); color: var(--orange); }
.q-grid-row:not(:has(input:checked)) .q-clear { display: none; }
/* ColumnGrid (e.g. the parents' profession): long lists as two tables side by side */
.q-grid-pick { --q-cell-w: 4rem; }
.q-grid-halves { display: grid; grid-template-columns: 1fr; gap: 0 2rem; }
@media (min-width: 900px) { .q-grid-halves { grid-template-columns: 1fr 1fr; } }
.q-other-columns { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.q-other-columns label { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 600; }
.q-other-columns input { width: auto; min-width: 14rem; }

@media (max-width: 767px) {
    .q-grid-head { display: none; }
    .q-grid-row { grid-template-columns: 1fr; padding: 0.7rem 0; }
    .q-grid-label { font-weight: 600; }
    .q-grid-cells { display: flex; flex-wrap: wrap; gap: 0.4rem; text-align: left; }
    .q-cell-group { display: flex; flex-wrap: wrap; gap: 0.4rem; width: 100%; }
    .q-cell {
        padding: 0.45rem 0.75rem; gap: 0.4rem;
        border: 1px solid var(--grey-border); border-radius: 999px; font-size: 0.9rem;
    }
    .q-cell span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
    .q-cell:has(input:checked) { border-color: var(--orange); background: var(--orange-light); font-weight: 600; }
    .q-options { grid-template-columns: 1fr; }
    /* Long Mãe/Pai lists: the two pills on the same line as the profession */
    .q-grid-pick .q-grid-row { grid-template-columns: minmax(0, 1fr) auto; padding: 0.4rem 0; }
    .q-grid-pick .q-grid-label { font-weight: 400; }
    .q-grid-pick .q-grid-cells { flex-wrap: nowrap; }
}

/* ── Student questionnaire form (Pages/Test/Questionario) ── */
.qf-wrap { max-width: 860px; margin: 0 auto; }
.qf-intro h1 { font-size: 1.6rem; }
.qf-intro p { line-height: 1.6; margin-top: 0.6rem; }
.qf-subtitle { color: var(--orange); font-weight: 600; }
.qf-confidential { font-size: 0.85rem; background: #eef3f8; padding: 0.5rem 0.75rem; border-radius: 4px; }
.qf-section h2 { margin-bottom: 0.25rem; }
.qf-signature { margin-top: 1.5rem; font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; text-align: right; }
.qf-progress { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-bottom: 1rem; }
.qf-progress-step {
    width: 2.2rem; height: 2.2rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 0.9rem; background: #e9ecef; color: var(--text-muted);
}
.qf-progress-step.active { background: var(--orange); color: var(--white); }
.qf-progress-step.done { background: #f3b98a; color: var(--white); }
.qf-nav { display: flex; align-items: center; gap: 0.75rem; margin: 1.5rem 0 3rem; }
.qf-nav [hidden], .q-step[hidden], #qf-intro[hidden] { display: none; }

/* ── Questionnaire answers (Pages/Shared/_QuestionAnswer) ── */
.qa { padding: 0.75rem 0; border-bottom: 1px solid var(--grey-light); break-inside: avoid; }
.qa:last-child { border-bottom: none; }
.qa-question { font-weight: 600; margin-bottom: 0.35rem; }
.qa-answer { padding-left: 0.75rem; white-space: pre-wrap; }
.qa-list { padding-left: 2rem; }
.qa-table { width: auto; min-width: 50%; font-size: 0.9rem; }
.qa-table th { background: var(--orange-light); color: var(--text); padding: 0.35rem 0.6rem; }
.qa-table td { padding: 0.3rem 0.6rem; }

@media print {
    .site-header, .sidebar, .credentials-footer, .no-print { display: none !important; }
    .admin-shell { display: block; }
    body { background: var(--white); }
    .page-content { margin: 0; max-width: 100%; }
    .card { box-shadow: none; padding: 0.5rem 0; }
}

/* ── Student access ── */
.student-code { font-family: Consolas, 'Courier New', monospace; font-size: 1.15rem; letter-spacing: 0.12em; }
.access-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.access-slip { border: 1px dashed #999; border-radius: 6px; padding: 0.9rem 1rem; background: var(--white); break-inside: avoid; }
.access-slip p { margin: 0.2rem 0; }
.access-slip .access-slip-note { font-size: 0.8rem; }
/* The client page's one slip (Pages/Admin/_StudentAccess): hidden on screen, printed alone by printAccessSlip() */
.print-slip { display: none; }
#print-slip-root { display: none; }
@media print {
    body.printing-slip > *:not(#print-slip-root) { display: none !important; }
    body.printing-slip #print-slip-root { display: block; max-width: 11cm; }
}
.turma-progress { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.9rem; }
.turma-progress li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
/* Turmas' test list: as wide as the card allows, even with long names */
.assign-form { min-width: 0; max-width: 100%; }
.assign-form select { min-width: 0; }
.turma-students { padding-left: 1.25rem; margin-top: 0.5rem; }
.turma-students li { margin: 0.25rem 0; }
.turma-session { margin-left: 0.5rem; font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
@media print {
    .access-sheet { grid-template-columns: repeat(2, 1fr); }
}

/* ── Session Result Visualization ── */

/* Holland RIASEC scores table */
.holland-scores-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.95rem;
}
.holland-scores-table th,
.holland-scores-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--grey-light);
}
.holland-scores-table th {
    background: #fdf5e6;
    font-weight: 700;
    color: #8b6914;
}
.holland-scores-table td:first-child {
    text-align: left;
    font-weight: 500;
}
.holland-total-row td {
    border-top: 2px solid #c2851e;
    background: #fdf5e6;
}

/* Holland top areas */
.holland-top-area {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--grey-light);
}
.holland-top-area:last-child { border-bottom: none; }
.holland-top-letter {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #c2851e;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Sociability score circle */
.sociability-score-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    background: #1a7a8a;
    color: var(--white);
    font-size: 1.8rem;
    font-weight: 700;
}

/* Answer grid for IPPR / BFP compact display */
.answer-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    background: var(--grey-border);
    border: 1px solid var(--grey-border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.85rem;
}
.answer-grid-header {
    background: var(--grey-bg);
    padding: 0.3rem 0.4rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-muted);
}
.answer-grid-cell {
    background: var(--white);
    padding: 0.25rem 0.4rem;
    text-align: center;
    display: flex;
    justify-content: space-between;
}
.answer-grid-cell .q-num {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.answer-grid-cell .q-val {
    font-weight: 600;
}

/* Legend bar */
.legend-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: var(--grey-bg);
    border-radius: 4px;
    color: var(--text);
}
.legend-item .legend-key {
    font-weight: 700;
    color: var(--orange);
}

/* Result answer table */
.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.result-table th,
.result-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--grey-light);
    text-align: left;
}
.result-table th {
    background: var(--grey-bg);
    font-weight: 600;
    color: var(--text);
}
.result-table tbody tr:hover { background: #fafafa; }
.result-table .empty { color: var(--text-muted); }

/* The student's details at the top of a result card (Pages/Shared/_ResultDetails), the same on every test */
.result-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.5rem 1rem; margin: 0 0 1rem; }
.result-details dt { font-size: 0.8rem; color: var(--text-muted); }
.result-details dd { margin: 0; font-weight: 600; }
.result-details dd .result-details-note { font-weight: normal; color: var(--text-muted); font-size: 0.85rem; }
.result-details div:first-child { grid-column: span 2; }

/* Sociabilidade: the total, then the band it falls in */
.sociability-score { text-align: center; margin: 1rem 0; }
.sociability-score-caption { margin-top: 0.5rem; font-size: 0.88rem; }
.sociability-band { margin-top: 0.75rem; font-size: 1.05rem; }
.sociability-keywords { margin-top: 0.5rem; font-size: 0.9rem; }

/* ── The older inventories' pages (BFP, BFI-44, CAAS, Holland, IPPR, Sociabilidade) ── */
.test-narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.test-narrow-form { max-width: 480px; margin: 0 auto 2rem; text-align: left; }
.test-title { margin-bottom: 0.25rem; }
.test-page-title { margin-bottom: 1rem; }
/* The answer scale explained on the instructions */
.scale-legend { margin: 1rem 0; padding: 0.75rem 1rem; background: var(--orange-light); border-radius: var(--radius); }
.scale-legend p { margin: 0.3rem 0; }

/* ── BPR 7/9 (Pages/Test/BPR79) ───────────────────────────────────────── */
.bpr79 .timer-bar { border-radius: var(--radius); margin-bottom: 1rem; }
.bpr79 [hidden] { display: none !important; }
.bpr79-timer-section { margin-left: auto; opacity: 0.8; }
.bpr79-notice { margin-bottom: 1rem; }
.bpr79-plan { margin: 0.5rem 0 1rem 1.25rem; }
.bpr79-warning {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius);
    color: var(--danger-dark);
}
.bpr79-warning p { margin: 0.2rem 0; }
.bpr79-figure {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 52vh;
    margin: 0.5rem auto 1rem;
    border-radius: var(--radius);
    background: white;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}
.instructions .bpr79-figure { max-height: 300px; }
.bpr79-example-options { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.bpr79-item { padding: 1.5rem; }
.bpr79-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; color: var(--text-muted); }
.bpr79-badge {
    background: var(--orange);
    color: white;
    padding: 0.25rem 0.9rem;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.06em;
    font-size: 0.9rem;
}
.bpr79-stem { font-size: 1.2rem; margin: 1rem 0 1.25rem; text-align: center; }
.bpr79-options { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; margin: 1rem 0; }
.bpr79-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 72px;
    padding: 0.7rem 1rem;
    border: 2px solid var(--grey-border);
    border-radius: var(--radius);
    background: white;
    font-size: 1.15rem;
    cursor: pointer;
    margin: 0;
    transition: all 0.15s;
}
.bpr79-option:hover { border-color: var(--orange); }
.bpr79-option:has(input:checked) { background: var(--orange); border-color: var(--orange); color: white; }
.bpr79-option input { position: absolute; opacity: 0; pointer-events: none; }
.bpr79-option:has(input:focus-visible) { outline: 3px solid #7c5cbf; outline-offset: 2px; }
.bpr79-letter { font-weight: 700; }
.bpr79-options-words { flex-direction: column; align-items: stretch; max-width: 420px; margin: 1rem auto; }
.bpr79-options-words .bpr79-option { justify-content: flex-start; }
.bpr79-word { font-weight: 500; }
.bpr79-series { justify-content: center; }
.bpr79-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0 1rem; }
.bpr79-nav .btn:disabled { opacity: 0.4; cursor: default; }
.bpr79-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; margin: 1rem 0 0.5rem; }
.bpr79-cell {
    width: 2.4rem;
    height: 2.4rem;
    border: 1.5px solid var(--grey-border);
    border-radius: 6px;
    background: white;
    font-weight: 600;
    cursor: pointer;
}
.bpr79-cell.answered { background: var(--orange-light); border-color: var(--orange); color: var(--orange-dark); }
.bpr79-cell.current { outline: 3px solid var(--orange); outline-offset: 1px; }
.bpr79-finish { text-align: center; margin-top: 1.5rem; }
.bpr79-finish p { margin-bottom: 0.75rem; }
.bpr79-finish .btn { margin: 0 0.25rem; }
.bpr79-stop-sign { width: 140px; height: 140px; margin-bottom: 1.5rem; }
.done-page .bpr79-alert-mark { color: var(--danger); font-weight: 700; }
.bpr79-correct { color: var(--success-dark); font-weight: 700; }
.bpr79-wrong { color: var(--danger-dark); }
.bpr79-sex { max-width: 360px; margin: 0 auto 1.5rem; text-align: left; }
/* BPR 7/9 classes, as the psychologist asked: 1 red, 2 light orange, 3 white, 4 light green, 5 green (the number is always shown too) */
.bpr79-c1, .bpr79-c2, .bpr79-c3, .bpr79-c4, .bpr79-c5 { color: #1a1a1a; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bpr79-c1 { background: #e06666; }
.bpr79-c2 { background: #fcd5b4; }
.bpr79-c3 { background: #ffffff; }
.bpr79-c4 { background: #c6efce; }
.bpr79-c5 { background: #6cc287; }
.bpr79-explanation p { margin: 0.4rem 0; }
/* Where each prova stands (applied prova by prova, her email of 14/11/2026): the student's list and the psychologist's tables */
.bpr79-provas { list-style: none; margin-left: 0; padding-left: 0; }
.bpr79-provas li { padding: 0.3rem 0; border-bottom: 1px solid var(--grey-border); display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; }
.bpr79-provas li:last-child { border-bottom: none; }
.bpr79-provas .bpr79-status { margin-left: auto; }
.bpr79-status { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.1rem 0.5rem; border-radius: 999px; white-space: nowrap;
    background: var(--grey-light); color: var(--grey-dark); }
.bpr79-status-applied, .bpr79-status-resumable { background: #fff3cd; color: #856404; }
.bpr79-status-running { background: #fff3cd; color: #856404; }
.bpr79-status-done { background: #d4edda; color: #155724; }
.bpr79-status-interrupted { background: var(--danger-bg); color: var(--danger-dark); }
.bpr79-status-locked, .bpr79-status-notdone { background: var(--grey-light); color: var(--grey-dark); }
.bpr79-chips { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; vertical-align: middle; }
.bpr79-chips .bpr79-status { font-size: 0.72rem; padding: 0.05rem 0.4rem; }
.bpr79-lead { font-size: 1.05rem; }
.done-page .instructions { text-align: left; max-width: 520px; margin: 1rem auto 0; }

/* ── Preview bar (Pages/Shared/_PreviewBar): the psychologist's «Pré-visualizar» ── */
.preview-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    padding: 0.6rem 1rem;
    background: #fff8e1;
    border-top: 3px solid #f0ad4e;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
    font-size: 0.9rem;
}
body:has(.preview-bar) { padding-bottom: 7rem; }
.preview-bar form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.preview-bar input, .preview-bar select { padding: 0.25rem 0.4rem; border: 1px solid var(--grey-border); border-radius: 4px; font-size: 0.9rem; width: 5rem; }
.preview-bar select { width: auto; }
.preview-bar .btn-sm { padding: 0.25rem 0.7rem; }
.preview-bar-provas, .preview-bar-links, .preview-bar-timer { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.preview-bar a { color: var(--orange-dark); font-weight: 600; }
.preview-bar-links { margin-left: auto; }
.preview-bar-error { color: var(--danger-dark); font-weight: 600; }
/* Clear of the sticky countdown when «Ir para a pergunta» scrolls to an item */
[data-q] { scroll-margin-top: 4.5rem; }
.preview-target { animation: preview-flash 2.5s ease-out; }
@keyframes preview-flash {
    0%, 40% { background: #fff3c4; box-shadow: 0 0 0 3px #f0ad4e; }
    100% { background: transparent; box-shadow: none; }
}

/* ── Autosave (Data.Drafts, wwwroot/js/draft.js) ── */
.draft-status { font-size: 0.85rem; color: var(--text-muted); text-align: center; min-height: 1.2rem; margin: 0.5rem 0 1rem; }
.draft-status-saved { color: #23612a; }
.draft-status[data-state="failed"], .draft-status[data-state="expired"], .draft-status-closed { color: var(--danger-dark); font-weight: 600; }
.draft-status button { margin-left: 0.4rem; }
.draft-resume { background: #eef6ee; border-radius: 8px; padding: 0.6rem 0.9rem; margin: 0 0 1rem; }
.draft-note { font-size: 0.85rem; }

/* ── Error pages (Pages/Error, Pages/Erro) ── */
.error-card { max-width: 560px; margin: 2rem auto; }
.error-reference { font-size: 0.8rem; margin-top: 1.25rem; }

/* ── Admin confirmation dialog and toast (wwwroot/js/admin-confirm.js) ── */
.admin-dialog {
    max-width: 30rem;
    width: calc(100% - 2rem);
    margin: auto;
    padding: 1.5rem;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.admin-dialog::backdrop { background: rgba(0,0,0,0.45); }
.admin-dialog h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.admin-dialog p { line-height: 1.5; margin-bottom: 1rem; }
.admin-dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.admin-dialog .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.admin-toast {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    max-width: calc(100% - 2rem);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    background: #1d3d1f;
    color: var(--white);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.admin-toast-error { background: var(--danger-dark); }
.admin-toast[hidden] { display: none; }
/* An alert's close button (added by admin-confirm.js; the cross is drawn, so it isn't part of the text) */
.alert { position: relative; }
.alert-close {
    position: absolute;
    top: 0.45rem;
    right: 0.5rem;
    width: 1.8rem;
    height: 1.8rem;
    border: none;
    border-radius: 4px;
    background: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
}
.alert-close::before { content: "\2715"; }
.alert-close:hover { opacity: 1; background: rgba(0,0,0,0.06); }
.alert:has(.alert-close) { padding-right: 2.6rem; }

/* Read by screen readers, not shown */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
/* The client page's last card: deleting the profile */
.danger-zone { border: 1px solid #e0a0a0; }
.danger-zone h2 { color: var(--danger-dark); }
.btn-link-danger { color: var(--danger-dark); }
.btn-link-danger:hover { color: var(--danger-dark); }
.access-remove { font-size: 0.9rem; }

/* The signature of the printed reports (Pages/Shared/_ReportSignature) */
.report-signature { margin-top: 1.25rem; padding-top: 0.5rem; border-top: 1px solid #ddd; font-size: 0.85rem; color: #444; }
/* The session page's heading: the test and its state */
.session-heading-line { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.25rem; }
/* Turmas: the bar of classes, and who is missing */
.turma-jump { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: center; }
.turma-missing { margin: 0.25rem 0 0.5rem 1.5rem; font-size: 0.9rem; }
.turma-missing summary { cursor: pointer; color: var(--orange); }
.turma-missing ul { margin: 0.3rem 0 0 1.1rem; }
.turma-missing li { margin: 0.15rem 0; }

/* The sign-in's two ways in (PIN, student ID) */
.login-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.login-tab {
    flex: 1;
    padding: 0.7rem 0.75rem;
    border: 2px solid var(--orange);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--orange-dark);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.login-tab[aria-selected="true"] { background: var(--orange); color: var(--white); }

/* ── Taking a test (wwwroot/js/test-kit.js) ── */
/* A missing answer: a border and words, not only a colour */
.q-missing { outline: 2px solid var(--danger); outline-offset: 2px; background: #fff3f3 !important; border-radius: 6px; }
.q-missing-tag {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--danger-dark);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}
.test-missing-summary a { color: var(--danger-dark); font-weight: 700; }
/* Answer buttons big enough for a finger on a phone */
.bfp-option, .sociability-option, .holland-option, .ippr-option, .bfi-option, .caas-option {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.test-missing-hint { text-align: right; min-height: 1.2rem; margin: 0.4rem 0 0; font-size: 0.85rem; }
.timer-warning { font-weight: 600; }
.timer-warning:empty { display: none; }
/* BPR 5/6: how many items are still blank, next to «Submeter» */
.bpr-blank-count { margin-top: 0.5rem; font-size: 0.9rem; }

/* ── Year and class at the time, moves of class (ClientEdit, Admin/PassagemDeAno) ── */
/* A required choice between a few options: a move of class or a correction of the record */
fieldset.choice-list { border: 1px solid var(--grey-border); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0 0 1.25rem; background: var(--orange-light); }
fieldset.choice-list legend { font-weight: 600; padding: 0 0.3rem; }
fieldset.choice-list label { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; margin: 0.4rem 0; }
fieldset.choice-list input[type="radio"] { accent-color: var(--orange-dark); width: 16px; height: 16px; margin-top: 0.2rem; flex: none; }
/* «7.º A (estimado)» beside a session or a follow-up record */
.class-at-time { white-space: nowrap; }
.class-at-time .estimated { color: var(--text-muted); font-size: 0.85em; cursor: help; text-decoration: underline dotted; }
/* Turmas «Ver alunos»: a session done in another class, which the card doesn't count */
.turma-session.other-class { opacity: 0.75; }
.turma-session .other-class-label { color: var(--text-muted); font-size: 0.85rem; }
/* The passagem de ano: one row per student, the destination year and class */
.transition-table select, .transition-table input[type="text"] { width: auto; padding: 0.3rem 0.5rem; }
.transition-table input[type="text"] { width: 5rem; }
.transition-row-error td { background: var(--danger-bg); }
.transition-all { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.transition-all select, .transition-all input[type="text"] { width: auto; }
.transition-all input[type="text"] { width: 5rem; }
.transition-summary li { margin: 0.25rem 0; }
.transition-row-message { color: var(--danger-dark); font-weight: 600; }

/* ── «Detetives de Profissões» in the psychologist's area (Admin/Investigacao, Admin/Profissoes) ── */
.details-summary { cursor: pointer; font-weight: 600; color: var(--orange-dark); }
.investigacao-eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; color: var(--text-muted); margin: 0 0 0.2rem; }
.investigacao-meta { margin: 0.3rem 0 0.8rem; }
.investigacao-facts { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1rem; }
.investigacao-facts div { background: var(--grey-light); border-radius: var(--radius); padding: 0.4rem 0.75rem; }
.investigacao-facts dt { font-size: 0.78rem; color: var(--text-muted); }
.investigacao-facts dd { margin: 0; font-weight: 600; }
.investigacao-report h2 { font-size: 1.15rem; margin: 1.2rem 0 0.5rem; }
.investigacao-qa { margin: 0 0 0.8rem; break-inside: avoid; }
.investigacao-qa h3 { font-size: 0.98rem; margin: 0 0 0.2rem; }
.investigacao-qa p, .investigacao-qa ul { margin: 0; }
.investigacao-answer { white-space: pre-line; }
.investigacao-earlier { border: 1px solid var(--grey-border); border-radius: var(--radius); padding: 0.5rem 0.8rem; margin-bottom: 0.6rem; }
.investigacao-earlier summary { cursor: pointer; font-weight: 600; }
.investigacao-footer { font-size: 0.82rem; margin-top: 1.2rem; }
@media print {
    .investigacao-report { border: 0; box-shadow: none; padding: 0; font-size: 10pt; }
}
.result-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── «Uma carta para o meu Eu do Futuro» (Pages/Shared/_FutureLetterBody): the letter, on the student's preview and
   in the psychologist's area, on screen and printed ── */
.fl-letter {
    background: var(--white);
    border: 1px solid #e8dfd5;
    border-radius: var(--radius);
    padding: 2rem 2.2rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
    max-width: 720px;
}
.fl-letter p { margin: 0 0 1rem; }
.fl-letter-date { text-align: right; color: var(--text-muted); font-size: 0.95rem; }
.fl-letter-greeting { font-weight: 700; }
.fl-letter-closing { margin-top: 1.4rem !important; }
.fl-letter-signature { font-style: italic; font-size: 1.15rem; }
@media (max-width: 520px) {
    .fl-letter { padding: 1.3rem 1.2rem; font-size: 1rem; }
}
@media print {
    .fl-letter { border: 0; padding: 0; max-width: none; font-size: 12pt; line-height: 1.6; }
    .fl-letter p { break-inside: avoid; }
}
/* The student's copy (wwwroot/js/future-letter-print.js): on paper, the letter alone, copied into #fl-print-root */
#fl-print-root { display: none; }
@media print {
    body.fl-printing > *:not(#fl-print-root) { display: none !important; }
    body.fl-printing #fl-print-root { display: block; }
}
.fl-print-row { margin: 0.8rem 0 0; }
/* The confirmation right after saving (Pages/Test/_FutureLetterSaved): the thank-you, the copy, the letter */
.fl-done { padding-bottom: 2rem; }
.fl-done-text { font-size: 1.05rem; }
.fl-copy-note { max-width: 560px; margin: 1rem auto 1.2rem; line-height: 1.5; }
.fl-saved-letter .fl-letter { margin: 1.5rem auto; }
.fl-done-end { text-align: center; margin: 1rem 0 2rem; }
.fl-done-actions { justify-content: center; }

/* «Avaliação do programa de OV (9.º ano)»: the block (Pages/Admin/_Ov9Evaluation) and the summary's alert chips */
.ov9eval-block { border-left: 4px solid var(--orange); }
.ov9eval-alerts { margin: 0.75rem 0; }
.ov9eval-alerts ul { padding-left: 1.2rem; }
.ov9eval-alert { margin-bottom: 0.35rem; }
.ov9eval-chip {
    display: inline-block;
    background: var(--danger-bg);
    color: var(--danger-dark);
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 0.05rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0.25rem 0.2rem 0;
    white-space: nowrap;
}
.ov9eval-means { max-width: 560px; }
.ov9eval-list { display: grid; gap: 0.6rem; margin: 0.75rem 0 0; }
.ov9eval-list dt { font-size: 0.85rem; color: var(--text-muted); }
.ov9eval-list dd { margin: 0; font-weight: 600; }
.ov9eval-open dd { font-weight: 400; white-space: pre-line; }
.qf-section-intro {
    background: var(--orange-light);
    border-left: 4px solid var(--orange);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0.6rem 0.9rem;
}
/* The BPR 7/9 in the assignment forms: full battery or some provas (Pages/Shared/_Bpr79ProvasChoice) */
.bpr79-choice { border: 1px solid var(--grey-border); border-radius: var(--radius); padding: 0.4rem 0.75rem 0.5rem; margin: 0 0 0.75rem; flex-basis: 100%; }
.bpr79-choice legend { font-size: 0.85rem; font-weight: 600; padding: 0 0.25rem; }
.bpr79-choice label { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0 0.9rem 0 0; font-weight: normal; }
.bpr79-choice-modes, .bpr79-choice-provas { display: flex; flex-wrap: wrap; align-items: center; }
.bpr79-choice-provas { margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px dashed var(--grey-border); }
.bpr79-choice[hidden], .bpr79-choice-provas[hidden] { display: none; }
