/* =====================================================
   MÓDULO AFILIACIÓN - COOPDORADO
   Colores corporativos: verde #2d6a2d / dorado #b8860b
   ===================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f4;
    color: #333;
    font-size: 15px;
    line-height: 1.5;
}

/* ── Header ── */
.header-afiliacion {
    background: #2d6a2d;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.header-afiliacion img { height: 52px; }
.header-afiliacion h1 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}
.header-afiliacion span {
    color: #f0d080;
    font-size: 13px;
    display: block;
}

/* ── Barra de progreso ── */
.progreso-wrapper {
    background: #fff;
    border-bottom: 1px solid #dde8dd;
    padding: 16px 24px;
}
.progreso-pasos {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 860px;
    margin: 0 auto;
    position: relative;
}
.progreso-pasos::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 5%;
    right: 5%;
    height: 3px;
    background: #dde8dd;
    z-index: 0;
}
.paso-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    z-index: 1;
    flex: 1;
}
.paso-circulo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dde8dd;
    color: #999;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #dde8dd;
    transition: all .3s;
}
.paso-item.activo .paso-circulo {
    background: #2d6a2d;
    border-color: #2d6a2d;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(45,106,45,.2);
}
.paso-item.completado .paso-circulo {
    background: #b8860b;
    border-color: #b8860b;
    color: #fff;
}
.paso-label {
    font-size: 11px;
    color: #888;
    text-align: center;
    max-width: 80px;
    line-height: 1.2;
}
.paso-item.activo .paso-label { color: #2d6a2d; font-weight: 600; }
.paso-item.completado .paso-label { color: #b8860b; }

/* ── Contenedor principal ── */
.contenedor {
    max-width: 860px;
    margin: 30px auto;
    padding: 0 16px 60px;
}

/* ── Tarjeta de sección ── */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    margin-bottom: 24px;
    overflow: hidden;
}
.card-titulo {
    background: #2d6a2d;
    color: #fff;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-titulo .icono { font-size: 18px; }
.card-cuerpo { padding: 22px; }

/* ── Grilla de campos ── */
.fila { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.fila:last-child { margin-bottom: 0; }
.campo { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 200px; }
.campo.completo { flex: 1 1 100%; }
.campo.medio { flex: 1 1 calc(50% - 8px); }
.campo.tercio { flex: 1 1 calc(33% - 11px); }
.campo.cuarto { flex: 1 1 calc(25% - 12px); }

label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
label .requerido { color: #c0392b; margin-left: 2px; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="number"], select, textarea {
    border: 1.5px solid #ccc;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color .2s;
    width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2d6a2d;
    box-shadow: 0 0 0 3px rgba(45,106,45,.1);
}
input.error, select.error { border-color: #c0392b; }
.msg-error { font-size: 12px; color: #c0392b; margin-top: 2px; }

/* ── Radios y checkboxes en línea ── */
.opciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.opcion-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
.opcion-item input[type="radio"],
.opcion-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2d6a2d;
    cursor: pointer;
}

/* ── Tabla dinámica (beneficiarios, referencias) ── */
.tabla-dinamica { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.tabla-dinamica th {
    background: #f0f5f0;
    color: #2d6a2d;
    padding: 9px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dde8dd;
}
.tabla-dinamica td {
    padding: 7px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.tabla-dinamica input, .tabla-dinamica select {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13px;
    width: 100%;
}
.btn-agregar-fila {
    background: none;
    border: 1.5px dashed #2d6a2d;
    color: #2d6a2d;
    padding: 7px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    margin-top: 10px;
    transition: all .2s;
}
.btn-agregar-fila:hover { background: #f0f5f0; }
.btn-eliminar-fila {
    background: none;
    border: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
}

/* ── Botones de navegación ── */
.navegacion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.btn-anterior {
    background: #fff;
    border: 2px solid #2d6a2d;
    color: #2d6a2d;
    padding: 11px 28px;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}
.btn-anterior:hover { background: #f0f5f0; }
.btn-siguiente {
    background: #2d6a2d;
    border: 2px solid #2d6a2d;
    color: #fff;
    padding: 11px 32px;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.btn-siguiente:hover { background: #245524; }
.btn-siguiente:disabled { background: #aaa; border-color: #aaa; cursor: not-allowed; }

/* ── Alertas ── */
.alerta {
    padding: 12px 16px;
    border-radius: 7px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alerta-error { background: #fdecea; border-left: 4px solid #c0392b; color: #7b241c; }
.alerta-info  { background: #eaf4ea; border-left: 4px solid #2d6a2d; color: #1a4a1a; }
.alerta-aviso { background: #fef9e7; border-left: 4px solid #b8860b; color: #7d6608; }

/* ── Footer ── */
.footer-afiliacion {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    margin-top: 40px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .campo.medio, .campo.tercio, .campo.cuarto { flex: 1 1 100%; }
    .paso-label { display: none; }
    .header-afiliacion h1 { font-size: 15px; }
    .contenedor { padding: 0 10px 40px; }
}