:root {
    --primary: #1593A8;
    --primary-dark: #0f7282;
    --bg: #f3f6f8;
    --card: #ffffff;
    --card-soft: #f8fbfc;
    --text: #15232d;
    --muted: #5f7280;
    --border: #d7e0e5;
    --success: #1f9d6e;
    --danger: #d73a49;
    --shadow: 0 12px 30px rgba(21, 147, 168, 0.08);
}

body[data-theme='dark'] {
    --bg: #0e1a20;
    --card: #13232c;
    --card-soft: #172c36;
    --text: #e9f3f7;
    --muted: #9cb2bf;
    --border: #27404c;
    --shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
}

h1,
h2,
h3,
h4 {
    font-family: 'Bricolage Grotesque', sans-serif;
    margin: 0;
}

p {
    margin: 0;
    color: var(--muted);
}

a {
    color: inherit;
    text-decoration: none;
}

.flash {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    min-width: 280px;
    max-width: 92vw;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.flash-success {
    background: rgba(31, 157, 110, 0.15);
    color: #0e7c55;
    border: 1px solid rgba(31, 157, 110, 0.35);
}

.flash-error {
    background: rgba(215, 58, 73, 0.15);
    color: #ac1f2d;
    border: 1px solid rgba(215, 58, 73, 0.35);
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 66px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem 0 1rem;
    z-index: 1000;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-label {
    color: var(--primary);
    font-weight: 700;
}

.topbar-user {
    color: var(--muted);
    font-size: 0.95rem;
}

.notif-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border);
    background: var(--card-soft);
    color: var(--text);
    border-radius: 999px;
    padding: 0.42rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.notif-count {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0 0.35rem;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(21, 147, 168, 0.18);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--card-soft);
    color: var(--text);
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.mobile-only {
    display: none;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 66px;
}

body.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 66px 0 0 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 899;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: fixed;
    top: 66px;
    bottom: 0;
    left: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    overflow-y: auto;
}

.sidebar-brand {
    display: grid;
    gap: 0.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo-wrap {
    width: 100%;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #0f7282);
    padding: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    object-fit: contain;
}

.sidebar-apoio {
    padding: 0.6rem 0.8rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.sidebar-apoio small {
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-apoio img {
    max-width: 100px;
    height: auto;
    object-fit: contain;
}

.sidebar-realizacao img {
    background: #1a1a1a;
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    padding: 0.72rem 0.8rem;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 600;
    transition: 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(21, 147, 168, 0.12);
    color: var(--primary);
}

.sidebar-counter {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.73rem;
    padding: 0 0.32rem;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 0.85rem;
    color: var(--muted);
}

.sidebar-footer span {
    display: block;
    color: var(--text);
    font-weight: 700;
}

.content-area {
    width: 100%;
    margin-left: 280px;
    padding: 1.1rem;
    display: grid;
    gap: 1rem;
    align-content: start;
}

.hero-card,
.panel,
.stat-card,
.module-card,
.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 1.2rem;
    background: linear-gradient(135deg, rgba(21, 147, 168, 0.14), rgba(21, 147, 168, 0.03));
}

.hero-card h1 {
    margin-bottom: 0.35rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.stat-card {
    padding: 1rem;
    display: grid;
    gap: 0.45rem;
}

.stat-card strong {
    font-size: 1.6rem;
    color: var(--primary);
}

.profile-grid .stat-card {
    overflow: hidden;
    min-width: 0;
}

.profile-grid .stat-card strong {
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}

.panel {
    padding: 1rem;
    display: grid;
    gap: 0.9rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.lesson-list,
.notice-list,
.forum-topic-list {
    display: grid;
    gap: 0.7rem;
}

.lesson-item,
.notice-item,
.forum-topic-item {
    background: var(--card-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem;
    display: grid;
    gap: 0.35rem;
}

.notice-unread {
    border-left: 4px solid var(--primary);
}

.lesson-item strong,
.notice-item h3,
.forum-topic-item strong {
    color: var(--text);
}

.lesson-item span,
.notice-item small,
.forum-topic-item span,
.forum-topic-item small {
    color: var(--muted);
    font-size: 0.9rem;
}

.module-card {
    padding: 1rem;
    margin-bottom: 0.9rem;
}

.module-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.module-progress {
    min-width: 130px;
    text-align: right;
}

.module-progress span {
    font-weight: 700;
    color: var(--primary);
}

.progress-bar {
    margin-top: 0.35rem;
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: rgba(21, 147, 168, 0.15);
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #1cb2c8);
}

.video-wrapper {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
    aspect-ratio: 16 / 9;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
}

.btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.22rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    width: fit-content;
}

.badge-success {
    color: #0a7c54;
    background: rgba(31, 157, 110, 0.18);
}

.badge-neutral {
    color: var(--muted);
    background: rgba(130, 152, 165, 0.2);
}

.form-grid {
    display: grid;
    gap: 0.65rem;
}

.form-grid.compact {
    gap: 0.45rem;
}

label {
    font-weight: 700;
    font-size: 0.9rem;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--card-soft);
    color: var(--text);
    border-radius: 10px;
    padding: 0.62rem 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
}

textarea {
    resize: vertical;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inline-form.wrap {
    flex-wrap: wrap;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

thead th {
    text-align: left;
    background: var(--card-soft);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem;
    font-size: 0.85rem;
    color: var(--muted);
}

tbody td {
    border-bottom: 1px solid var(--border);
    padding: 0.7rem;
    vertical-align: top;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

.profile-avatar-large {
    width: 84px;
    height: 84px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(21, 147, 168, 0.18);
    color: var(--primary-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 700;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-page {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1593A8 0%, #0f7282 55%, #0a5464 100%);
    padding: 2rem 1rem;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.login-page::-webkit-scrollbar {
    display: none;
}

.login-bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

.login-bg-circle-1 {
    width: 640px;
    height: 640px;
    top: -220px;
    right: -160px;
}

.login-bg-circle-2 {
    width: 440px;
    height: 440px;
    bottom: -160px;
    left: -120px;
}

.login-center {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
}

.login-logo-full {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.25));
}

.login-card {
    width: 100%;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
    color: #111;
}

.login-card-body {
    padding: 1.8rem 2rem 2rem;
}

.login-card-body h2 {
    font-size: 1.6rem;
    color: #111;
    margin-bottom: 0.25rem;
}

.login-card-body > p {
    margin: 0 0 1.2rem;
    color: #44596a;
}

.login-card-body input,
.login-card-body select {
    background: #f5f8fa !important;
    color: #111 !important;
    border-color: #cdd9e0 !important;
}

.login-card-body input::placeholder {
    color: #8ba0ad !important;
}

.login-card-body input:-webkit-autofill,
.login-card-body input:-webkit-autofill:hover,
.login-card-body input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 40px #f5f8fa inset !important;
    -webkit-text-fill-color: #111 !important;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0.9rem 0;
}

@media (max-width: 1024px) {
    .content-area {
        padding: 1rem;
    }
}

@media (max-width: 980px) {
    .mobile-only {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        left: -320px;
        width: min(320px, 86vw);
        transition: 0.25s ease;
    }

    body.sidebar-open .sidebar {
        left: 0;
        z-index: 900;
    }

    .content-area {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        padding-inline: 0.8rem;
    }

    .topbar-user {
        display: none;
    }
}

@media (max-width: 760px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .panel-header,
    .module-head,
    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .module-progress {
        text-align: left;
        min-width: 100%;
    }

    table {
        min-width: 560px;
    }

    .notif-link {
        padding: 0.38rem 0.65rem;
    }
}

@media (max-width: 520px) {
    .topbar-right {
        gap: 0.45rem;
    }

    .theme-toggle {
        padding: 0.4rem 0.68rem;
    }

    .btn,
    .theme-toggle,
    .notif-link {
        font-size: 0.8rem;
    }

    .login-card {
        padding: 1.1rem;
        border-radius: 14px;
    }

    .content-area {
        padding: 0.8rem;
    }
}
/* Ajustes finais FL360 */
img {
    max-width: 100%;
    height: auto;
}

.topbar .user-avatar img,
.profile-avatar-large img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.notif-dropdown {
    position: relative;
}

.notif-bell {
    border: 1px solid var(--border);
    background: var(--card-soft);
    color: var(--text);
    border-radius: 999px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    font-size: 1.05rem;
}

.notif-bell .notif-count {
    position: absolute;
    top: -6px;
    right: -6px;
}

.notif-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(90vw, 340px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 0.7rem;
    display: none;
    z-index: 1100;
}

.notif-dropdown.open .notif-menu {
    display: block;
}

.notif-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border);
}

.notif-menu-head a {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
}

.notif-list {
    margin-top: 0.55rem;
    display: grid;
    gap: 0.45rem;
    max-height: 280px;
    overflow-y: auto;
}

.notif-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-soft);
    padding: 0.5rem 0.6rem;
    display: grid;
    gap: 0.2rem;
}

.notif-item.unread {
    border-left: 4px solid var(--primary);
}

.notif-item a {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}

.notif-item small {
    color: var(--muted);
    font-size: 0.78rem;
}

.notif-empty {
    margin: 0.55rem 0 0.1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 980px) {
    .notif-menu {
        right: -42px;
    }
}

@media (max-width: 520px) {
    .login-logo-panel {
        padding: 1.2rem 1rem;
        border-radius: 16px;
    }

    .login-card {
        padding: 1.4rem 1.2rem;
        border-radius: 16px;
    }

    .login-card h2 {
        font-size: 1.45rem;
    }

    .notif-menu {
        right: -86px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   QUIZ — Rocketseat-style
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── quiz-fullpage: remove padding/max-width so quiz goes edge-to-edge ────── */
.quiz-fullpage {
    padding: 0 !important;
}

/* ── Quiz form wrapper ────────────────────────────────────────────────────── */
.qz-wrapper {
    min-height: calc(100vh - 66px);
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.qz-topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0.3rem 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 66px;
    z-index: 100;
}

.qz-back {
    grid-row: 1 / 3;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    transition: color 0.15s;
}

.qz-back:hover { color: var(--primary); }

.qz-counter {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    gap: 0.1rem;
    justify-self: end;
}

.qz-counter #qzCurrent {
    color: var(--primary);
}

.qz-counter-sep,
.qz-counter span:last-child {
    color: var(--muted);
}

.qz-progress-wrap {
    grid-column: 2;
    height: 4px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.qz-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #0f7282);
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* ── Stage (question display area) ───────────────────────────────────────── */
.qz-stage {
    flex: 1;
    position: relative;
    overflow: hidden;
    padding: 2rem 1.5rem 1rem;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
}

.qz-question {
    display: none;
    flex-direction: column;
    gap: 1.2rem;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.qz-question.qz-active {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

.qz-question.qz-enter-right {
    display: flex;
    opacity: 0;
    transform: translateX(60px);
}

.qz-question.qz-enter-left {
    display: flex;
    opacity: 0;
    transform: translateX(-60px);
}

.qz-question.qz-exit-left {
    display: flex;
    opacity: 0;
    transform: translateX(-60px);
    pointer-events: none;
}

.qz-question.qz-exit-right {
    display: flex;
    opacity: 0;
    transform: translateX(60px);
    pointer-events: none;
}

@keyframes qzShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-6px); }
    80%       { transform: translateX(6px); }
}

.qz-shake { animation: qzShake 0.45s ease; }

/* ── Question header tag ──────────────────────────────────────────────────── */
.qz-question-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qz-q-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: rgba(21, 147, 168, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

/* ── Question text ────────────────────────────────────────────────────────── */
.qz-question-text {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(1.15rem, 2.5vw, 1.45rem);
    font-weight: 700;
    line-height: 1.45;
    color: var(--text);
    margin: 0;
}

/* ── Options ──────────────────────────────────────────────────────────────── */
.qz-options {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.qz-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, transform 0.12s;
    background: var(--card);
    position: relative;
    outline: none;
}

.qz-option:hover,
.qz-option:focus {
    border-color: var(--primary);
    background: rgba(21, 147, 168, 0.04);
    transform: translateX(3px);
}

.qz-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.qz-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(21, 147, 168, 0.08);
}

.qz-opt-letter {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--muted);
    flex-shrink: 0;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    font-family: 'Bricolage Grotesque', sans-serif;
}

.qz-option:has(input:checked) .qz-opt-letter {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.qz-opt-text {
    flex: 1;
    font-size: 0.97rem;
    line-height: 1.45;
    color: var(--text);
}

.qz-opt-check {
    font-size: 1rem;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.18s;
    flex-shrink: 0;
}

.qz-option:has(input:checked) .qz-opt-check {
    opacity: 1;
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
.qz-nav {
    padding: 1.2rem 1.5rem 2rem;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.qz-nav-dots {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.qz-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.2s, transform 0.2s;
}

.qz-dot-active {
    background: var(--primary);
    transform: scale(1.35);
}

.qz-dot-done {
    background: rgba(21, 147, 168, 0.45);
}

.qz-arrow { font-size: 1rem; }

/* ── Result page ──────────────────────────────────────────────────────────── */
.qr-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.qr-back {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.15s;
}

.qr-back:hover { color: var(--primary); }

.qr-hero {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.8rem;
    box-shadow: var(--shadow);
}

.qr-emoji {
    font-size: 2.8rem;
    line-height: 1;
}

.qr-headline {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    margin: 0;
}

.qr-sub {
    color: var(--muted);
    max-width: 42ch;
    margin: 0;
}

/* Ring chart ─────────────────────────────────────────────────────────────── */
.qr-ring {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0.5rem 0;
}

.qr-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.qr-ring-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 10;
}

.qr-ring-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dasharray 0.8s ease;
}

.qr-ring-pass .qr-ring-fill { stroke: var(--success); }
.qr-ring-fail .qr-ring-fill { stroke: var(--danger); }

.qr-ring-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qr-ring-pct {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.qr-ring-pass .qr-ring-pct { color: var(--success); }
.qr-ring-fail .qr-ring-pct { color: var(--danger); }

.qr-ring-lbl {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

.qr-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.4rem;
}

/* Review cards ───────────────────────────────────────────────────────────── */
.qr-review-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.qr-review-card {
    display: flex;
    gap: 0.85rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--border);
}

.qrr-correct { border-left-color: var(--success); }
.qrr-wrong   { border-left-color: var(--danger); }

.qrr-badge {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.qrr-correct .qrr-badge { background: rgba(31,157,110,0.15); color: var(--success); }
.qrr-wrong   .qrr-badge { background: rgba(215,58,73,0.12);  color: var(--danger); }

.qrr-body { flex: 1; }

.qrr-num {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.qrr-text {
    font-weight: 600;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.qrr-options {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.3rem;
}

.qrro {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    font-size: 0.88rem;
    border: 1px solid var(--border);
    background: var(--card-soft);
}

.qrro-correct {
    background: rgba(31,157,110,0.1);
    border-color: rgba(31,157,110,0.35);
}

.qrro-wrong {
    background: rgba(215,58,73,0.08);
    border-color: rgba(215,58,73,0.3);
}

.qrro-letter {
    font-size: 0.75rem;
    font-weight: 800;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    flex-shrink: 0;
}

.qrro-correct .qrro-letter { background: var(--success); color: #fff; }
.qrro-wrong   .qrro-letter { background: var(--danger);  color: #fff; }

.qrro-tag {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--success);
    white-space: nowrap;
}

.qrro-tag-wrong { color: var(--danger); }

/* ── Quiz: module bar ──────────────────────────────────────────────────────── */
.quiz-module-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    margin-top: 0.6rem;
    background: linear-gradient(135deg, rgba(21, 147, 168, 0.08), rgba(21, 147, 168, 0.03));
    border: 1px solid rgba(21, 147, 168, 0.25);
    border-radius: 12px;
    flex-wrap: wrap;
}

.quiz-module-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.quiz-icon {
    font-size: 1.3rem;
    color: var(--primary);
}

.quiz-module-info strong {
    display: block;
    font-size: 0.95rem;
}

.quiz-module-info small {
    color: var(--muted);
    font-size: 0.82rem;
}

.btn-lg {
    padding: 0.75rem 1.8rem;
    font-size: 1rem;
}

/* ── Quiz: admin panel ─────────────────────────────────────────────────────── */
.quiz-admin-question {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    background: var(--card-soft);
}

.quiz-admin-question-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.quiz-admin-options {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.3rem;
}

.quiz-admin-options li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.quiz-admin-opt-correct {
    color: var(--success) !important;
    font-weight: 600;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: 0.15s ease;
}

.radio-label:has(input:checked) {
    border-color: var(--primary);
    background: rgba(21, 147, 168, 0.08);
    color: var(--primary);
}

.badge-danger {
    background: rgba(215, 58, 73, 0.12);
    color: var(--danger);
    border: 1px solid rgba(215, 58, 73, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}
