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

:root {
    --bg-primary: #0D0D0F;
    --bg-secondary: #1A1A1F;
    --bg-card: #242429;
    --accent-purple: #7C3AED;
    --accent-hover: #9D65F5;
    --accent-orange: #FF4500;
    --accent-orange-soft: #CC3700;
    --text-primary: #F4F4F5;
    --text-secondary: #A1A1AA;
    --border: #3F3F46;
    --success: #22c55e;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Space Grotesk', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Subtle grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(124, 58, 237, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 58, 237, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 580px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    margin-bottom: 2.5rem;
    text-align: left;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.logo { text-decoration: none; display: inline-flex; align-items: center; gap: 0.6rem; }
.logo .ft { color: var(--accent-purple); }
.logo .it { color: var(--text-primary); }
.logo .back-arrow { color: var(--text-secondary); font-size: 1rem; transition: color 0.2s; }
.logo:hover .back-arrow { color: var(--accent-purple); }

.header h1 {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.header h1 .highlight {
    color: var(--accent-purple);
}

.header p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

.header p strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* Progress bar */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-purple);
    border-radius: 1px;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    width: 0%;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

.progress-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Steps */
.step {
    display: none;
    animation: fadeSlideIn 0.4s ease;
}

.step.active {
    display: block;
}

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

.step-number {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-purple);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.step-question {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.step-hint {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Inputs */
.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.input-field:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.input-field::placeholder {
    color: #52525b;
}

.input-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0;
}

.input-row .input-group {
    flex: 1;
}

.input-group {
    margin-bottom: 1rem;
}

.input-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

/* Option cards */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.option-card {
    padding: 1rem 1.125rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.option-card:hover {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.05);
}

.option-card.selected {
    border-color: var(--accent-purple);
    background: rgba(124, 58, 237, 0.1);
    box-shadow: 0 0 0 1px var(--accent-purple);
}

.option-card.selected::after {
    content: '✓';
    position: absolute;
    top: 0.6rem;
    right: 0.75rem;
    color: var(--accent-purple);
    font-size: 0.875rem;
    font-weight: 700;
}

.option-card .option-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.option-card .option-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.btn {
    padding: 0.8rem 1.75rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--accent-purple);
    color: white;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 28px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* LGPD consent */
.consent-wrapper {
    margin: 1.25rem 0 0.25rem;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.consent-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: transparent;
    margin-top: 2px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.consent-label input[type="checkbox"]:checked {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px 8px;
}

.consent-label a {
    color: var(--accent-purple);
    text-decoration: none;
    transition: color 0.2s;
}

.consent-label a:hover {
    color: var(--accent-hover);
}

/* Success state */
.success-screen {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.15);
    border: 2px solid var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.5rem;
    animation: pulseIn 0.5s ease;
}

@keyframes pulseIn {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.success-screen h2 {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.success-screen p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.success-screen .whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.8rem 1.5rem;
    background: #25D366;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.success-screen .whatsapp-link:hover {
    background: #20bd5a;
    transform: translateY(-1px);
}

/* Summary */
.summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    text-align: left;
}

.summary-card h3 {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-purple);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(63, 63, 70, 0.4);
    font-size: 0.875rem;
}

.summary-item:last-child { border-bottom: none; }
.summary-item .label { color: var(--text-secondary); }
.summary-item .value { color: var(--text-primary); font-weight: 500; text-align: right; max-width: 60%; }

/* Select */
select.input-field {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A1A1AA' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

select.input-field option,
select.input-field optgroup {
    background: #1A1A1F;
    color: #F4F4F5;
}

/* Radio groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.radio-option input {
    accent-color: var(--accent-purple);
}

/* Loading screen */
.loading-screen {
    text-align: center;
    padding: 3rem 1rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    border: 3px solid var(--border);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loading-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Result step: hide progress bar when showing AI result */
.result-view .progress-container {
    display: none !important;
}

/* Parecer (AI result) card */
#stepResult.step.active {
    display: block;
}

.parecer-card {
    background: transparent;
    color: var(--text-primary);
    margin-bottom: 0;
}

.parecer-header {
    margin-bottom: 1.75rem;
}

.parecer-titulo {
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.urgencia-badge {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.urgencia-badge.urgencia-alta { color: var(--accent-orange); }
.urgencia-badge.urgencia-media { color: var(--accent-purple); }
.urgencia-badge.urgencia-baixa { color: var(--text-secondary); }

.parecer-section {
    margin-bottom: 1.75rem;
}

.parecer-section:last-of-type {
    margin-bottom: 1.25rem;
}

.parecer-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.parecer-section p {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.65;
    margin: 0;
}

.gaps-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gap-item {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    padding-left: 1rem;
    border-left: 2px solid var(--accent-purple);
    margin-left: 0;
}

.gap-problema {
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.gap-impacto {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.parecer-cta {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    margin-top: 1.25rem;
    margin-bottom: 0;
}

/* Result step: actions block (WhatsApp + back link) */
.result-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-actions .whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-purple);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.result-actions .whatsapp-link:hover {
    color: var(--accent-hover);
}

.result-actions .btn-home {
    display: inline-block;
    color: var(--accent-purple);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 0;
}

.result-actions .btn-home:hover {
    color: var(--accent-hover);
}

.parecer-error {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
}

.parecer-error p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.parecer-error p:last-child {
    margin-bottom: 0;
}

