 * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #2980b9 100%);
    padding: 20px;
}

.contenedor {
    width: 100%;
    max-width: 440px;
}

.contenedor-amplio {
    max-width: 960px;
}

.caja-formulario {
    width: 100%;
    min-width: 0;
    background: #ffffff;
    padding: 40px 35px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: entradaSuave 0.6s ease-out;
}

@keyframes entradaSuave {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-contenedor {
    margin-bottom: 22px;
}

.logo {
    max-width: 140px;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}

.nombre-usuario {
    margin-bottom: 6px;
    color: #2980b9;
    font-size: 18px;
    font-weight: 700;
}

h2 {
    color: #1e3a5f;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.subtitulo {
    color: #718096;
    font-size: 15px;
    margin-bottom: 30px;
}

h3 {
    margin: 28px 0 16px;
    padding-bottom: 8px;
    color: #1e3a5f;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
    font-size: 19px;
}

h3 span {
    color: #718096;
    font-size: 13px;
    font-weight: 400;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    width: 100%;
    min-width: 0;
}

select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
    outline: none;
}

select:focus,
textarea:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 4px rgba(41, 128, 185, 0.15);
}

textarea {
    resize: vertical;
}

.grupo-foto small {
    display: block;
    margin-top: 7px;
    color: #718096;
    font-size: 12px;
}

.selector-foto {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    padding: 9px 13px;
    border: 2px dashed #a9c5d8;
    border-radius: 10px;
    color: #173b5f !important;
    background: #f5faff;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.selector-foto:hover {
    border-color: #2980b9;
    background: #edf7fd;
}

.icono-subir {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: #2980b9;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.texto-foto {
    overflow: hidden;
    color: #173b5f;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selector-foto input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.boton-camara {
    width: 100%;
    margin-top: 8px;
    border: 1px solid #2980b9;
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    background: #2980b9;
    cursor: pointer;
    font-size: 14px;
}

.camara {
    margin-top: 10px;
}

.camara video {
    display: block;
    width: 100%;
    max-height: 260px;
    border-radius: 8px;
    background: #111;
    object-fit: cover;
}

.acciones-camara {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.acciones-camara .boton-secundario {
    margin-bottom: 0;
}

.estado-camara {
    margin: 8px 0 0;
    color: #c0392b;
    font-size: 13px;
}

.bloque-repetible {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid #d8e2ec;
    border-radius: 12px;
    background: #f8fbfd;
}

.bloque-repetible .grupo-input {
    margin-bottom: 8px;
}


.boton-secundario,
.quitar-adherente {
    border: 1px solid #2980b9;
    border-radius: 10px;
    padding: 10px 14px;
    color: #1e3a5f;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

.quitar-adherente {
    border-color: #c0392b;
    color: #c0392b;
}

.boton-secundario {
    display: block;
    margin-bottom: 12px;
}

.mensaje {
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 22px;
    font-size: 14px;
    line-height: 1.5;
}

.exito {
    background: #eafaf1;
    color: #229954;
    border-left: 5px solid #229954;
}

.advertencia {
    background: #fef9e7;
    color: #d68910;
    border-left: 5px solid #d68910;
}

.error {
    background: #fdecea;
    color: #c0392b;
    border-left: 5px solid #c0392b;
}

.grupo-input {
    text-align: left;
    margin-bottom: 22px;
}

.grupo-input label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 600;
    font-size: 14px;
}

.grupo-input input {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.grupo-input input:focus {
    border-color: #2980b9;
    box-shadow: 0 0 0 4px rgba(41, 128, 185, 0.15);
}

.campo-con-icono {
    position: relative;
}

.campo-con-icono input {
    width: 100%;
    padding-right: 48px;
}

.icono-ver {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.icono-ver:hover {
    transform: translateY(-50%) scale(1.15);
}

.boton-registrar {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2980b9 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(41, 128, 185, 0.35);
}

.boton-registrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(41, 128, 185, 0.45);
}

.boton-registrar:active {
    transform: translateY(0);
}

.enlaces {
    margin-top: 25px;
}

.enlace-olvido {
    color: #2980b9;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.enlace-olvido:hover {
    color: #1e3a5f;
    text-decoration: underline;
}

.pagina-registro .caja-formulario {
    max-width: 400px;
    margin: 0 auto;
    padding: 28px 30px 24px;
}

.pagina-registro .logo-contenedor {
    margin-bottom: 9px;
}

.pagina-registro .logo {
    max-width: 100px;
    max-height: 80px;
}

.pagina-registro h2 {
    margin-bottom: 6px;
    font-size: 24px;
}

.pagina-registro .subtitulo {
    margin-bottom: 24px;
}

.pagina-registro .grupo-input {
    margin-bottom: 14px;
}

.pagina-registro .grupo-input input {
    padding: 12px 14px;
}

.pagina-registro .boton-registrar {
    margin-top: 3px;
    padding: 13px;
}

.pagina-registro .enlaces {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 15px;
}

.pagina-registro .enlace-olvido {
    font-size: 13px;
}

.pagina-socios {
    align-items: flex-start;
    padding: 32px 20px;
}

.pagina-socios .caja-formulario {
    padding: 34px 36px 40px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 60px rgba(12, 44, 77, 0.3);
}

.pagina-socios .logo {
    max-width: 120px;
}

.pagina-socios form {
    text-align: left;
}

.pagina-socios h2 {
    font-size: 32px;
}

.pagina-socios .subtitulo {
    max-width: 620px;
    margin-right: auto;
    margin-left: auto;
}

.pagina-socios h3 {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 34px;
    color: #173b5f;
    border-bottom: 3px solid #d9e8f2;
}

.pagina-socios .grupo-input label {
    color: #173b5f;
    letter-spacing: 0.1px;
}

.pagina-socios .grupo-input input,
.pagina-socios select,
.pagina-socios textarea {
    background: #fbfdff;
    border-color: #d5e1eb;
    border-radius: 9px;
}

.pagina-socios .grupo-input input:hover,
.pagina-socios select:hover,
.pagina-socios textarea:hover {
    border-color: #9bbbd1;
}

.pagina-socios .bloque-repetible {
    border-color: #cbdde9;
    background: #f4f9fc;
}

.pagina-socios .boton-secundario {
    border-radius: 9px;
    font-weight: 600;
}

.pagina-socios .boton-registrar {
    border-radius: 9px;
    padding: 16px;
    letter-spacing: 0.2px;
}

.pagina-vista-previa {
    align-items: flex-start;
    padding: 28px 16px;
}

.vista-previa {
    width: 100%;
    max-width: 920px;
}

.acciones-impresion {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.acciones-impresion .boton-registrar,
.acciones-impresion .boton-secundario {
    width: auto;
    margin: 0;
    text-decoration: none;
}

.documento-solicitud {
    padding: 42px 48px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 15px 45px rgba(12, 44, 77, 0.2);
}

.encabezado-documento {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 3px solid #d9e8f2;
}

.encabezado-documento .logo {
    max-width: 92px;
}

.encabezado-documento h1 {
    margin: 2px 0 6px;
    color: #173b5f;
    font-size: 30px;
}

.encabezado-documento p {
    margin: 0;
    color: #718096;
}

.etiqueta-documento {
    color: #2980b9 !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.foto-previsualizada {
    width: 105px;
    height: 125px;
    border: 1px solid #cbdde9;
    border-radius: 8px;
    object-fit: cover;
}

.seccion-documento {
    margin-top: 28px;
}

.seccion-documento h2 {
    margin-bottom: 15px;
    padding-bottom: 7px;
    border-bottom: 2px solid #e5eef4;
    color: #173b5f;
    font-size: 19px;
}

.datos-documento {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
}

.datos-documento div,
.observacion-documento {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf2f6;
}

.datos-documento span,
.observacion-documento span {
    color: #718096;
    font-size: 12px;
}

.datos-documento strong,
.observacion-documento strong {
    color: #243b53;
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.observacion-documento {
    margin-top: 16px;
}

.tabla-adherentes {
    border: 1px solid #d9e8f2;
    border-radius: 8px;
    overflow: hidden;
}

.fila-tabla {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 14px;
    padding: 11px 13px;
    color: #243b53;
    font-size: 13px;
    border-top: 1px solid #edf2f6;
}

.encabezado-tabla {
    border-top: 0;
    color: #173b5f;
    background: #f1f8fc;
    font-weight: 700;
}

.sin-datos {
    color: #718096;
    font-size: 14px;
}

.pie-documento {
    margin-top: 38px;
    padding-top: 14px;
    border-top: 1px solid #d9e8f2;
    color: #718096;
    font-size: 12px;
    text-align: right;
}

.pagina-socios .boton-registrar {
    margin-top: 20px;
}

@media (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .caja-formulario {
        padding: 30px 22px;
    }

    h2 {
        font-size: 24px;
    }

    .pagina-registro .caja-formulario {
        padding: 28px 22px 24px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .pagina-socios {
        padding: 12px;
    }

    .pagina-socios .caja-formulario {
        padding: 28px 20px 30px;
    }

    .acciones-impresion {
        flex-direction: column-reverse;
    }

    .acciones-impresion .boton-registrar,
    .acciones-impresion .boton-secundario {
        width: 100%;
        text-align: center;
    }

    .documento-solicitud {
        padding: 26px 20px;
    }

    .encabezado-documento {
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    .encabezado-documento > div {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .encabezado-documento .logo {
        width: 66px;
        grid-row: 2;
    }

    .foto-previsualizada {
        width: 78px;
        height: 92px;
        grid-column: 2;
        grid-row: 2;
    }

    .encabezado-documento h1 {
        font-size: 25px;
    }

    .datos-documento {
        grid-template-columns: 1fr;
    }

    .fila-tabla {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .encabezado-tabla {
        display: none;
    }
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        display: block;
        padding: 0;
        background: #fff;
        color: #1d2d3d;
    }

    .acciones-impresion {
        display: none;
    }

    .vista-previa {
        max-width: none;
    }

    .documento-solicitud {
        min-height: 273mm;
        padding: 9mm;
        border-radius: 0;
        border: 1px solid #9ab4c8;
        box-shadow: none;
    }

    .encabezado-documento {
        display: grid;
        grid-template-columns: 22mm 1fr 28mm;
        gap: 5mm;
        padding: 0 0 5mm;
        border-bottom: 2px solid #1d638e;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .encabezado-documento .logo {
        width: 20mm;
        max-width: 20mm;
    }

    .encabezado-documento h1 {
        margin: 1mm 0 2mm;
        color: #173b5f;
        font-size: 22pt;
        line-height: 1.05;
    }

    .encabezado-documento p {
        color: #4e6578;
        font-size: 9.5pt;
    }

    .etiqueta-documento {
        color: #1d638e !important;
        font-size: 8.5pt;
        letter-spacing: 1.2px;
    }

    .foto-previsualizada {
        display: block !important;
        width: 27mm;
        height: 32mm;
        border: 1px solid #6f91a8;
        border-radius: 0;
        object-fit: cover;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .seccion-documento {
        margin-top: 5mm;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .seccion-documento h2 {
        margin-bottom: 3mm;
        padding: 1.5mm 2.5mm;
        border: 0;
        border-left: 3px solid #1d638e;
        background: #eaf3f8;
        color: #173b5f;
        font-size: 11pt;
    }

    .datos-documento {
        gap: 2.5mm 6mm;
    }

    .datos-documento div,
    .observacion-documento {
        gap: 1mm;
        padding: 1.5mm 0;
        border-bottom-color: #dbe6ed;
    }

    .datos-documento span,
    .observacion-documento span {
        color: #537085;
        font-size: 7.5pt;
        font-weight: 700;
        text-transform: uppercase;
    }

    .datos-documento strong,
    .observacion-documento strong {
        color: #1d2d3d;
        font-size: 9.5pt;
    }

    .observacion-documento {
        margin-top: 3mm;
    }

    .tabla-adherentes {
        border-color: #9ab4c8;
        border-radius: 0;
    }

    .fila-tabla {
        gap: 4mm;
        padding: 2.5mm 3mm;
        color: #1d2d3d;
        font-size: 8.5pt;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .encabezado-tabla {
        color: #fff;
        background: #1d638e;
    }

    .pie-documento {
        margin-top: 7mm;
        padding-top: 3mm;
        border-top-color: #9ab4c8;
        color: #537085;
        font-size: 8pt;
    }
}

@media (min-width: 481px) and (max-width: 760px) {
    .pagina-socios .form-grid {
        grid-template-columns: 1fr;
    }
}