:root {
    /* Color Palette */
    --primary: #6366f1; /* Indigo/Purple */
    --primary-hover: #4f46e5;
    --secondary: #a855f7; /* Purple/Lilac */
    --accent: #3b82f6; /* Blue */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    
    /* Layout */
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    /* Typography */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: radial-gradient(at 0% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.logo-container {
    text-align: center;
}

/* HTML Logo Custom Styling */
.html-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    margin-bottom: 10px;
    user-select: none;
}
.html-logo-name {
    font-family: 'Great Vibes', cursive;
    font-size: 3.5rem;
    color: #1e3a8a; /* Azul mais escuro */
    margin-bottom: 5px;
    font-weight: 400;
}
.html-logo-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.4em;
    color: #eab308; /* Dourado */
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}
.html-logo-desc::before, .html-logo-desc::after {
    content: '';
    height: 1px;
    width: 40px;
    background-color: #eab308;
}

.progress-container {
    width: 100%;
    max-width: 500px;
}

.progress-bar-bg {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: right;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.block {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.block.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.intro-card {
    text-align: center;
}

.intro-card h1 {
    margin-bottom: 10px;
    color: var(--primary);
}

.intro-card p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-field label {
    font-weight: 500;
    font-size: 0.95rem;
}

.input-field input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Questions */
.question-item {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.question-item:hover {
    box-shadow: var(--shadow-md);
}

.question-text {
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 15px;
    white-space: pre-line;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.option-label:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.option-input {
    margin-right: 12px;
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.option-label:has(input:checked) {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.05);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Test Navigation */
.test-nav {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    padding-bottom: 40px;
}

/* Success Card */
.success-card {
    text-align: center;
    padding: 50px 30px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon svg {
    width: 40px;
    height: 40px;
}

.success-card h1 {
    color: var(--text-main);
    margin-bottom: 10px;
}

.success-card p {
    color: var(--text-muted);
}

/* --- ADMIN DASHBOARD --- */
.admin-container {
    max-width: 1000px;
}

.admin-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.admin-header h2 {
    color: var(--primary);
}

.login-card {
    max-width: 400px;
    margin: 40px auto;
}

.error-msg {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: -10px;
}

.hidden {
    display: none !important;
}

/* Admin Dashboard Table */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-responsive {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.results-table th, 
.results-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.results-table tr:last-child td {
    border-bottom: none;
}

.results-table tbody tr:hover {
    background-color: #f1f5f9;
}

.level-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
}

.block-stat {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

/* Responsive */
@media (max-width: 640px) {
    .admin-header {
        flex-direction: column;
    }
    .card {
        padding: 20px;
    }
}
