/* ============================================
   ANAMNESE WEBAPP - Dr. Felipe Barreto
   Mobile-first, clean design
   ============================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 100px;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 40px;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.logo-text p {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 12.5%;
}

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

/* ============================================
   FORM CONTAINER
   ============================================ */

.form-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.form-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

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

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.step-description {
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.95rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--surface);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 44px;
}

/* ============================================
   CHECKBOX GROUP
   ============================================ */

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-item:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-item span {
    flex: 1;
    font-size: 0.95rem;
}

.checkbox-item.warning {
    border-left: 4px solid var(--warning);
}

.checkbox-item.danger {
    border-left: 4px solid var(--danger);
}

/* ============================================
   SLIDER
   ============================================ */

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    outline: none;
    margin: 12px 0;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ============================================
   ALERT BOX
   ============================================ */

.alert-box {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.alert-box p {
    font-size: 0.9rem;
    color: #92400e;
}

/* ============================================
   CONSENT BOX
   ============================================ */

.consent-box {
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 24px;
}

.consent-box .checkbox-item {
    background: transparent;
    border: none;
    padding: 0;
}

.consent-box span {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */

.form-navigation {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--border);
}

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* ============================================
   SUCCESS CONTAINER
   ============================================ */

.success-container {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px 24px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.success-container h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
    color: var(--success);
}

.success-container p {
    color: var(--text-light);
    margin-bottom: 8px;
}

.pdf-actions {
    margin: 24px 0;
}

.small-text {
    font-size: 0.875rem;
    margin-top: 24px;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer p {
    margin-bottom: 4px;
}

/* ============================================
   RED FLAGS STYLING
   ============================================ */

.red-flags .checkbox-item:first-child {
    background: #ecfdf5;
    border-color: var(--success);
}

.red-flags .checkbox-item.warning:has(input:checked),
.red-flags .checkbox-item.danger:has(input:checked) {
    background: #fef2f2;
    border-color: var(--danger);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .header {
        padding: 16px;
    }
    
    .form-container {
        padding: 20px 16px;
    }
    
    .step-title {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    body {
        background: white;
    }
    
    .container {
        max-width: 100%;
    }
    
    .progress-container,
    .form-navigation,
    .footer {
        display: none;
    }
}
