/* --- Global Variables & Resets --- */
:root {
    --navy: #0B2A4A;
    --emerald: #0FA37F;
    --emerald-dark: #098567;
    --bg-light: #F7F9FB;
    --white: #FFFFFF;
    --text-dark: #1E1E1E;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 10px 30px rgba(11, 42, 74, 0.05);
}

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

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Inter', sans-serif;
    color: var(--navy);
}

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

/* --- Form Header --- */
.form-header {
    background: var(--white);
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--navy);
}

.logo span { color: var(--emerald); }

.flag-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-image: url('https://flagcdn.com/br.svg');
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.secure-badge {
    font-size: 0.85rem;
    color: var(--emerald);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Form Container & Progress --- */
.form-container {
    max-width: 680px;
    margin: 40px auto;
    padding: 0 20px 60px;
}

.progress-wrapper {
    margin-bottom: 32px;
}

.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--emerald);
    width: 12.5%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* --- Form Card & Inputs --- */
.form-card {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid #edf2f7;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.form-step h3 {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background-color: var(--white);
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(15, 163, 127, 0.1);
}

input.error {
    border-color: #ef4444;
    background-color: #fffafb;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* --- Modern Buttons --- */
.form-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--emerald);
    color: var(--white);
    box-shadow: 0 4px 6px rgba(15, 163, 127, 0.15);
}

.btn-primary:hover {
    background-color: var(--emerald-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(15, 163, 127, 0.2);
}

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

.btn-secondary:hover {
    background-color: #f8fafc;
    color: var(--navy);
}

/* --- Specific Components --- */
.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    font-size: 0.95rem;
}

.radio-label:hover, .checkbox-label:hover {
    background-color: #f8fafc;
}

.bg-question {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.auto-save-tag {
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 15px;
}

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

/* --- Mobile Responsiveness --- */
@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .form-card { padding: 24px 20px; border-radius: 0; border: none; }
    .form-container { padding: 0; margin: 20px auto; }
    .radio-group { flex-direction: column; }
    .form-nav { padding: 16px 20px; }
}