    /* ════════════════════════════════════════════════
       DESIGN TOKENS (Clean Modern Medical-Executive)
    ════════════════════════════════════════════════ */
    :root {
        --slate-900:   #0f172a;
        --slate-800:   #1e293b;
        --slate-700:   #334155;
        --slate-600:   #475569;
        --slate-500:   #64748b;
        --slate-400:   #94a3b8;
        --slate-200:   #e2e8f0;
        --slate-100:   #f1f5f9;
        --slate-50:    #f8fafc;
        
        --brand-blue:  #0284c7;
        --brand-hover: #0369a1;
        --brand-pale:  #f0f9ff;
        --brand-border:#bae6fd;

        --green-success: #16a34a;
        --green-bg:      #f0fdf4;
        --red-error:     #dc2626;
        --red-bg:        #fef2f2;
        --orange-warn:   #d97706;
        --orange-bg:     #fffbebf;

        --radius-sm:   8px;
        --radius-md:   14px;
        --radius-lg:   20px;

        --shadow-sm:   0 1px 3px rgba(0,0,0,0.05);
        --shadow-md:   0 4px 16px -2px rgba(0,0,0,0.06);
        --shadow-lg:   0 20px 40px -8px rgba(0,0,0,0.08);
        --transition:  0.2s ease;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    body {
        font-family: 'Inter', system-ui, -apple-system, sans-serif;
        background-color: var(--slate-50);
        color: var(--slate-700);
        min-height: 100vh;
        padding: 32px 16px 64px;
        line-height: 1.5;
    }

    /* ════════════════════════════════════════════════
       HEADER
    ════════════════════════════════════════════════ */
    .page-header {
        max-width: 900px;
        margin: 0 auto 32px;
        text-align: center;
    }
    .page-header .brand-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: #ffffff;
        border: 1px solid var(--slate-200);
        border-radius: 50px;
        padding: 6px 18px;
        font-size: 13px;
        font-weight: 600;
        color: var(--brand-blue);
        margin-bottom: 14px;
        box-shadow: var(--shadow-sm);
    }
    .page-header h1 {
        font-size: clamp(24px, 4vw, 34px);
        font-weight: 700;
        color: var(--slate-900);
        letter-spacing: -0.02em;
        margin-bottom: 8px;
    }
    .page-header p {
        font-size: 15px;
        color: var(--slate-500);
        max-width: 540px;
        margin: 0 auto;
    }

    /* ════════════════════════════════════════════════
       GATEWAY / LOGIN MODAL POR CÉDULA
    ════════════════════════════════════════════════ */
    .gate-card {
        max-width: 480px;
        margin: 0 auto 40px;
        background: #ffffff;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--slate-200);
        padding: 36px 32px;
        text-align: center;
        animation: fadeIn 0.4s ease;
    }
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(12px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .gate-icon {
        width: 60px; height: 60px;
        background: var(--brand-pale);
        border: 1px solid var(--brand-border);
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        margin: 0 auto 16px;
        font-size: 26px;
        color: var(--brand-blue);
    }
    .gate-title {
        font-size: 20px;
        font-weight: 700;
        color: var(--slate-900);
        margin-bottom: 6px;
    }
    .gate-subtitle {
        font-size: 13.5px;
        color: var(--slate-500);
        margin-bottom: 24px;
    }
    .gate-form {
        display: flex;
        flex-direction: column;
        gap: 16px;
        text-align: left;
    }
    .gate-field label {
        font-size: 12.5px;
        font-weight: 600;
        color: var(--slate-700);
        display: block;
        margin-bottom: 6px;
    }
    .gate-field input {
        width: 100%;
        height: 46px;
        border: 1.5px solid var(--slate-200);
        border-radius: var(--radius-sm);
        padding: 0 14px;
        font-size: 15px;
        font-family: inherit;
        color: var(--slate-900);
        outline: none;
        transition: border-color var(--transition), box-shadow var(--transition);
    }
    .gate-field input:focus {
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
    }
    .btn-gate {
        height: 46px;
        background: var(--brand-blue);
        color: #ffffff;
        border: none;
        border-radius: var(--radius-sm);
        font-size: 14.5px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: background var(--transition), transform var(--transition);
        display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .btn-gate:hover {
        background: var(--brand-hover);
    }
    .gate-alert {
        padding: 12px 14px;
        border-radius: var(--radius-sm);
        font-size: 13px;
        line-height: 1.4;
        display: none;
        text-align: left;
    }
    .gate-alert.err {
        background: var(--red-bg);
        border: 1px solid #fecaca;
        color: var(--red-error);
        display: block;
    }
    .gate-alert.warn {
        background: #fffbebf;
        border: 1px solid #fef3c7;
        color: #b45309;
        display: block;
    }
    .gate-alert.load {
        background: var(--brand-pale);
        border: 1px solid var(--brand-border);
        color: var(--brand-blue);
        display: block;
    }

    /* ════════════════════════════════════════════════
       MAIN FORM CONTAINER (Oculto al inicio)
    ════════════════════════════════════════════════ */
    .form-card {
        max-width: 900px;
        margin: 0 auto;
        background: #ffffff;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--slate-200);
        overflow: hidden;
        display: none; /* Se muestra tras ingresar la cédula */
    }
    .form-card.active {
        display: block;
        animation: fadeIn 0.4s ease;
    }

    /* Progress bar */
    .progress-bar-wrap {
        height: 4px;
        background: var(--slate-100);
    }
    .progress-bar-fill {
        height: 100%;
        width: 0%;
        background: var(--brand-blue);
        transition: width 0.3s ease;
    }

    .form-body { padding: 36px 40px; }
    @media (max-width: 640px) { .form-body { padding: 24px 20px; } }

    /* Student Badge Info Banner */
    .student-welcome-badge {
        background: var(--brand-pale);
        border: 1px solid var(--brand-border);
        border-radius: var(--radius-md);
        padding: 14px 18px;
        margin-bottom: 28px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .student-welcome-badge .info {
        font-size: 13.5px;
        color: var(--slate-800);
    }
    .student-welcome-badge .info strong { color: var(--slate-900); }
    .student-welcome-badge .tag {
        background: #ffffff;
        color: var(--brand-blue);
        border: 1px solid var(--brand-border);
        border-radius: 20px;
        padding: 3px 10px;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
    }

    /* ════════════════════════════════════════════════
       SECTIONS & CONTROLS
    ════════════════════════════════════════════════ */
    .section {
        margin-bottom: 32px;
        border-radius: var(--radius-md);
        border: 1px solid var(--slate-200);
        overflow: hidden;
        background: #ffffff;
    }
    .section-head {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 20px;
        background: var(--slate-100);
        border-bottom: 1px solid var(--slate-200);
        color: var(--slate-900);
        font-size: 14px;
        font-weight: 600;
    }
    .section-head .step-num {
        width: 24px; height: 24px;
        background: var(--brand-blue);
        color: #ffffff;
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-size: 12px; font-weight: 700; flex-shrink: 0;
    }
    .section-body { padding: 24px 20px; }

    .field-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px 20px;
    }
    .field-grid .col-full { grid-column: 1 / -1; }
    .field-grid .col-2    { grid-column: span 2; }

    @media (max-width: 600px) { .field-grid .col-2 { grid-column: 1 / -1; } }

    .field { display: flex; flex-direction: column; gap: 5px; }
    .field label {
        font-size: 12px;
        font-weight: 600;
        color: var(--slate-600);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    .field label .req { color: var(--red-error); margin-left: 2px; }

    .field input[type="text"],
    .field input[type="email"],
    .field input[type="tel"],
    .field input[type="date"],
    .field select {
        height: 42px;
        border: 1px solid var(--slate-200);
        border-radius: var(--radius-sm);
        padding: 0 12px;
        font-size: 14px;
        font-family: inherit;
        color: var(--slate-900);
        background: #ffffff;
        transition: border-color var(--transition), box-shadow var(--transition);
        outline: none;
        width: 100%;
    }
    .field input:focus,
    .field select:focus {
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
    }
    .field input.is-valid {
        border-color: #93c5fd;
    }
    .field input.is-invalid {
        border-color: var(--red-error);
        background: var(--red-bg);
    }

    /* ════════════════════════════════════════════════
       VACUNAS — MINIMALIST CLEAN CARDS & TIMELINES
    ════════════════════════════════════════════════ */
    .vac-block {
        background: #ffffff;
        border: 1px solid var(--slate-200);
        border-radius: 16px;
        padding: 24px;
        margin-bottom: 20px;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
        transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        overflow: hidden;
    }
    .vac-block:hover {
        border-color: var(--slate-300);
        box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.06);
        transform: translateY(-2px);
    }
    .vac-block:last-child { margin-bottom: 0; }
    .vac-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 6px;
    }
    .vac-block h6 {
        font-size: 16px;
        font-weight: 700;
        color: var(--slate-900);
        margin: 0;
        letter-spacing: -0.01em;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .vac-block .vac-badge {
        display: inline-flex;
        align-items: center;
        background: var(--slate-100);
        color: var(--slate-600);
        font-size: 11px;
        font-weight: 600;
        padding: 4px 12px;
        border-radius: 50px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .vac-block .vac-badge-green {
        background: #ecfdf5;
        color: #047857;
        border: 1px solid #a7f3d0;
    }
    .vac-block .vac-badge-blue {
        background: #f0f9ff;
        color: #0284c7;
        border: 1px solid #bae6fd;
    }
    .vac-block .vac-rule {
        font-size: 13px;
        color: var(--slate-500);
        margin-bottom: 18px;
        line-height: 1.4;
        font-weight: 400;
    }
    .vac-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px 20px;
        background: var(--slate-50);
        padding: 18px;
        border-radius: 12px;
        border: 1px solid var(--slate-100);
    }
    .vac-grid .field { margin-bottom: 0; }
    .vac-grid .field label {
        font-size: 11.5px;
        font-weight: 600;
        color: var(--slate-600);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        margin-bottom: 6px;
    }
    .vac-grid .field input[type="date"] {
        background: #ffffff;
        border: 1px solid var(--slate-200);
        border-radius: 8px;
        height: 42px;
        padding: 0 12px;
        font-size: 13.5px;
        color: var(--slate-800);
        transition: all 0.2s;
        box-shadow: 0 1px 2px rgba(0,0,0,0.02);
        width: 100%;
    }
    .vac-grid .field input[type="date"]:focus {
        border-color: var(--brand-blue);
        box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
        outline: none;
    }

    .check-row {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 16px;
        background: #ffffff;
        border: 1.5px dashed #cbd5e1;
        border-radius: 50px;
        padding: 8px 16px;
        cursor: pointer;
        transition: all 0.2s;
        user-select: none;
    }
    .check-row:hover {
        border-color: var(--brand-blue);
        background: var(--brand-pale);
    }
    .check-row:has(input:checked) {
        background: #ecfdf5;
        border: 1.5px solid #10b981;
        color: #065f46;
    }
    .check-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: #10b981; cursor: pointer; }
    .check-row label { font-size: 13px; color: inherit; cursor: pointer; font-weight: 600; margin: 0; text-transform: none; }

    .influenza-tip {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #fffbeb;
        border: 1px solid #fef3c7;
        color: #92400e;
        padding: 12px 16px;
        border-radius: 10px;
        font-size: 12.5px;
        line-height: 1.4;
        font-weight: 500;
    }

    .date-error {
        font-size: 11.5px;
        color: var(--red-error);
        margin-top: 4px;
        display: none;
        font-weight: 600;
    }
    .date-error.visible { display: block; }

    /* ════════════════════════════════════════════════
       FILE INPUTS
    ════════════════════════════════════════════════ */
    .file-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 14px;
    }
    .file-field { display: flex; flex-direction: column; gap: 5px; }
    .file-field label {
        font-size: 12px;
        font-weight: 600;
        color: var(--slate-600);
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    .file-field label .req { color: var(--red-error); }
    .file-wrapper {
        position: relative;
        border: 1.5px dashed var(--slate-200);
        border-radius: var(--radius-sm);
        background: var(--slate-50);
        padding: 14px;
        transition: border-color var(--transition), background var(--transition);
        cursor: pointer;
        text-align: center;
    }
    .file-wrapper:hover { border-color: var(--brand-blue); background: var(--brand-pale); }
    .file-wrapper.has-file { border-color: #86efac; background: var(--green-bg); }
    .file-wrapper input[type="file"] {
        position: absolute; inset: 0; width: 100%; height: 100%;
        opacity: 0; cursor: pointer;
    }
    .file-wrapper .file-icon { font-size: 20px; margin-bottom: 4px; color: var(--slate-400); }
    .file-wrapper .file-text { font-size: 11.5px; color: var(--slate-500); }
    .file-wrapper .file-name { font-size: 11.5px; color: var(--green-success); font-weight: 600; display: none; }
    .file-wrapper.has-file .file-text { display: none; }
    .file-wrapper.has-file .file-name { display: block; }

    .foto-preview {
        width: 80px; height: 100px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid var(--slate-200);
        margin: 8px auto 4px;
        display: none;
    }

    /* ════════════════════════════════════════════════
       SUBMIT & SUMMARY
    ════════════════════════════════════════════════ */
    .btn-submit {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 15px;
        border: none;
        border-radius: var(--radius-sm);
        background: var(--brand-blue);
        color: #ffffff;
        font-size: 15px;
        font-weight: 600;
        font-family: inherit;
        cursor: pointer;
        transition: background var(--transition), transform var(--transition);
        margin-top: 12px;
    }
    .btn-submit:hover:not(:disabled) {
        background: var(--brand-hover);
    }
    .btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

    #error-summary {
        background: var(--red-bg);
        border: 1px solid #fecaca;
        border-radius: var(--radius-sm);
        padding: 14px 18px;
        margin-bottom: 24px;
        display: none;
    }
    #error-summary h4 { color: var(--red-error); font-size: 13.5px; margin-bottom: 6px; }
    #error-summary ul { color: #991b1b; font-size: 12.5px; padding-left: 18px; }

    .overlay {
        position: fixed; inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        display: flex; flex-direction: column;
        align-items: center; justify-content: center;
        gap: 16px; z-index: 9999;
        display: none;
        color: #ffffff;
    }
    .overlay.active { display: flex; }
    .spinner {
        width: 40px; height: 40px;
        border: 3px solid rgba(255,255,255,0.3);
        border-top-color: #ffffff;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
