/* ==========================================================================
   Teste de QI - Estilos Principais
   Mobile-First Design
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --bg-main: #F3F4F6;
    --bg-card: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border: #E5E7EB;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
}
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-lg {
    padding: 32px;
}
h1, h2, h3 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}
h1 {
    font-size: 2rem;
    margin-bottom: 12px;
}
h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}
h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}
p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    gap: 8px;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}
.btn-secondary {
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--border);
}
.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover {
    background: #059669;
}
.btn-block {
    width: 100%;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.form-input.error {
    border-color: var(--danger);
}
.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 4px;
}
.hero {
    text-align: center;
    padding: 40px 0;
}
.hero-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}
.hero-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}
.benefits {
    text-align: left;
    margin: 24px 0;
}
.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}
.benefit-icon {
    width: 20px;
    height: 20px;
    background: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.benefit-icon svg {
    width: 12px;
    height: 12px;
    fill: white;
}
.progress-container {
    background: var(--bg-card);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.progress-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}
.timer.warning {
    color: var(--warning);
}
.timer.danger {
    color: var(--danger);
}
.progress-bar {
    height: 8px;
    background: var(--bg-main);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
}
.question-container {
    text-align: center;
}
.question-number {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.matrix-container {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    display: inline-block;
}
.matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 300px;
    margin: 0 auto;
}
.matrix-cell {
    width: 80px;
    height: 80px;
    background: var(--bg-main);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}
.matrix-cell.empty {
    background: white;
    border: 2px dashed var(--primary);
}
.matrix-cell.empty::after {
    content: '?';
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}
.options-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-align: center;
}
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 320px;
    margin: 0 auto 24px;
}
.option-item {
    width: 90px;
    height: 90px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.option-item:hover {
    border-color: var(--primary-light);
    transform: scale(1.02);
}
.option-item.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}
.option-item.selected::after {
    content: '';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}
.option-label {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
}
.nav-buttons {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}
.nav-buttons .btn {
    flex: 1;
}
.result-preview {
    text-align: center;
    padding: 40px 20px;
}
.result-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}
.result-icon svg {
    width: 50px;
    height: 50px;
    fill: white;
}
.result-blur {
    position: relative;
    padding: 30px;
    margin: 24px 0;
}
.result-blur::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: var(--radius);
}
.result-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
}
.unlock-price {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--success);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 16px 0;
}
.pix-container {
    text-align: center;
    padding: 20px;
}
.qrcode-container {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: inline-block;
    margin-bottom: 20px;
}
.qrcode-container img {
    max-width: 200px;
    height: auto;
}
.pix-code {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 16px;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-height: 80px;
    overflow-y: auto;
}
.copy-feedback {
    color: var(--success);
    font-size: 0.875rem;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}
.copy-feedback.show {
    opacity: 1;
}
.final-result {
    text-align: center;
    padding: 40px 20px;
}
.qi-score {
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
    margin: 20px 0;
}
.qi-label {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.classification-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    margin-bottom: 24px;
}
.distribution-chart {
    margin: 30px 0;
}
.chart-bar {
    height: 40px;
    background: linear-gradient(90deg, #EF4444 0%, #F59E0B 25%, #10B981 50%, #F59E0B 75%, #EF4444 100%);
    border-radius: 20px;
    position: relative;
    margin: 20px 0;
}
.chart-marker {
    position: absolute;
    top: -10px;
    transform: translateX(-50%);
    width: 4px;
    height: 60px;
    background: var(--text-primary);
}
.chart-marker::after {
    content: attr(data-value);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    font-size: 0.875rem;
    white-space: nowrap;
}
.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}
.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover {
    color: var(--text-primary);
}
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 20px;
    margin-top: auto;
}
.footer-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}
.footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}
.footer-links a {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--primary);
}
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.875rem;
}
.alert-error {
    background: #FEE2E2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}
.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}
.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mt-4 { margin-top: 16px; }
.hidden { display: none !important; }
@media (min-width: 480px) {
    .matrix-cell {
        width: 100px;
        height: 100px;
    }
    .option-item {
        width: 100px;
        height: 100px;
    }
    .options-grid {
        max-width: 360px;
    }
}
@media (min-width: 640px) {
    h1 {
        font-size: 2.5rem;
    }
    .card-lg {
        padding: 48px;
    }
}
.shape {
    width: 60%;
    height: 60%;
}
.shape-circle {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 3;
}
.shape-square {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 3;
}
.shape-triangle {
    fill: none;
    stroke: var(--text-primary);
    stroke-width: 3;
}
.shape-filled {
    fill: var(--text-primary);
    stroke: none;
}
.shape-line {
    stroke: var(--text-primary);
    stroke-width: 3;
    stroke-linecap: round;
}
