:root {
    /* Cores Globais - Dark Theme com detalhes neon */
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary-color: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Glassmorphism */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top, var(--bg-dark), var(--bg-darker));
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* -----------------------------
 * Efeito Partículas (Fundo)
 * ----------------------------- */
.particles {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    bottom: -50px;
    color: var(--primary-color);
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

/* -----------------------------
 * Tela Inicial (Landing)
 * ----------------------------- */
.landing-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.landing-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease;
}

.logo-badge {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.logo-icon { font-size: 1.5rem; }
.logo-text { font-weight: 800; font-size: 1.2rem; background: linear-gradient(to right, var(--primary-color), var(--secondary-color)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.vaga-badge { margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }

.landing-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--glass-shadow);
    position: relative;
    animation: zoomIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-glow {
    position: absolute;
    top: -50px; left: 50%;
    transform: translateX(-50%);
    width: 200px; height: 200px;
    background: var(--primary-color);
    filter: blur(100px);
    opacity: 0.4;
    z-index: -1;
    border-radius: 50%;
}

.vaga-info { text-align: center; margin-bottom: 2rem; }
.vaga-icon { font-size: 3rem; margin-bottom: 1rem; animation: bounce 2s infinite; }
.vaga-titulo { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.vaga-subtitulo { color: var(--text-muted); }

.info-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.pill {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section { margin-bottom: 2rem; }
.form-title { font-size: 1.5rem; margin-bottom: 0.2rem; }
.form-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 0.85rem; margin-bottom: 0.5rem; color: var(--text-muted); font-weight: 500;}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.2rem;
}
.input-wrapper input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 1rem 1rem 3rem;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}
.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    background: rgba(0,0,0,0.4);
}

.btn-iniciar {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}
.btn-iniciar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}
.btn-iniciar:active { transform: translateY(0); }

.rules-section {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 1.5rem;
    font-size: 0.9rem;
}
.rules-section h3 { font-size: 1rem; margin-bottom: 1rem; color: #fff; }
.rules-section ul { list-style: none; }
.rules-section li { margin-bottom: 0.8rem; display: flex; align-items: flex-start; gap: 0.5rem; color: var(--text-muted); }
.rules-section li strong { color: #fff; }

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-erro { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }

.landing-footer { margin-top: 2rem; color: var(--text-muted); font-size: 0.8rem; }


/* -----------------------------
 * Tela de Quiz
 * ----------------------------- */
.quiz-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.quiz-container { width: 100%; max-width: 800px; position: relative; z-index: 1; }

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: var(--glass-bg);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.candidato-info { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.avatar-icon { font-size: 1.5rem; }
.pontuacao-badge {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    min-height: 500px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
}

.quiz-state { display: flex; flex-direction: column; flex: 1; animation: fadeIn 0.4s ease; }

/* Loading State */
#loadingQuiz { align-items: center; justify-content: center; text-align: center; }
.spinner {
    width: 50px; height: 50px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

/* Área da Pergunta */
.quiz-progress { margin-bottom: 2rem; }
.progress-info { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.9rem; color: var(--text-muted); font-weight: 600;}
.progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)); width: 0%; transition: width 0.3s ease; }

.timer-container { position: relative; width: 80px; height: 80px; margin: 0 auto 2rem; }
.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 6; }
.timer-path { fill: none; stroke: var(--primary-color); stroke-width: 6; stroke-dasharray: 283; stroke-dashoffset: 0; transition: stroke-dashoffset 0.1s linear, stroke 0.3s; stroke-linecap: round; }
.timer-text { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; }

.pergunta-texto { font-size: 1.5rem; text-align: center; margin-bottom: 2.5rem; font-weight: 600; line-height: 1.4; }

.opcoes-container { display: flex; flex-direction: column; gap: 1rem; }
.opcao-btn {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: 'Inter', sans-serif;
}
.opcao-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-color);
    transform: translateX(5px);
}
.opcao-btn:active:not(:disabled) { transform: translateX(0); }

.opcao-letra { background: rgba(255,255,255,0.1); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; flex-shrink: 0; }
.opcao-btn.selecionada { border-color: var(--primary-color); background: rgba(59, 130, 246, 0.1); }
.opcao-btn.correta { border-color: var(--success-color); background: rgba(16, 185, 129, 0.1); }
.opcao-btn.correta .opcao-letra { background: var(--success-color); color: #fff; }
.opcao-btn.errada { border-color: var(--danger-color); background: rgba(239, 68, 68, 0.1); }
.opcao-btn.errada .opcao-letra { background: var(--danger-color); color: #fff; }

.opcao-btn:disabled { cursor: not-allowed; opacity: 0.8; }

/* Feedback States */
.feedback-state { align-items: center; justify-content: center; text-align: center; }
.feedback-icon { font-size: 5rem; margin-bottom: 1.5rem; animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.feedback-certa h2 { color: var(--success-color); font-size: 2.5rem; margin-bottom: 1rem; }
.feedback-errada h2 { color: var(--danger-color); font-size: 2.5rem; margin-bottom: 1rem; }
.pontos-ganhos { font-size: 1.5rem; font-weight: 700; background: rgba(255,255,255,0.1); padding: 1rem 2rem; border-radius: 50px; }


/* -----------------------------
 * Tela de Resultados
 * ----------------------------- */
.resultado-page { padding: 2rem 1rem; }
.ranking-container { max-width: 900px; margin: 0 auto; }
.resultado-header { text-align: center; margin-bottom: 3rem; animation: fadeInDown 0.8s ease; }
.resultado-header h1 { font-size: 3rem; margin-bottom: 0.5rem; background: linear-gradient(to right, #fbbf24, #f59e0b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.resultado-header p { color: var(--text-muted); font-size: 1.1rem; }

.user-stats-card {
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(139,92,246,0.1));
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 0 30px rgba(59,130,246,0.2);
}
.stat-item { text-align: center; }
.stat-value { font-size: 2.5rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; }
.stat-label { color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }

.ranking-board {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(16px);
}
.ranking-board h2 { margin-bottom: 2rem; text-align: center; font-size: 1.8rem; }

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 3rem;
    height: 250px;
}
.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%;
    max-width: 150px;
}
.podium-avatar { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; margin-bottom: 1rem; background: rgba(255,255,255,0.1); border: 2px solid; }
.podium-nome { font-weight: 700; text-align: center; margin-bottom: 0.5rem; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;}
.podium-pts { background: rgba(0,0,0,0.3); padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; }

.podium-bar { width: 100%; border-radius: 12px 12px 0 0; display: flex; justify-content: center; padding-top: 1rem; font-size: 2rem; font-weight: 800; color: rgba(0,0,0,0.5); }
.p1 { order: 2; }
.p2 { order: 1; }
.p3 { order: 3; }

.p1 .podium-bar { height: 160px; background: linear-gradient(to top, #fbbf24, #fde68a); }
.p1 .podium-avatar { border-color: #fbbf24; }
.p2 .podium-bar { height: 120px; background: linear-gradient(to top, #94a3b8, #e2e8f0); }
.p2 .podium-avatar { border-color: #94a3b8; }
.p3 .podium-bar { height: 90px; background: linear-gradient(to top, #b45309, #f59e0b); }
.p3 .podium-avatar { border-color: #b45309; }

.ranking-list { list-style: none; }
.ranking-list li {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    gap: 1rem;
    transition: background 0.3s;
}
.ranking-list li:hover { background: rgba(255,255,255,0.05); }
.ranking-list li:last-child { border-bottom: none; }

.rank-pos { width: 30px; font-weight: 800; color: var(--text-muted); font-size: 1.2rem; }
.rank-nome { flex: 1; font-weight: 600; font-size: 1.1rem; }
.rank-stats { display: flex; gap: 1.5rem; text-align: right; }
.rank-pts { font-weight: 700; color: var(--primary-color); }
.rank-time { color: var(--text-muted); font-size: 0.9rem; display: flex; align-items: center; gap: 0.3rem;}


/* -----------------------------
 * Admin
 * ----------------------------- */
.admin-login { max-width: 400px; margin: 10vh auto; }
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--bg-darker); border-right: 1px solid var(--glass-border); padding: 2rem 1rem; display: flex; flex-direction: column; gap: 1rem;}
.sidebar .logo-badge { margin-bottom: 2rem; justify-content: center; border: none; background: transparent; }
.nav-link { display: flex; align-items: center; gap: 1rem; padding: 1rem; color: var(--text-muted); text-decoration: none; border-radius: 12px; transition: all 0.3s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.05); color: #fff; }
.nav-link.active { border-left: 4px solid var(--primary-color); }
.admin-content { flex: 1; padding: 2rem; overflow-y: auto; }

.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.btn { padding: 0.8rem 1.5rem; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; font-family: 'Inter'; font-size: 0.9rem;}
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-danger { background: var(--danger-color); color: #fff; }

.data-table { width: 100%; border-collapse: collapse; background: var(--glass-bg); border-radius: 12px; overflow: hidden; border: 1px solid var(--glass-border); }
.data-table th, .data-table td { padding: 1rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); }
.data-table th { background: rgba(0,0,0,0.2); font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }
.data-table tr:hover { background: rgba(255,255,255,0.02); }

.form-admin { background: var(--glass-bg); padding: 2rem; border-radius: 16px; border: 1px solid var(--glass-border); }
.form-admin textarea { width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border); border-radius: 12px; padding: 1rem; color: #fff; font-family: 'Inter'; resize: vertical; min-height: 100px; margin-top: 0.5rem; margin-bottom: 1rem;}
.form-admin select { width: 100%; background: #1e293b; border: 1px solid var(--glass-border); border-radius: 12px; padding: 1rem; color: #fff; font-family: 'Inter'; margin-top: 0.5rem; margin-bottom: 1rem; }

/* Animações */
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounceIn { 
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .vaga-titulo { font-size: 1.5rem; }
    .landing-card { padding: 2rem 1.5rem; }
    .quiz-card { padding: 2rem 1rem; min-height: 400px; }
    .pergunta-texto { font-size: 1.2rem; }
    .opcao-btn { padding: 0.8rem; font-size: 1rem; }
    .user-stats-card { flex-direction: column; gap: 1.5rem; }
    .podium { align-items: flex-end; gap: 0.5rem; }
    .podium-avatar { width: 40px; height: 40px; font-size: 1.2rem; }
    .podium-nome { font-size: 0.9rem; }
    .rank-stats { flex-direction: column; gap: 0.2rem; text-align: right; }
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--glass-border); flex-direction: row; flex-wrap: wrap; justify-content: center;}
    .nav-link { padding: 0.5rem; font-size: 0.9rem; }
}
