/* Preinscripcion Medicos - CMC Cipolletti */

#preinsc-app {
    max-width: 820px;
    margin: 0 auto;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #2c3e50;
}

/* ── Barra de pasos ── */
.preinsc-steps-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
    gap: 0;
}

.preinsc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.preinsc-step .step-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #d5d8dc;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s;
}

.preinsc-step span {
    font-size: 12px;
    color: #999;
    text-align: center;
    transition: color 0.3s;
}

.preinsc-step.active .step-circle {
    background: #1a5276;
    color: white;
    box-shadow: 0 0 0 4px rgba(26,82,118,0.15);
}

.preinsc-step.active span {
    color: #1a5276;
    font-weight: 600;
}

.preinsc-step.completado .step-circle {
    background: #1e8449;
    color: white;
}

.preinsc-step.completado span {
    color: #1e8449;
}

.preinsc-step-line {
    flex: 1;
    height: 3px;
    background: #d5d8dc;
    max-width: 100px;
    margin-bottom: 18px;
    transition: background 0.3s;
}

.preinsc-step-line.completada {
    background: #1e8449;
}

/* ── Secciones del formulario ── */
.preinsc-seccion-titulo {
    font-size: 18px;
    font-weight: 700;
    color: #1a5276;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eaf0fb;
}

.preinsc-fila {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.preinsc-campo,
.preinsc-campo-full {
    margin-bottom: 16px;
}

.preinsc-campo-full {
    width: 100%;
}

.preinsc-campo label,
.preinsc-campo-full label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.req {
    color: #c0392b;
}

.preinsc-campo input,
.preinsc-campo-full input[type="text"],
.preinsc-campo-full input[type="email"],
.preinsc-campo-full input[type="tel"],
.preinsc-campo-full input[type="number"],
.preinsc-campo-full input[type="date"],
#preinsc-form input[type="text"],
#preinsc-form input[type="email"],
#preinsc-form input[type="tel"],
#preinsc-form input[type="number"],
#preinsc-form input[type="date"],
#p_otra_especialidad {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #ccd6e0;
    border-radius: 6px;
    font-size: 14px;
    color: #2c3e50;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

#preinsc-form input:focus,
#p_otra_especialidad:focus {
    outline: none;
    border-color: #1a5276;
    box-shadow: 0 0 0 3px rgba(26,82,118,0.1);
}

#preinsc-form input.error {
    border-color: #c0392b;
}

/* ── Especialidades ── */
.preinsc-especialidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1.5px solid #ccd6e0;
    border-radius: 6px;
    background: #fafcff;
    max-height: 250px;
    overflow-y: auto;
}

.preinsc-check-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    font-weight: 400 !important;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
}

.preinsc-check-label:hover {
    background: #eaf0fb;
}

.preinsc-check-label input[type="checkbox"] {
    margin-top: 1px;
    width: auto !important;
    flex-shrink: 0;
}

/* ── Radio buttons ── */
.preinsc-radio-grupo {
    display: flex;
    gap: 20px;
}

.preinsc-radio-grupo label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 400 !important;
    font-size: 14px;
}

/* ── Areas de archivo ── */
.preinsc-file-area {
    border: 2px dashed #afc6e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: #f8fbff;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.preinsc-file-area:hover,
.preinsc-file-area.drag-over {
    border-color: #1a5276;
    background: #eaf0fb;
}

.preinsc-file-area.tiene-archivo {
    border-color: #1e8449;
    background: #eafaf1;
}

.preinsc-file-area.opcional {
    border-style: dashed;
    opacity: 0.85;
}

.preinsc-file-area .file-icon {
    font-size: 28px;
}

.preinsc-file-area p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.preinsc-file-area .file-link {
    color: #1a5276;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

.preinsc-file-area .file-nombre {
    font-size: 12px;
    color: #1e8449;
    font-weight: 600;
    word-break: break-all;
}

.preinsc-file-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* ── Declaracion ── */
.preinsc-declaracion {
    margin-top: 20px;
    padding: 14px;
    background: #fef9e7;
    border: 1px solid #f0d060;
    border-radius: 6px;
}

.preinsc-declaracion .preinsc-check-label {
    font-size: 13px;
    line-height: 1.5;
}

/* ── Ayuda ── */
.preinsc-ayuda {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: #eaf0fb;
    border-radius: 4px;
}

/* ── Navegacion ── */
.preinsc-nav {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.preinsc-btn-pri {
    padding: 11px 28px;
    background: #1a5276;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.preinsc-btn-pri:hover:not(:disabled) {
    background: #154360;
}

.preinsc-btn-pri:active {
    transform: scale(0.98);
}

.preinsc-btn-pri:disabled {
    background: #85929e;
    cursor: not-allowed;
}

.preinsc-btn-sec {
    padding: 11px 24px;
    background: white;
    color: #1a5276;
    border: 2px solid #1a5276;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.preinsc-btn-sec:hover {
    background: #eaf0fb;
}

/* ── Alertas ── */
.preinsc-alerta {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.preinsc-alerta-error {
    background: #fdedec;
    border-left: 4px solid #c0392b;
    color: #922b21;
}

.preinsc-alerta-ok {
    background: #eafaf1;
    border-left: 4px solid #1e8449;
    color: #1e8449;
}

/* ── Pantalla de exito ── */
#preinsc-success {
    text-align: center;
    padding: 40px 20px;
}

.preinsc-success-card {
    display: inline-block;
    background: white;
    border-radius: 12px;
    padding: 48px 56px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-width: 480px;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #1e8449;
    color: white;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.preinsc-success-card h2 {
    color: #1a5276;
    margin-bottom: 12px;
}

.preinsc-success-card p {
    color: #555;
    line-height: 1.6;
}

/* ── Overlay de progreso ── */
.progreso-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.progreso-card {
    background: white;
    border-radius: 12px;
    padding: 36px 48px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.progreso-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #eee;
    border-top-color: #1a5276;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 16px;
}

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

/* ── Responsive ── */
@media (max-width: 600px) {
    .preinsc-fila {
        grid-template-columns: 1fr;
    }
    .preinsc-steps-bar {
        gap: 4px;
    }
    .preinsc-step span {
        font-size: 10px;
    }
    .preinsc-step-line {
        max-width: 30px;
    }
    .preinsc-success-card {
        padding: 28px 20px;
    }
    .preinsc-especialidades-grid {
        grid-template-columns: 1fr;
    }
}
