/* =========================================================
   Portal de Conhecimento E-IT - Tema NEON (light/dark)
   Azul ciano + roxo violeta, hover FX com glow
========================================================= */
*, *::before, *::after { box-sizing: border-box; }

/* ------- TEMA: claro ------- */
:root {
    --bg-app:        #f5f7fc;
    --bg-card:       #ffffff;
    --bg-soft:       #eef1f9;
    --bg-hover:      #e7ebf5;

    --text:          #0b1235;
    --text-soft:     #4a5275;
    --text-mute:     #8b93b3;

    --border:        #d9def0;
    --border-strong: #b8c0e0;

    --neon-blue:     #2563eb;
    --neon-purple:   #8b5cf6;
    --neon-cyan:     #06b6d4;
    --brand:         var(--neon-blue);
    --brand-2:       var(--neon-purple);
    --brand-text:    #ffffff;

    --grad-brand:    linear-gradient(135deg, #2563eb 0%, #8b5cf6 100%);
    --grad-brand-h:  linear-gradient(135deg, #1d4ed8 0%, #7c3aed 100%);
    --grad-soft:     linear-gradient(135deg, rgba(37,99,235,.10) 0%, rgba(139,92,246,.10) 100%);

    --glow-brand:    0 0 0 0 rgba(99, 102, 241, 0);
    --glow-brand-h:  0 0 24px rgba(139, 92, 246, .35), 0 6px 18px rgba(37, 99, 235, .25);

    --topbar-bg:     #0b1235;
    --topbar-text:   #f0f3ff;
    --topbar-mute:   rgba(240, 243, 255, .65);

    --ok:            #10b981;
    --warn:          #f59e0b;
    --danger:        #ef4444;
    --info:          #3b82f6;

    --ok-bg:         rgba(16, 185, 129, .12);
    --ok-fg:         #047857;
    --warn-bg:       rgba(245, 158, 11, .14);
    --warn-fg:       #92400e;
    --danger-bg:     rgba(239, 68, 68, .12);
    --danger-fg:     #b91c1c;
    --info-bg:       rgba(59, 130, 246, .12);
    --info-fg:       #1d4ed8;
    --off-bg:        rgba(139, 147, 179, .15);
    --off-fg:        #4a5275;

    --shadow-sm:     0 1px 2px rgba(11, 18, 53, .04);
    --shadow:        0 2px 6px rgba(11, 18, 53, .06), 0 8px 24px rgba(11, 18, 53, .05);
    --shadow-lg:     0 12px 32px rgba(11, 18, 53, .12);

    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     14px;
    --radius-xl:     20px;
}

/* ------- TEMA: escuro NEON ------- */
[data-theme="dark"] {
    --bg-app:        #050714;
    --bg-card:       #0f1330;
    --bg-soft:       #161b3d;
    --bg-hover:      #1d2350;

    --text:          #e6ebff;
    --text-soft:     #b3bbe5;
    --text-mute:     #6c7399;

    --border:        rgba(139, 92, 246, .18);
    --border-strong: rgba(139, 92, 246, .38);

    --neon-blue:     #38bdf8;
    --neon-purple:   #c084fc;
    --neon-cyan:     #22d3ee;
    --brand:         #60a5fa;
    --brand-2:       #c084fc;

    --grad-brand:    linear-gradient(135deg, #38bdf8 0%, #c084fc 100%);
    --grad-brand-h:  linear-gradient(135deg, #22d3ee 0%, #d8b4fe 100%);
    --grad-soft:     linear-gradient(135deg, rgba(56,189,248,.12) 0%, rgba(192,132,252,.12) 100%);

    --glow-brand:    0 0 0 0 rgba(192,132,252,0);
    --glow-brand-h:  0 0 28px rgba(192, 132, 252, .55), 0 0 12px rgba(56, 189, 248, .45);

    --topbar-bg:     #07091c;
    --topbar-text:   #e6ebff;
    --topbar-mute:   rgba(230, 235, 255, .55);

    --ok:            #34d399;
    --warn:          #fbbf24;
    --danger:        #f87171;
    --info:          #60a5fa;

    --ok-bg:         rgba(52, 211, 153, .15);
    --ok-fg:         #6ee7b7;
    --warn-bg:       rgba(251, 191, 36, .15);
    --warn-fg:       #fcd34d;
    --danger-bg:     rgba(248, 113, 113, .15);
    --danger-fg:     #fca5a5;
    --info-bg:       rgba(96, 165, 250, .18);
    --info-fg:       #93c5fd;
    --off-bg:        rgba(139, 147, 179, .18);
    --off-fg:        #b3bbe5;

    --shadow-sm:     0 1px 2px rgba(0,0,0,.4);
    --shadow:        0 2px 8px rgba(0,0,0,.5), 0 0 24px rgba(56,189,248,.04);
    --shadow-lg:     0 16px 48px rgba(0,0,0,.7), 0 0 60px rgba(192,132,252,.08);
}

/* ------- Reset / base ------- */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-app);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background .35s ease, color .35s ease;
}
[data-theme="dark"] body {
    background:
        radial-gradient(ellipse at 12% 0%,  rgba(56, 189, 248, .12)  0%, transparent 45%),
        radial-gradient(ellipse at 88% 90%, rgba(192, 132, 252, .14) 0%, transparent 50%),
        var(--bg-app);
    background-attachment: fixed;
}

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-2); text-decoration: underline; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* ------- Topbar ------- */
.topbar {
    background: var(--topbar-bg);
    color: var(--topbar-text);
    border-bottom: 1px solid rgba(255,255,255,.05);
    position: sticky; top: 0; z-index: 50;
    box-shadow: 0 2px 24px rgba(0,0,0,.25);
}
[data-theme="dark"] .topbar {
    background: linear-gradient(180deg, rgba(7,9,28,.95), rgba(7,9,28,.85));
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid rgba(192, 132, 252, .15);
    box-shadow: 0 2px 32px rgba(0,0,0,.5), 0 0 24px rgba(56,189,248,.05);
}
.topbar a { color: var(--topbar-text); }
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 28px; gap: 18px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; font-size: 16px; letter-spacing: -.01em;
}
.brand-mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--grad-brand); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 14px;
    box-shadow: 0 0 16px rgba(139, 92, 246, .35);
}
.brand-mark.big { width: 60px; height: 60px; font-size: 28px; border-radius: 18px; box-shadow: 0 0 32px rgba(139, 92, 246, .45); }

.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
    padding: 8px 14px; border-radius: 8px;
    color: var(--topbar-mute); font-weight: 500; font-size: 13.5px;
    transition: background .2s, color .2s, box-shadow .2s;
    position: relative;
}
.nav a:hover { background: rgba(255,255,255,.08); color: var(--topbar-text); text-decoration: none; }
.nav a.active {
    background: rgba(192, 132, 252, .15);
    color: #fff;
    box-shadow: inset 0 -2px 0 var(--neon-purple);
}
[data-theme="dark"] .nav a.active {
    background: linear-gradient(180deg, transparent, rgba(192,132,252,.12));
    box-shadow: inset 0 -2px 0 var(--neon-purple), 0 0 16px rgba(192, 132, 252, .25);
}

.user-menu { display: flex; align-items: center; gap: 10px; }
.user-name { color: var(--topbar-mute); font-size: 13px; }

/* Theme toggle */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: rgba(255,255,255,.08); color: var(--topbar-text);
    border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
    cursor: pointer; transition: all .2s;
}
.theme-toggle:hover {
    background: var(--grad-brand);
    border-color: transparent;
    box-shadow: 0 0 18px rgba(192, 132, 252, .5);
    transform: translateY(-1px);
}
.theme-toggle:active { transform: scale(.94); }
.theme-toggle .ico-sun { display: none; }
.theme-toggle .ico-moon { display: inline; }
[data-theme="dark"] .theme-toggle .ico-sun { display: inline; }
[data-theme="dark"] .theme-toggle .ico-moon { display: none; }

/* ------- Main ------- */
.main { padding: 32px 28px 80px; min-height: calc(100vh - 130px); }
.page-title {
    margin: 0 0 22px; font-size: 26px; font-weight: 700;
    letter-spacing: -.02em;
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head .page-title { margin: 0; }

/* ------- Cards ------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    transition: background .2s, border-color .2s, box-shadow .2s;
    position: relative;
}
[data-theme="dark"] .card {
    background: linear-gradient(180deg, rgba(15,19,48,.85), rgba(15,19,48,.65));
    backdrop-filter: blur(8px);
}
.card.no-pad { padding: 0; overflow: hidden; }
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px; margin-bottom: 22px;
}
.card.stat { text-align: center; padding: 22px 16px; }
.stat-num {
    font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1;
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--text-soft); font-size: 12.5px; margin-top: 6px; font-weight: 500; }
.card.stat.warn   .stat-num { background: linear-gradient(135deg, #fb923c, #f59e0b); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.card.stat.danger .stat-num { background: linear-gradient(135deg, #f87171, #dc2626); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.link-card { display: block; cursor: pointer; transition: transform .2s, box-shadow .25s, border-color .2s; overflow: hidden; }
.link-card::before {
    content: ''; position: absolute; inset: 0;
    background: var(--grad-soft); opacity: 0;
    transition: opacity .25s; pointer-events: none;
}
.link-card:hover {
    transform: translateY(-3px);
    border-color: var(--neon-purple);
    box-shadow: var(--glow-brand-h);
    text-decoration: none;
}
.link-card:hover::before { opacity: 1; }
.link-card > * { position: relative; z-index: 1; }
.link-card h3 { margin: 0 0 4px; color: var(--text); font-size: 15px; font-weight: 600; }
.link-card p  { margin: 0; color: var(--text-soft); font-size: 13px; }

/* ------- Form ------- */
.form .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px; margin-bottom: 16px;
}
.form label, .login-card label { display: block; margin-bottom: 14px; }
.form label > span, .login-card label > span {
    display: block; font-weight: 500; font-size: 12.5px;
    margin-bottom: 5px; color: var(--text-soft);
}
.form label em, .login-card label em { color: var(--danger); font-style: normal; }

input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="search"],
input[type="color"],
select, textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 14px; font-family: inherit;
    background: var(--bg-card); color: var(--text);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .18), 0 0 18px rgba(139, 92, 246, .15);
}
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus {
    box-shadow: 0 0 0 2px var(--brand), 0 0 28px rgba(192, 132, 252, .35);
}
input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
input[readonly] { background: var(--bg-soft); color: var(--text-soft); }
textarea { resize: vertical; min-height: 70px; }

.form .check, .login-card .check { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.form .check input, .login-card .check input { width: auto; }
.form .check span, .login-card .check span { font-weight: 400; margin: 0; color: var(--text); }

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

/* ------- Botoes ------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px;
    background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 13.5px; font-weight: 500; cursor: pointer;
    transition: all .2s ease;
    text-decoration: none;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: ''; position: absolute; inset: 0;
    background: var(--grad-soft); opacity: 0;
    transition: opacity .2s; pointer-events: none;
}
.btn:hover {
    background: var(--bg-hover);
    border-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(99,102,241,.18);
}
.btn:hover::before { opacity: 1; }
.btn:active { transform: translateY(0); }
.btn > * { position: relative; z-index: 1; }

.btn-primary {
    background: var(--grad-brand);
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(99, 102, 241, .25);
}
.btn-primary::before {
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,.25) 50%, transparent 100%);
    transform: translateX(-100%); opacity: 1;
    transition: transform .5s;
}
.btn-primary:hover {
    background: var(--grad-brand-h);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--glow-brand-h);
    border: none;
}
.btn-primary:hover::before { transform: translateX(100%); }

.btn-danger {
    background: var(--danger-bg);
    border: 1px solid transparent;
    color: var(--danger-fg);
}
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    box-shadow: 0 0 18px rgba(239, 68, 68, .4);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); border-color: transparent; box-shadow: none; transform: none; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-play {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    border: none; color: #fff; font-weight: 600;
    box-shadow: 0 0 12px rgba(16, 185, 129, .3);
}
.btn-play:hover {
    background: linear-gradient(135deg, #059669 0%, #0891b2 100%);
    color: #fff; border: none;
    box-shadow: 0 0 24px rgba(6, 182, 212, .55), 0 4px 14px rgba(16, 185, 129, .35);
    transform: translateY(-2px);
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

.filtros { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.filtros input[type="search"] { max-width: 380px; }

.filtros-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.filtros-row label { flex: 1 1 180px; min-width: 160px; display: block; margin: 0; }
.filtros-row label > span { display: block; font-weight: 500; font-size: 12.5px; margin-bottom: 5px; color: var(--text-soft); }

/* ------- Tabela ------- */
.tabela { width: 100%; border-collapse: collapse; }
.tabela thead th {
    background: var(--bg-soft); color: var(--text-soft);
    text-align: left; padding: 12px 16px;
    font-size: 11.5px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid var(--border);
}
.tabela tbody td {
    padding: 13px 16px; border-bottom: 1px solid var(--border);
    vertical-align: middle; font-size: 13.5px;
}
.tabela tbody tr:last-child td { border-bottom: none; }
.tabela tbody tr { transition: background .15s; }
.tabela tbody tr:hover { background: var(--bg-hover); }
[data-theme="dark"] .tabela tbody tr:hover { background: rgba(56, 189, 248, .06); }
.tabela .acoes { white-space: nowrap; text-align: right; }
.tabela .vazio { text-align: center; color: var(--text-soft); padding: 36px 16px; font-style: italic; }

/* ------- Badges ------- */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 999px; font-size: 11.5px; font-weight: 600;
    line-height: 1.5;
}
.badge.ok     { background: var(--ok-bg);     color: var(--ok-fg); }
.badge.warn   { background: var(--warn-bg);   color: var(--warn-fg); }
.badge.danger { background: var(--danger-bg); color: var(--danger-fg); }
.badge.info   { background: var(--info-bg);   color: var(--info-fg); }
.badge.off    { background: var(--off-bg);    color: var(--off-fg); }

/* ------- Tag picker ------- */
.tag-picker {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
    padding: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.tag-chip {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 14px;
    border: 1.5px solid var(--border); border-radius: 8px;
    cursor: pointer;
    background: var(--bg-card); color: var(--text);
    transition: all .2s;
    user-select: none;
    font-size: 13.5px; font-weight: 500; line-height: 1;
}
.tag-chip > input[type="checkbox"] {
    width: 16px; height: 16px; margin: 0; cursor: pointer;
    accent-color: var(--tc, var(--brand)); flex-shrink: 0;
}
.tag-chip > span { line-height: 1; }
.tag-chip:hover {
    background: var(--bg-hover);
    border-color: var(--tc, var(--brand-strong));
    transform: translateY(-1px);
    box-shadow: 0 0 12px color-mix(in srgb, var(--tc, var(--brand)) 25%, transparent);
}
.tag-chip.is-checked {
    border-color: var(--tc, var(--brand));
    background: color-mix(in srgb, var(--tc, var(--brand)) 14%, var(--bg-card));
    color: var(--text); font-weight: 600;
    box-shadow: 0 0 16px color-mix(in srgb, var(--tc, var(--brand)) 30%, transparent);
}
[data-theme="dark"] .tag-chip.is-checked {
    background: color-mix(in srgb, var(--tc, var(--brand)) 28%, var(--bg-card));
    box-shadow: 0 0 22px color-mix(in srgb, var(--tc, var(--brand)) 40%, transparent);
}

/* ------- Tipo picker (perguntas) ------- */
.tipo-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px; margin-bottom: 18px;
}
.tipo-card {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px;
    border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer; text-align: left;
    transition: all .2s;
    position: relative;
}
.tipo-card input[type="radio"] { position: absolute; opacity: 0; }
.tipo-card:hover {
    border-color: var(--brand);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 14px rgba(99,102,241,.18);
}
.tipo-card .tipo-titulo { font-weight: 600; font-size: 14px; color: var(--text); }
.tipo-card .tipo-desc { font-size: 12px; color: var(--text-soft); }
.tipo-card.is-active {
    border-color: var(--brand-2);
    background: color-mix(in srgb, var(--brand) 10%, var(--bg-card));
    box-shadow: 0 0 22px rgba(139, 92, 246, .25);
}
.tipo-card.is-active .tipo-titulo {
    background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ------- Quill ------- */
.editor-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.editor-wrap .ql-toolbar.ql-snow {
    border: none; border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--bg-soft);
}
.editor-wrap .ql-container.ql-snow {
    border: none; min-height: 140px; font-size: 14.5px;
    border-radius: 0 0 var(--radius) var(--radius);
    color: var(--text);
}
[data-theme="dark"] .ql-snow .ql-stroke { stroke: var(--text-soft); }
[data-theme="dark"] .ql-snow .ql-fill, [data-theme="dark"] .ql-snow .ql-stroke.ql-fill { fill: var(--text-soft); }
[data-theme="dark"] .ql-snow .ql-picker { color: var(--text-soft); }
[data-theme="dark"] .ql-snow .ql-picker-options { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .ql-editor.ql-blank::before { color: var(--text-mute); }

.editor-readonly { padding: 0; }
.editor-readonly img, .ql-editor img {
    max-width: 100%; height: auto; border-radius: 6px; cursor: pointer;
    transition: outline .12s;
}
.ql-editor img.img-selected { outline: 2px solid var(--brand); outline-offset: 2px; }
.ql-editor p { overflow: visible; }

.img-edit-toolbar {
    position: absolute; z-index: 9999;
    background: #07091c; color: #fff;
    padding: 5px 6px; border-radius: 8px;
    box-shadow: 0 6px 28px rgba(0,0,0,.5), 0 0 18px rgba(192,132,252,.35);
    border: 1px solid rgba(192,132,252,.3);
    display: flex; gap: 2px; align-items: center;
    font-size: 12.5px; font-family: inherit; user-select: none;
}
.img-edit-toolbar button {
    background: transparent; color: #fff; border: none;
    padding: 5px 9px; border-radius: 5px; cursor: pointer;
    font-size: 12px; font-family: inherit; font-weight: 500; min-width: 30px;
}
.img-edit-toolbar button:hover { background: rgba(192,132,252,.25); }
.img-edit-toolbar button.is-active { background: var(--grad-brand); }
.img-edit-toolbar .sep { color: rgba(255,255,255,.25); padding: 0 4px; }
.img-edit-toolbar input[type="range"] { width: 80px; accent-color: var(--neon-purple); }
.img-edit-toolbar .pct { color: rgba(255,255,255,.85); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.img-edit-toolbar button.btn-del { background: rgba(239,68,68,.25); }
.img-edit-toolbar button.btn-del:hover { background: rgba(239,68,68,.6); }

/* ------- Quiz / opcoes ------- */
.opcao-row {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
    background: var(--bg-soft); padding: 9px 12px; border-radius: var(--radius);
    border: 1px solid var(--border);
}
.opcao-row input[type="text"] { flex: 1; background: var(--bg-card); }
.opcao-row .handle { cursor: grab; color: var(--text-mute); padding: 0 4px; }
.opcao-row .btn-rm {
    background: var(--danger-bg); color: var(--danger-fg);
    border-color: var(--danger-bg); padding: 4px 10px;
}

/* ------- Test taker (accordion) ------- */
.teste-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all .25s;
}
.teste-card.is-open {
    border-color: var(--brand);
    box-shadow: 0 0 28px rgba(139, 92, 246, .18), var(--shadow);
}
[data-theme="dark"] .teste-card.is-open {
    box-shadow: 0 0 38px rgba(192, 132, 252, .25), var(--shadow);
}
.teste-card.is-answered .teste-head .ans-dot {
    background: var(--ok);
    box-shadow: 0 0 10px var(--ok);
}

.teste-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 22px; cursor: pointer; user-select: none;
    gap: 12px; transition: background .15s;
}
.teste-head:hover { background: var(--bg-hover); }
.teste-head .head-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.teste-head .ans-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--border-strong); flex-shrink: 0;
    transition: all .25s;
}
.teste-head .head-num {
    color: var(--text-soft); font-size: 11.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
}
.teste-head .head-titulo {
    font-size: 14.5px; color: var(--text); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
}
.teste-head .head-tipo {
    font-size: 11px; padding: 3px 10px; border-radius: 999px;
    background: var(--grad-soft); color: var(--brand-2); font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
    border: 1px solid var(--border);
}
.teste-head .toggle-arrow { transition: transform .2s; color: var(--text-soft); font-size: 14px; }
.teste-card.is-open .toggle-arrow { transform: rotate(180deg); color: var(--brand); }

.teste-body {
    padding: 4px 22px 22px; border-top: 1px solid var(--border);
    display: none;
}
.teste-card.is-open .teste-body { display: block; }

.teste-num { color: var(--text-soft); font-size: 12px; font-weight: 600; margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .05em; }
.teste-enunciado { font-size: 15px; margin: 14px 0 18px; line-height: 1.6; }
.teste-opcoes label {
    display: block; padding: 11px 14px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
    background: var(--bg-card); transition: all .2s;
}
.teste-opcoes label:hover {
    background: var(--bg-hover); border-color: var(--brand);
    box-shadow: 0 0 14px rgba(139, 92, 246, .18);
}
.teste-opcoes input { margin-right: 10px; accent-color: var(--brand-2); }
.teste-opcoes input[type="text"] { margin: 0; }

.teste-progresso {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px; padding: 14px 18px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 13px;
    box-shadow: var(--shadow-sm);
}
.teste-progresso .barra {
    flex: 1; height: 8px; background: var(--bg-soft);
    border-radius: 4px; overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}
.teste-progresso .barra-fill {
    height: 100%;
    background: var(--grad-brand);
    transition: width .3s ease;
    box-shadow: 0 0 12px rgba(139, 92, 246, .5);
}
.teste-progresso .contador { color: var(--text-soft); font-weight: 600; min-width: 70px; text-align: right; }

.resultado-box {
    text-align: center; padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.resultado-box::before {
    content: ''; position: absolute; inset: 0;
    background: var(--grad-soft); opacity: .5;
    pointer-events: none;
}
.resultado-box > * { position: relative; z-index: 1; }
.resultado-nota { font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.resultado-status { font-size: 22px; font-weight: 700; margin: 8px 0 16px; }
.resultado-aprovado { color: var(--ok); text-shadow: 0 0 24px rgba(16, 185, 129, .35); }
.resultado-reprovado { color: var(--danger); text-shadow: 0 0 24px rgba(239, 68, 68, .35); }

/* ------- Alertas ------- */
.alert {
    padding: 12px 16px; border-radius: var(--radius);
    margin-bottom: 16px; font-size: 13.5px;
    border: 1px solid;
}
.alert-ok   { background: var(--ok-bg);     border-color: var(--ok-bg);     color: var(--ok-fg); }
.alert-erro { background: var(--danger-bg); border-color: var(--danger-bg); color: var(--danger-fg); }
.alert-info { background: var(--info-bg);   border-color: var(--info-bg);   color: var(--info-fg); }

/* ------- Login (fundo neon) ------- */
.bg-login {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(56, 189, 248, .25) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(192, 132, 252, .3) 0%, transparent 50%),
        linear-gradient(135deg, #0a0e2c 0%, #1a1340 100%);
    position: relative; overflow: hidden;
}
.bg-login::before, .bg-login::after {
    content: ''; position: absolute;
    width: 600px; height: 600px; border-radius: 50%;
    filter: blur(120px); opacity: .35; pointer-events: none;
    animation: float 14s ease-in-out infinite;
}
.bg-login::before { background: #38bdf8; top: -150px; left: -150px; }
.bg-login::after { background: #c084fc; bottom: -150px; right: -150px; animation-delay: -7s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(60px, -40px); }
}

.login-card {
    background: rgba(15, 19, 48, .85);
    backdrop-filter: blur(18px) saturate(160%);
    color: #e6ebff;
    padding: 40px 36px;
    width: 100%; max-width: 410px;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 60px rgba(0,0,0,.5), 0 0 60px rgba(192, 132, 252, .15);
    border: 1px solid rgba(192, 132, 252, .25);
    position: relative; z-index: 1;
}
.login-card label > span { color: rgba(230, 235, 255, .75); }
.login-card input {
    background: rgba(7, 9, 28, .6); color: #e6ebff;
    border: 1px solid rgba(192, 132, 252, .25);
}
.login-card input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, .35), 0 0 32px rgba(192, 132, 252, .35);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 {
    margin: 14px 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -.02em;
    background: linear-gradient(135deg, #38bdf8 0%, #c084fc 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-brand p { margin: 0; color: rgba(230, 235, 255, .65); font-size: 13.5px; }
.login-brand .brand-mark { margin: 0 auto; }
.login-help { text-align: center; margin-top: 18px; color: rgba(230, 235, 255, .6); }
.login-help a { color: var(--neon-cyan); }
.login-help code {
    background: rgba(7, 9, 28, .6); padding: 2px 6px; border-radius: 4px;
    font-size: 12px; color: #e6ebff; border: 1px solid rgba(192, 132, 252, .2);
}

/* ------- Tiles (home) ------- */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px; margin-top: 12px;
}
.tile {
    position: relative; display: flex; flex-direction: column;
    padding: 28px 26px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--text);
    transition: all .25s ease;
    overflow: hidden;
    min-height: 200px;
}
.tile::before {
    content: ''; position: absolute; inset: 0;
    background: var(--tile-grad, var(--grad-soft));
    opacity: .08;
    transition: opacity .3s; pointer-events: none;
}
.tile::after {
    content: ''; position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: var(--tile-color, var(--brand));
    opacity: .08; filter: blur(40px);
    transition: all .35s;
    pointer-events: none;
}
.tile:hover {
    transform: translateY(-6px);
    text-decoration: none;
    border-color: var(--tile-color, var(--brand));
    box-shadow: 0 18px 48px rgba(0,0,0,.10), 0 0 32px color-mix(in srgb, var(--tile-color, var(--brand)) 25%, transparent);
}
[data-theme="dark"] .tile:hover {
    box-shadow: 0 18px 48px rgba(0,0,0,.6), 0 0 48px color-mix(in srgb, var(--tile-color, var(--brand)) 40%, transparent);
}
.tile:hover::before { opacity: .18; }
.tile:hover::after { opacity: .18; transform: scale(1.4); }

.tile > * { position: relative; z-index: 1; }
.tile-ico {
    width: 52px; height: 52px;
    display: grid; place-items: center;
    border-radius: 14px;
    background: var(--tile-grad, var(--grad-brand));
    color: #fff;
    margin-bottom: 18px;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--tile-color, var(--brand)) 40%, transparent);
    flex-shrink: 0;
}
.tile-ico svg { width: 26px; height: 26px; }
.tile h2 {
    margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -.01em;
    color: var(--text);
}
.tile p {
    margin: 0; color: var(--text-soft); font-size: 14px; line-height: 1.55;
    flex: 1;
}
.tile-cta {
    margin-top: 18px;
    color: var(--tile-color, var(--brand));
    font-weight: 600; font-size: 13px;
    display: inline-flex; align-items: center; gap: 6px;
    transition: gap .2s;
}
.tile:hover .tile-cta { gap: 12px; }

.tile-stats {
    display: flex; gap: 14px;
    margin-top: 14px; font-size: 12px; color: var(--text-soft);
}
.tile-stats strong { color: var(--text); font-size: 16px; font-weight: 700; display: block; }

/* ------- Footer ------- */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 18px 0; color: var(--text-soft); text-align: center;
}

/* ------- Banner preview ------- */
.preview-banner {
    position: sticky; top: 0; z-index: 30;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: #fff; padding: 10px 18px; font-size: 13px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; box-shadow: 0 4px 20px rgba(245, 158, 11, .35);
}
.preview-banner strong { font-weight: 700; }
.preview-banner a { color: #fff; text-decoration: underline; }

/* ------- Responsivo ------- */
@media (max-width: 760px) {
    .topbar-inner { flex-direction: column; align-items: flex-start; padding: 12px 16px; }
    .nav { width: 100%; }
    .user-menu { width: 100%; justify-content: space-between; }
    .container { padding: 0 16px; }
    .main { padding: 24px 0 60px; }
    .tabela thead { display: none; }
    .tabela, .tabela tbody, .tabela tr, .tabela td { display: block; width: 100%; }
    .tabela tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
    .tabela td { border: none !important; padding: 6px 16px; }
    .tabela .acoes { text-align: left; }
}
