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

/* Optimize paint and layout */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Modern dark gradient background */
    background: radial-gradient(1200px 800px at 20% 10%, rgba(99,102,241,0.25), transparent 60%),
                radial-gradient(1000px 700px at 80% 10%, rgba(168,85,247,0.25), transparent 60%),
                linear-gradient(180deg, #0b0f19 0%, #0a0e17 40%, #090d15 100%);
    min-height: 100vh;
    color: #e6e6e6;
    /* Optimize for performance */
    will-change: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize animations */
.btn-primary, .btn-secondary, .btn-success {
    /* Use transform instead of margin for better performance */
    will-change: transform;
    transform: translateZ(0);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: #f9fafb;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.6rem;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
    text-shadow: 0 8px 30px rgba(99,102,241,0.25);
}

header p {
    font-size: 1.05rem;
    opacity: 0.85;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.card {
    background: linear-gradient(180deg, rgba(17,24,39,0.85), rgba(12,17,28,0.85));
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
    backdrop-filter: blur(8px);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #cbd5e1;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(2,6,23,0.6);
    color: #e2e8f0;
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(99,102,241,0.7);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}

.btn-primary, .btn-secondary, .btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.3s ease;
    margin: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    color: #fff;
    box-shadow: 0 10px 25px rgba(99,102,241,0.35);
}

.btn-primary:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 12px 30px rgba(139,92,246,0.45);
}

.btn-secondary {
    background: linear-gradient(135deg, #334155 0%, #1f2937 100%);
    color: #e5e7eb;
    border: 1px solid rgba(148,163,184,0.25);
}

.btn-secondary:hover {
    filter: brightness(1.1);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #22c55e 100%);
    color: #052e1a;
}

.btn-success:hover {
    filter: brightness(1.05);
}

.btn-primary:disabled, .btn-secondary:disabled {
    background: #374151;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.progress-bar {
    background: linear-gradient(180deg, rgba(2,6,23,0.6), rgba(2,6,23,0.4));
    border: 1px solid rgba(148,163,184,0.14);
    border-radius: 14px;
    padding: 8px;
    margin-bottom: 22px;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.progress-fill {
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
    height: 14px;
    border-radius: 10px;
    transition: width 0.45s ease;
    width: 7.7%;
    box-shadow: 0 6px 20px rgba(236,72,153,0.25);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    color: #e2e8f0;
    font-size: 13px;
}

.question-card {
    background: linear-gradient(180deg, rgba(17,24,39,0.9), rgba(10,15,26,0.9));
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
    margin-bottom: 22px;
}

.question-header {
    border-bottom: 1px solid rgba(148,163,184,0.15);
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.question-number {
    color: #a78bfa;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.question-title {
    font-size: 1.35rem;
    margin: 10px 0;
    color: #f3f4f6;
}

.question-section {
    background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(168,85,247,0.15));
    padding: 6px 12px;
    border-radius: 999px;
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #c4b5fd;
    margin-bottom: 14px;
}

.scoring-options {
    display: grid;
    gap: 14px;
    margin: 18px 0 8px 0;
}

.score-option {
    border: 1px solid rgba(148,163,184,0.16);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.3s ease;
    background: linear-gradient(180deg, rgba(15,23,42,0.9), rgba(10,15,26,0.9));
}

.score-option:hover {
    border-color: rgba(99,102,241,0.6);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.45);
}

.score-option.selected {
    border-color: rgba(99,102,241,0.9);
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.2), rgba(236,72,153,0.2));
    color: #f9fafb;
    box-shadow: 0 16px 40px rgba(99,102,241,0.35);
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.score-points {
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(139,92,246,0.25));
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #e5e7eb;
    border: 1px solid rgba(148,163,184,0.18);
}

.score-option.selected .score-points {
    background: linear-gradient(135deg, rgba(99,102,241,0.35), rgba(139,92,246,0.35));
}

.clarifying-questions {
    background: linear-gradient(180deg, rgba(250,204,21,0.07), rgba(250,204,21,0.05));
    border: 1px solid rgba(250,204,21,0.25);
    border-radius: 10px;
    padding: 14px;
    margin: 14px 0;
}

.clarifying-questions h4 {
    color: #facc15;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.clarifying-questions ul {
    margin-left: 18px;
}

.clarifying-questions li {
    color: #eab308;
    margin-bottom: 5px;
    font-size: 13px;
}

.navigation {
    text-align: center;
    margin-top: 26px;
}

.results-header {
    text-align: center;
    color: #e5e7eb;
    margin-bottom: 26px;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.score-card {
    background: linear-gradient(180deg, rgba(17,24,39,0.9), rgba(10,15,26,0.9));
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 16px;
    padding: 26px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
}

.score-display {
    font-size: 3.1rem;
    font-weight: 800;
    margin: 18px 0;
    background: linear-gradient(135deg, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.score-max {
    font-size: 1.25rem;
    color: #9ca3af;
}

.level-badge {
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 16px;
    margin-top: 12px;
    border: 1px solid rgba(148,163,184,0.18);
}

.level-junior {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #111827;
}

.level-pleno {
    background: linear-gradient(135deg, #06b6d4, #22d3ee);
    color: #031b1f;
}

.level-senior {
    background: linear-gradient(135deg, #22c55e, #10b981);
    color: #052e1a;
}

.level-insuficiente {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #2b0b08;
}

.chart-container {
    background: linear-gradient(180deg, rgba(17,24,39,0.9), rgba(10,15,26,0.9));
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
    height: 420px;
}

.detailed-results {
    background: linear-gradient(180deg, rgba(17,24,39,0.9), rgba(10,15,26,0.9));
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 10px 30px rgba(2,6,23,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
    margin-bottom: 20px;
}

.section-result {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(148,163,184,0.14);
}

.section-result:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 10px;
}

.section-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-points {
    font-size: 1.05rem;
    font-weight: 800;
    color: #c4b5fd;
}

.question-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.question-item {
    background: rgba(2,6,23,0.55);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.14);
    font-size: 13px;
    color: #cbd5e1;
}

.question-item strong {
    color: #a78bfa;
}

.export-section {
    text-align: center;
}

.app-footer {
    margin-top: 24px;
    padding: 18px 0 8px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    border-top: 1px solid rgba(148,163,184,0.14);
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .question-summary {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2.1rem;
    }
    
    .container {
        padding: 10px;
    }
}

@media print {
    body {
        background: white;
    }
    
    .export-section {
        display: none;
    }
}