/**
 * FAPIA Quiz — design system app mobile (tema claro, Nubank / quiz moderno)
 */

:root {
    --bg: #f5f6fa;
    --bg-elevated: #eef0f5;
    --surface: #ffffff;
    --card: #ffffff;
    --border: #e8ecf0;
    --border-strong: #dfe4ea;
    --text: #2d3436;
    --muted: #636e72;
    --accent: #6c5ce7;
    --accent-dim: #5a4bd1;
    --accent-soft: rgba(108, 92, 231, 0.12);
    --accent2: #00b894;
    --accent2-soft: rgba(0, 184, 148, 0.12);
    --danger: #d63031;
    --danger-soft: rgba(214, 48, 49, 0.1);
    --radius: 20px;
    --radius-sm: 14px;
    --radius-pill: 999px;
    --shadow: 0 4px 24px rgba(108, 92, 231, 0.12);
    --shadow-sm: 0 2px 12px rgba(45, 52, 54, 0.06);
    --shadow-btn: 0 4px 14px rgba(108, 92, 231, 0.35);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --topbar-h: 56px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ——— Shell grupo ——— */
.app-shell {
    min-height: 100dvh;
    padding-bottom: calc(16px + var(--safe-bottom));
    background: linear-gradient(165deg, #f0f1ff 0%, var(--bg) 38%, #f5f9f8 100%);
}

.app-frame {
    max-width: 420px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: var(--topbar-h);
}

.app-topbar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 420px;
    z-index: 100;
    height: var(--topbar-h);
    padding: 0 18px;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.88) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.app-brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.app-main {
    flex: 1;
    padding: 16px 16px 24px;
}

/* ——— Cards ——— */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    box-shadow: var(--shadow-sm);
}

.card + .card {
    margin-top: 14px;
}

/* ——— Tipografia ——— */
.h1 {
    margin: 0 0 10px;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

.h2 {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

.h3 {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.lead {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 0.98rem;
}

.muted {
    color: var(--muted);
    font-size: 0.92rem;
}

.small {
    font-size: 0.82rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-lg {
    margin-top: 22px;
}

/* ——— Form ——— */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 8px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: #b2bec3;
}

input:hover,
textarea:hover {
    border-color: var(--border-strong);
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.textarea-lg {
    min-height: 140px;
    resize: vertical;
}

.textarea-mid {
    min-height: 110px;
}

.desc {
    color: var(--muted);
    margin: 0 0 16px;
    font-size: 0.95rem;
    line-height: 1.55;
}

/* ——— Botões ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-pill);
    padding: 14px 22px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #7c6ee8 100%);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-dim) 0%, var(--accent) 100%);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg);
    border-color: var(--border-strong);
}

.btn-sm {
    padding: 10px 16px;
    font-size: 0.9rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.12s ease;
}

.btn-icon:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(214, 48, 49, 0.25);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

.form-msg {
    min-height: 1.35em;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--danger);
}

.form-msg.ok {
    color: var(--accent2);
}

.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dynamic-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.dynamic-row input {
    flex: 1;
}

/* Cadastro: ícone hero + separador */
.card-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.card-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--accent-soft), rgba(162, 155, 254, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.form-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 4px 0 2px;
}

.btn-add-fab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding: 10px 16px 10px 12px;
    border-radius: var(--radius-pill);
    border: 1.5px dashed var(--border-strong);
    background: var(--bg);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.12s ease;
}

.btn-add-fab:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.btn-add-fab:active {
    transform: scale(0.98);
}

.btn-add-fab-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 300;
}

/* Banner retomada */
.resume-banner {
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--accent-soft), var(--accent2-soft));
    border: 1px solid rgba(108, 92, 231, 0.22);
    box-shadow: var(--shadow-sm);
}

.resume-banner-inner {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.resume-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.resume-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

/* ——— Quiz: progresso fixo ——— */
.quiz-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-progress-sticky {
    position: sticky;
    top: var(--topbar-h);
    z-index: 50;
    margin: 0 -16px;
    padding: 12px 16px 14px;
    background: linear-gradient(180deg, rgba(245, 246, 250, 0.98) 85%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.quiz-meta-line {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0 0 10px;
    font-weight: 500;
}

.progress-row {
    margin-top: 0;
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: var(--radius-pill);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.progress-bar span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--accent), #a29bfe);
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(108, 92, 231, 0.45);
}

.quiz-wrap {
    position: relative;
    overflow: visible;
}

.quiz-head-inner {
    margin-bottom: 4px;
}

.quiz-slide-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.quiz-badge-num {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--accent), #8b7ff0);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
}

.quiz-slide-head .h2 {
    margin: 0;
    flex: 1;
    font-size: 1.12rem;
    line-height: 1.35;
}

.field-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 14px 12px;
    margin-bottom: 12px;
}

.field-block .label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.field-block-icon {
    color: var(--accent);
    flex-shrink: 0;
}

.field-block--result .field-block-icon {
    color: var(--accent2);
}

.quiz-slides {
    position: relative;
    min-height: 200px;
}

.quiz-slide {
    display: none;
    opacity: 0;
    transform: translateX(22px);
}

.quiz-slide.is-active {
    display: block;
    animation: quizEnter 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.quiz-slide.is-active.is-leaving {
    animation: quizLeave 0.28s ease forwards;
}

@keyframes quizEnter {
    from {
        opacity: 0;
        transform: translateX(22px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes quizLeave {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-18px);
    }
}

.save-hint {
    min-height: 1.35em;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--muted);
    margin-top: 8px;
    transition: color 0.2s ease;
}

.save-hint.saved {
    color: var(--accent2);
    animation: hintPop 0.55s ease;
}

@keyframes hintPop {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.quiz-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.nav-loading {
    flex: 0 0 auto;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner.sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 52px;
    height: 52px;
    border-width: 3px;
    border-color: var(--border);
    border-top-color: var(--accent);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ——— Finalização ——— */
.success-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 22px;
}

.success-check-wrap {
    margin-bottom: 16px;
}

.success-check-svg {
    width: 88px;
    height: 88px;
}

.success-check-svg .circle-path {
    fill: none;
    stroke: var(--accent2);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: drawCircle 0.55s ease forwards 0.1s;
}

.success-check-svg .check-path {
    stroke: var(--accent2);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 42;
    stroke-dashoffset: 42;
    animation: drawCheck 0.42s ease forwards 0.52s;
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

.success-icon-soft {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: linear-gradient(145deg, var(--accent-soft), var(--accent2-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.resumo-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.resumo-item-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.resumo-item-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.resumo-chunk {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 0.86rem;
    line-height: 1.45;
}

.resumo-chunk--prompt {
    background: var(--accent-soft);
    border: 1px solid rgba(108, 92, 231, 0.15);
    color: var(--text);
}

.resumo-chunk--result {
    background: var(--accent2-soft);
    border: 1px solid rgba(0, 184, 148, 0.18);
    color: var(--text);
    margin-bottom: 0;
}

.resumo-chunk-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 6px;
}

.resumo-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

/* ——— Animações globais ——— */
.fade-in {
    animation: fadeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.pulse-soft {
    animation: pulseSoft 1.4s ease-in-out infinite;
}

@keyframes pulseSoft {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.65;
    }
}

a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-dim);
    text-decoration: underline;
}

/* ——— Admin ——— */
.admin-body {
    background: linear-gradient(165deg, #f0f1ff 0%, var(--bg) 40%, #f5faf8 100%);
    min-height: 100dvh;
}

.admin-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 18px calc(28px + var(--safe-bottom));
}

.admin-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.admin-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.admin-filter .btn.is-active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 700;
}

.admin-filter-hint {
    margin: -4px 0 14px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

@media (max-width: 600px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

.stat-card-value {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
}

.stat-card-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-top: 6px;
}

.stat-card--accent .stat-card-value {
    color: var(--accent);
}

.stat-card--green .stat-card-value {
    color: var(--accent2);
}

.stat-card--amber .stat-card-value {
    color: #e17055;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

table.simple {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

table.simple th,
table.simple td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

table.simple tbody tr:nth-child(even) {
    background: rgba(245, 246, 250, 0.65);
}

table.simple tbody tr:hover {
    background: var(--accent-soft);
}

table.simple th {
    background: linear-gradient(180deg, #fafbff, #f3f4f8);
    color: var(--muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table.simple tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-on {
    background: rgba(253, 203, 110, 0.35);
    color: #b8860b;
}

.badge-done {
    background: var(--accent2-soft);
    color: #00a383;
}

.accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.acc-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.acc-item.is-open {
    border-color: rgba(108, 92, 231, 0.35);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.1);
}

.acc-head {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    background: transparent;
    color: var(--text);
    border: none;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-family: inherit;
    transition: background 0.15s ease;
}

.acc-head:hover {
    background: var(--bg);
}

.acc-item.is-open .acc-head {
    background: var(--accent-soft);
}

.acc-panel {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    background: linear-gradient(180deg, #fafbfd, var(--surface));
}

.acc-item.is-open .acc-panel {
    display: block;
    animation: fadeIn 0.3s ease both;
}

.acc-item.is-open .acc-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.acc-chevron {
    transition: transform 0.25s ease, color 0.2s ease;
    color: var(--muted);
    font-size: 0.75rem;
}

.admin-section-title {
    margin: 28px 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.answer-block {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    white-space: pre-wrap;
    font-size: 0.86rem;
    color: var(--text);
    line-height: 1.45;
}

.admin-answer-list > li:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.winner-box {
    margin-top: 0;
    margin-bottom: 18px;
    padding: 20px 20px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(108, 92, 231, 0.25);
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(0, 184, 148, 0.08));
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.winner-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    color: #f9a825;
}

.winner-box h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.winner-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 10px;
    font-weight: 500;
}

/* Login admin central */
.admin-login-wrap {
    min-height: calc(100dvh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.admin-login-card {
    width: 100%;
    max-width: 400px;
}

/* ——— Topbar nav ——— */
.app-topbar-nav {
    display: flex;
    gap: 6px;
}

.app-topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.app-topbar-link:hover {
    color: var(--accent);
    background: var(--accent-soft);
    text-decoration: none;
}

.app-topbar-link.is-active {
    color: var(--accent);
    border-color: rgba(108, 92, 231, 0.3);
    background: var(--accent-soft);
}

/* ——— XP Card (trilha) ——— */
.xp-card {
    background: linear-gradient(135deg, var(--accent) 0%, #8b7ff0 100%);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    color: #fff;
    margin-bottom: 14px;
    box-shadow: 0 6px 24px rgba(108, 92, 231, 0.35);
}

.xp-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.xp-grupo-nome {
    margin: 0 0 3px;
    font-weight: 700;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.95);
}

.xp-nivel-label {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
}

.xp-badge {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.xp-badge-num {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}

.xp-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.xp-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.xp-bar span {
    display: block;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-pill);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.xp-bar-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.xp-progress-hint {
    margin-top: 8px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
}

/* ——— Trilha ——— */
.trilha-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.trilha-node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
}

.trilha-node-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
}

.trilha-node--done .trilha-node-label {
    color: var(--accent2);
}

.trilha-node--locked .trilha-node-label {
    color: var(--muted);
    opacity: 0.6;
}

.trilha-dot {
    font-size: 1.1rem;
    color: var(--accent2);
    flex-shrink: 0;
}

.trilha-dot--done {
    color: var(--accent2);
}

.trilha-line {
    width: 2px;
    min-height: 20px;
    background: linear-gradient(to bottom, var(--accent2), rgba(0, 184, 148, 0.3));
    margin-left: 10px;
    border-radius: 2px;
}

.trilha-line--dim {
    background: var(--border);
}

.trilha-mod {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin: 4px 0;
}

.trilha-mod--done {
    border-color: rgba(0, 184, 148, 0.4);
    background: linear-gradient(135deg, rgba(0, 184, 148, 0.04), var(--card));
}

.trilha-mod--active {
    border-color: rgba(108, 92, 231, 0.4);
    box-shadow: 0 4px 18px rgba(108, 92, 231, 0.12);
}

.trilha-mod--locked {
    opacity: 0.65;
}

.trilha-mod-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.trilha-mod-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.trilha-mod-titulo {
    font-size: 0.96rem;
    color: var(--text);
    display: block;
    margin-bottom: 2px;
}

.trilha-mod-status {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
}

.trilha-mod-status--done {
    color: var(--accent2);
    font-weight: 600;
}

.trilha-desafios {
    border-top: 1px solid var(--border);
    padding: 12px 16px 16px;
}

.trilha-desafio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.trilha-desafio:last-of-type {
    border-bottom: none;
}

.trilha-desafio--done .trilha-desafio-dot {
    color: var(--accent2);
}

.trilha-desafio--done .trilha-desafio-titulo {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-color: rgba(0, 184, 148, 0.5);
}

.trilha-desafio-dot {
    flex-shrink: 0;
    color: var(--border-strong);
    font-weight: 700;
}

.trilha-desafio-titulo {
    flex: 1;
    color: var(--text);
}

.trilha-desafio-xp {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.trilha-locked-hint {
    padding: 10px 16px 14px;
    font-size: 0.82rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin: 0;
}

/* ——— Medalhas ——— */
.medal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.medal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: default;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.medal-item--active {
    border-color: rgba(108, 92, 231, 0.35);
    background: linear-gradient(145deg, var(--accent-soft), rgba(162, 155, 254, 0.1));
}

.medal-item--active:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.15);
}

.medal-item--locked {
    opacity: 0.45;
}

.medal-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.medal-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    line-height: 1.2;
}

/* ——— Quiz HUD ——— */
.quiz-hud {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.quiz-hud-xp {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    background: var(--accent-soft);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
}

.quiz-hud-nivel {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.quiz-hud-bar {
    flex: 1;
    height: 6px;
    background: rgba(108, 92, 231, 0.15);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.quiz-hud-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a29bfe);
    border-radius: var(--radius-pill);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-hud-xp-num {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ——— Slide bloqueado ——— */
.quiz-slide-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px;
    gap: 14px;
}

.quiz-locked-icon {
    font-size: 2.5rem;
    line-height: 1;
}

/* ——— Toast XP ——— */
.xp-toast {
    position: fixed;
    bottom: calc(80px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.xp-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.xp-toast-line {
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 18px rgba(108, 92, 231, 0.4);
    white-space: nowrap;
}

/* ——— Final XP card ——— */
.final-xp-card {
    background: linear-gradient(135deg, var(--accent-soft), rgba(162, 155, 254, 0.15));
    border: 1.5px solid rgba(108, 92, 231, 0.25);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 14px 0;
}

.final-xp-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.final-xp-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #8b7ff0);
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.3);
}

.final-xp-titulo {
    margin: 0 0 3px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.final-xp-total {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted);
}

.final-medals {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.final-medal {
    font-size: 1.5rem;
    line-height: 1;
    padding: 6px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Sessão recuperar */
.retomar-screen {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 16px;
}

.retomar-screen .spinner-lg {
    margin-bottom: 24px;
}
