/* Variables de color (por si acaso no las carga styles.css) */
:root {
    --azul: #2e6fa3;
    --azul-oscuro: #1a4d7a;
    --azul-claro: #4a8bc2;
    --verde: #6ba832;
    --naranja: #f57c00;
    --texto: #2c3e50;
    --texto-suave: #5a6c7d;
    --fondo-claro: #f8fbfd;
    --borde: #e1ecf4;
    --blanco: #ffffff;
    --error: #e53935;
    --sombra: 0 10px 40px rgba(46, 111, 163, 0.1);
}

/* HERO DE LA PÁGINA */

.hero-libro {
    background: #f9fafb;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #e8edf2;
}

/* Franja de color izquierda */
.hero-libro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    border-radius: 0 4px 4px 0;
}

/* Patrón de puntos decorativo en la esquina derecha */
.hero-libro::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 320px;
    height: 320px;
    background-image: radial-gradient(circle, #d1e8b8 1.5px, transparent 1.5px);
    background-size: 22px 22px;
    opacity: 0.6;
    pointer-events: none;
    border-radius: 50%;
}

/* Layout split: texto + visual */
.hero-libro-contenido {
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 60px 64px 72px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
}

/* Columna de texto (izquierda) */
.hero-libro-texto {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Etiqueta badge */
.hero-libro-etiqueta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef7e3;
    color: #4a7a22;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 6px;
    margin-bottom: 18px;
    width: fit-content;
    border-left: 3px solid var(--verde);
}

/* Título principal */
.hero-libro-titulo {
    font-family: 'Playfair Display', serif;
    font-size: clamp(34px, 4.5vw, 52px);
    font-weight: 800;
    color: #33749c;
    line-height: 1.1;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}

.titulo-destacado {
    color: var(--verde);
    position: relative;
}

/* Subrayado decorativo bajo "Reclamaciones" */
.titulo-destacado::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--verde));
    border-radius: 2px;
}

/* Descripción */
.hero-libro-descripcion {
    font-size: 16px;
    color: #4a5e6d;
    line-height: 1.75;
    max-width: 520px;
    margin-bottom: 30px;
}

.hero-libro-descripcion strong {
    color: #1a2e3b;
    font-weight: 700;
}

/* Chips informativos bajo la descripción */
.hero-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #dde8f0;
    border-radius: 30px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #3a5068;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.hero-chip svg {
    color: var(--naranja);
    flex-shrink: 0;
}

/* Badge flotante "INDECOPI" */
.hero-badge-indecopi {
    background: #fff8e1;
    border: 1px solid #ffd54f;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    color: #795900;
    text-align: center;
    letter-spacing: 0.4px;
    width: 200px;
}

/* Decoración fondo (sin uso, vacío para compatibilidad) */
.hero-fondo-deco { display: none; }


.banner-ayuda-contenedor {
    background: transparent;
    padding: 0 24px;
    margin-top: -60px;      
    margin-bottom: 0;
    position: relative;
    z-index: 10;
}

.banner-ayuda {
    max-width: 960px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    padding: 36px 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.13), 0 4px 16px rgba(0,0,0,0.06);
    flex-wrap: wrap;
}

.banner-ayuda::before,
.banner-ayuda::after {
    display: none;
}

/* Sin icono lateral en este diseño */
.banner-ayuda-icono {
    display: none;
}

.banner-ayuda-sep {
    display: none;
}

.banner-ayuda-texto {
    flex: 1;
    padding: 0;
}

.banner-ayuda-texto h3 {
    font-family: 'Playfair Display';
    font-size: 45px;
    font-weight: 700;
    color: #6BA832;
    margin-bottom: 8px;
}

.banner-ayuda-texto p {
    font-size: 15px;
    color: #5a6c7d;
    line-height: 1.6;
    max-width: 480px;
}

/* Botón azul sólido */
.banner-ayuda-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 34px;
    background: var(--azul);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    border-radius: 50px;
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.28s ease;
    box-shadow: 0 6px 20px rgba(46, 111, 163, 0.35);
    letter-spacing: 0.2px;
}

.banner-ayuda-btn .btn-flecha {
    display: none;
}

.banner-ayuda-btn:hover {
    background: var(--azul-oscuro);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(46, 111, 163, 0.45);
}

.hero-libro {
    padding-bottom: 90px;
}

@media screen and (max-width: 768px) {
    .hero-libro-contenido {
        grid-template-columns: 1fr;
        padding: 44px 24px 44px 36px;
        gap: 32px;
    }

    .banner-ayuda-contenedor {
        margin-top: -48px;
        padding: 0 16px;
    }
    .banner-ayuda {
        padding: 28px 26px;
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .banner-ayuda-btn {
        width: 100%;
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    .hero-libro-contenido {
        padding: 36px 16px 36px 28px;
    }

    .hero-chips {
        flex-direction: column;
        gap: 8px;
    }
    .banner-ayuda-contenedor {
        margin-top: -40px;
    }
}

/* ZONA DE ADJUNTAR ARCHIVOS */

.zona-adjuntar {
    position: relative;
    border: 2px dashed var(--borde);
    border-radius: 12px;
    background: var(--fondo-claro);
    transition: all 0.25s ease;
    cursor: pointer;
}

.zona-adjuntar:hover,
.zona-adjuntar.arrastrando {
    border-color: var(--azul);
    background: #f0f7ff;
}

/* Input real oculto, cubre toda la zona */
.input-archivo-oculto {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Parte visual (icono + texto) */
.zona-adjuntar-visual {
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    text-align: center;
}

.adjuntar-icono {
    color: var(--azul-claro);
    opacity: 0.7;
    margin-bottom: 4px;
}

.zona-adjuntar:hover .adjuntar-icono,
.zona-adjuntar.arrastrando .adjuntar-icono {
    opacity: 1;
    color: var(--azul);
}

.adjuntar-texto-principal {
    font-size: 15px;
    color: var(--texto);
    font-weight: 500;
}

.adjuntar-enlace {
    color: var(--azul);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.adjuntar-texto-secundario {
    font-size: 13px;
    color: var(--texto-suave);
}

/* Lista de archivos ya seleccionados */
.lista-archivos {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Ítem de archivo */
.archivo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--texto);
    animation: aparecer-archivo 0.2s ease;
}

@keyframes aparecer-archivo {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.archivo-item-icono {
    color: var(--azul);
    flex-shrink: 0;
}

.archivo-item-nombre {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archivo-item-peso {
    font-size: 12px;
    color: var(--texto-suave);
    flex-shrink: 0;
}

/* Botón "x" para quitar archivo */
.archivo-item-eliminar {
    background: none;
    border: none;
    color: var(--texto-suave);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.archivo-item-eliminar:hover {
    color: var(--error);
}

/* Mensaje de error de archivos */
.error-archivos {
    font-size: 12px;
    color: var(--error);
    margin-top: 4px;
    display: block;
}

/* AVISO INDECOPI (dentro del bloque 3) */

.aviso-indecopi {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f0f7ff;
    border: 1px solid #c8dff2;
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 4px;
}

.aviso-indecopi-icono {
    color: var(--azul);
    flex-shrink: 0;
    margin-top: 1px;
}

.aviso-indecopi p {
    font-size: 13px;
    color: #3a5a7a;
    line-height: 1.65;
}

.aviso-indecopi strong {
    color: var(--azul-oscuro);
}

/* =============================================
   SECCIÓN PRINCIPAL DEL FORMULARIO
   ============================================= */

.seccion-formulario {
    background: var(--fondo-claro);
    padding: 80px 20px 80px;
    min-height: 60vh;
}

.formulario-contenedor {
    max-width: 860px;
    margin: 0 auto;
}

/* =============================================
   CABECERA DE HOJA (número y fecha)
   ============================================= */

/* Fecha dentro del bloque 3 */
.fecha-en-seccion {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 8px 15px;
    background: var(--fondo-claro);
    border: 1px solid var(--borde);
    border-radius: 15px;
    width: fit-content;
}

.fecha-en-seccion-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #33749c;
    margin-bottom: 3px;
}

/* Input date estilizado */
.fecha-input-hoy {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1a2e3b !important;
    font-family: 'Montserrat', sans-serif !important;
    cursor: default !important;
    outline: none !important;
    width: auto !important;
    border-radius: 0 !important;
}

/* Ocultar flechas del spinner en Firefox */
.fecha-input-hoy::-moz-focus-inner { border: 0; }
/* Bloquear apertura del calendario en webkit */
.fecha-input-hoy::-webkit-calendar-picker-indicator {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.fecha-en-titulo {
    margin-left: auto;
    margin-bottom: 0;
    align-self: center;
    flex-shrink: 0;
}


.etiqueta-campo {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--texto-suave);
    margin-bottom: 8px;
}

/* Fecha visual por bloques (Día / Mes / Año) */

.fecha-valor {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--azul);
    font-family: 'Playfair Display', serif;
    line-height: 1;
}

.fecha-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--texto-suave);
    margin-top: 4px;
}

.fecha-separador {
    font-size: 22px;
    color: var(--borde);
    font-weight: 300;
    margin-bottom: 8px;
}

.fecha-texto-display {
    font-size: 15px;
    font-weight: 700;
    color: #1a2e3b;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.fecha-en-titulo {
    flex-shrink: 0;
    white-space: nowrap;
}

@media screen and (max-width: 600px) {
    .bloque-titulo {
        flex-wrap: wrap;
    }

    .bloque-titulo > div:nth-child(2) {
        flex: 0 0 100%;
        order: 3;
        margin-top: 6px;
    }


    .fecha-en-titulo {
        margin-left: auto;
        width: auto;
        margin-top: 0;
        align-self: center;
        order: 2;
        padding: 6px 12px;
        font-size: 12px;
    }

    .fecha-en-titulo .fecha-en-seccion-label {
        font-size: 9px;
    }

    .fecha-en-titulo .fecha-texto-display {
        font-size: 13px;
    }
}

/* BLOQUES DEL FORMULARIO (secciones 1, 2, 3) */

.seccion-bloque {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 36px 36px 30px;
    margin-bottom: 24px;
    box-shadow: var(--sombra);
    transition: box-shadow 0.3s ease;
}

.seccion-bloque:hover {
    box-shadow: 0 15px 50px rgba(46, 111, 163, 0.13);
}

/* Título del bloque con número */
.bloque-titulo {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 30px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--borde);
}

.bloque-numero {
    width: 40px;
    height: 40px;
    background: #6BA832;
    color: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    font-family: 'Playfair Display', serif;
    box-shadow: 0 4px 12px rgba(107, 168, 50, 0.35);
}

.bloque-titulo h2 {
    font-size: 18px;
    font-weight: 700;
    color: #33749c;
    margin-bottom: 4px;
    font-family: 'Montserrat', sans-serif;
}

.bloque-titulo p {
    font-size: 14px;
    color: var(--texto-suave);
    line-height: 1.5;
}

/*GRID DE CAMPOS*/

.campos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Campo de ancho completo */
.campo-ancho-completo {
    grid-column: 1 / -1;
}

/* Campo oculto (para el "Otro" servicio) */
.campo-oculto {
    display: none;
}

.campo-oculto.visible {
    display: block;
}

/* ESTILOS DE CAMPOS (inputs, select, textarea) */

.campo-grupo {
    display: flex;
    flex-direction: column;
}

.campo-grupo label {
    font-size: 13px;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

/* Asterisco de campo requerido */
.campo-requerido {
    color: var(--error);
    margin-left: 2px;
}

/* Texto "Opcional" */
.campo-opcional {
    color: var(--texto-suave);
    font-weight: 400;
    font-size: 12px;
}

/* Inputs y select */
.campo-grupo input,
.campo-grupo select,
.campo-grupo textarea {
    padding: 13px 16px;
    border: 1.5px solid var(--borde);
    border-radius: 10px;
    font-size: 15px;
    color: var(--texto);
    background: var(--blanco);
    font-family: 'Montserrat', sans-serif;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Select con flecha personalizada */
.campo-grupo select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%235a6c7d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Textarea */
.campo-grupo textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* Foco en campos */
.campo-grupo input:focus,
.campo-grupo select:focus,
.campo-grupo textarea:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(46, 111, 163, 0.12);
}

/* Campos con error */
.campo-grupo input.error-campo,
.campo-grupo select.error-campo,
.campo-grupo textarea.error-campo {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

/* Campos válidos */
.campo-grupo input.campo-valido,
.campo-grupo select.campo-valido,
.campo-grupo textarea.campo-valido {
    border-color: var(--verde);
}

/* Mensaje de error debajo del campo */
.mensaje-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 5px;
    min-height: 18px;
    display: block;
}

/* Contador de caracteres */
.contador-caracteres {
    font-size: 12px;
    color: var(--texto-suave);
    text-align: right;
    margin-top: 5px;
}

/* SELECTOR DE TIPO (Reclamo / Queja) */

.selector-tipo {
    margin-bottom: 24px;
}

.selector-tipo-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 14px;
}

.opciones-tipo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Cada opción (label contenedor) */
.opcion-tipo {
    cursor: pointer;
    display: block;
}

/* Ocultar el radio nativo */
.opcion-tipo input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Caja visual de la opción */
.opcion-tipo-contenido {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 2px solid var(--borde);
    border-radius: 12px;
    background: var(--fondo-claro);
    transition: all 0.25s ease;
}

.opcion-tipo:hover .opcion-tipo-contenido {
    border-color: var(--azul-claro);
    background: #f0f7ff;
}

/* Cuando el radio está seleccionado */
.opcion-tipo input[type="radio"]:checked + .opcion-tipo-contenido {
    border-color: var(--azul);
    background: linear-gradient(135deg, #f0f7ff, #e8f4fb);
    box-shadow: 0 4px 16px rgba(46, 111, 163, 0.15);
}

.opcion-tipo-icono {
    width: 48px;
    height: 48px;
    background: var(--blanco);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--azul);
    flex-shrink: 0;
    border: 1px solid var(--borde);
    transition: all 0.25s ease;
}

.opcion-tipo input[type="radio"]:checked + .opcion-tipo-contenido .opcion-tipo-icono {
    background: var(--azul);
    color: #ffffff;
    border-color: var(--azul);
}

.opcion-tipo-contenido > div:last-child strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 3px;
}

.opcion-tipo-contenido > div:last-child span {
    display: block;
    font-size: 13px;
    color: var(--texto-suave);
    line-height: 1.4;
}

/* SECCIÓN DE TÉRMINOS Y CONDICIONES */

.seccion-terminos {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 24px 30px;
    margin-bottom: 30px;
    box-shadow: var(--sombra);
}

/* Contenedor del checkbox personalizado */
.check-terminos {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
}

/* Ocultar checkbox nativo */
.check-terminos input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Cuadro visual del checkbox */
.check-cuadro {
    width: 22px;
    height: 22px;
    border: 2px solid var(--borde);
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    background: var(--blanco);
    position: relative;
}

/* Checkmark con pseudoelemento */
.check-cuadro::after {
    content: '';
    width: 6px;
    height: 10px;
    border-right: 2.5px solid #ffffff;
    border-bottom: 2.5px solid #ffffff;
    transform: rotate(45deg) scale(0) translateY(-1px);
    transition: transform 0.2s ease;
}

/* Estado marcado */
.check-terminos input[type="checkbox"]:checked + .check-cuadro {
    background: var(--azul);
    border-color: var(--azul);
}

.check-terminos input[type="checkbox"]:checked + .check-cuadro::after {
    transform: rotate(45deg) scale(1) translateY(-1px);
}

.check-texto {
    font-size: 14px;
    color: var(--texto-suave);
    line-height: 1.65;
}

/* BOTÓN ENVÍO */

.boton-envio-contenedor {
    text-align: center;
    margin-bottom: 10px;
}

.boton-enviar {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 48px;
    background: #2B6A9D;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 30px rgba(46, 111, 163, 0.35);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

/* Efecto de brillo al pasar el mouse */
.boton-enviar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s ease;
}

.boton-enviar:hover::before {
    left: 100%;
}

.boton-enviar:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 40px rgba(46, 111, 163, 0.45);
}

.boton-enviar:active {
    transform: translateY(0);
}

/* Loader (spinner) al enviar */
.boton-loader {
    display: none;
}

.boton-loader svg {
    animation: girar-loader 1s linear infinite;
}

@keyframes girar-loader {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estado "enviando" del botón */
.boton-enviar.enviando {
    background: linear-gradient(135deg, #5a8fb8, #7aadd1);
    cursor: not-allowed;
    pointer-events: none;
}

.boton-enviar.enviando .boton-texto,
.boton-enviar.enviando .boton-icono {
    display: none;
}

.boton-enviar.enviando .boton-loader {
    display: flex;
}

/* MODAL DE CONFIRMACIÓN */

.modal-confirmacion {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.modal-confirmacion.activo {
    opacity: 1;
    visibility: visible;
}

/* Fondo oscuro del modal */
.modal-fondo {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(15, 35, 60, 0.75);
    backdrop-filter: blur(6px);
}

/* Contenido del modal */
.modal-contenido {
    position: relative;
    background: var(--blanco);
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-confirmacion.activo .modal-contenido {
    transform: scale(1) translateY(0);
}

/* Icono de éxito */
.modal-icono-exito {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--verde);
    animation: pulso-exito 2s ease-in-out infinite;
}

@keyframes pulso-exito {
    0%, 100% { box-shadow: 0 0 0 0 rgba(107, 168, 50, 0.3); }
    50% { box-shadow: 0 0 0 15px rgba(107, 168, 50, 0); }
}

.modal-contenido h3 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: var(--texto);
    margin-bottom: 12px;
}

.modal-contenido p {
    font-size: 15px;
    color: var(--texto-suave);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Caja del número de hoja en el modal */
.modal-numero-hoja {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--azul);
    background: var(--fondo-claro);
    border: 2px dashed var(--borde);
    border-radius: 12px;
    padding: 14px 24px;
    margin: 16px auto;
    letter-spacing: 2px;
}

.modal-nota {
    font-size: 13px;
    color: var(--texto-suave);
}

/* Botón de cerrar modal */
.modal-boton-cerrar {
    display: inline-block;
    margin-top: 20px;
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--verde), #8bc653);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(107, 168, 50, 0.35);
}

.modal-boton-cerrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(107, 168, 50, 0.45);
}

/* RESPONSIVE - TABLETS */

@media screen and (max-width: 1024px) {
    .seccion-formulario {
        padding: 40px 15px 60px;
    }

    .seccion-bloque {
        padding: 28px 24px 22px;
    }
}

@media screen and (max-width: 767px) {
    .campos-grid {
        grid-template-columns: 1fr;
    }

    .campo-ancho-completo {
        grid-column: 1;
    }

    .opciones-tipo {
        grid-template-columns: 1fr;
    }

    .seccion-bloque {
        padding: 22px 18px;
    }

    .bloque-titulo {
        gap: 14px;
    }

    .boton-enviar {
        width: 100%;
        justify-content: center;
        padding: 16px 30px;
    }

    .modal-contenido {
        padding: 36px 24px;
    }
}

@media screen and (max-width: 480px) {
    .bloque-numero {
        width: 34px;
        height: 34px;
        font-size: 16px;
        border-radius: 10px;
    }

    .bloque-titulo h2 {
        font-size: 16px;
    }
}

/* DROPDOWN - SERVICIO */
.select-personalizado {
    position: relative;
    width: 100%;
    user-select: none;
}

.select-seleccionado {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fbfd;
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    color: var(--color-texto);
    font-family: inherit;
}

.select-seleccionado:hover {
    background: #ffffff;
    border-color: rgba(46, 111, 163, 0.3);
}

.select-personalizado.abierto .select-seleccionado {
    background: #ffffff;
    border-color: var(--color-primario);
    box-shadow: 0 0 0 4px rgba(46, 111, 163, 0.1);
    border-radius: 14px 14px 0 0;
}

.select-placeholder {
    color: #a0adb8;
}

.select-texto-elegido {
    color: var(--color-texto);
    font-weight: 500;
}

.select-flecha {
    width: 20px;
    height: 20px;
    color: var(--color-primario);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.select-personalizado.abierto .select-flecha {
    transform: rotate(180deg);
}

/* Panel de opciones */
.select-opciones {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid var(--color-primario);
    border-top: none;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 20px 50px rgba(46, 111, 163, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.select-personalizado.abierto .select-opciones {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Lista de opciones */
.select-lista {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 111, 163, 0.3) transparent;
}

.select-lista::-webkit-scrollbar {
    width: 5px;
}

.select-lista::-webkit-scrollbar-track {
    background: transparent;
}

.select-lista::-webkit-scrollbar-thumb {
    background: rgba(46, 111, 163, 0.3);
    border-radius: 10px;
}

/* Opción individual */
.select-opcion {
    padding: 12px 20px;
    font-size: 14px;
    color: var(--color-texto-claro);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    line-height: 1.4;
}

.select-opcion:hover {
    background: linear-gradient(135deg, rgba(46, 111, 163, 0.06), rgba(107, 168, 50, 0.04));
    color: var(--color-primario);
    border-left-color: var(--color-primario);
    padding-left: 24px;
}

.select-opcion.seleccionada {
    background: linear-gradient(135deg, rgba(46, 111, 163, 0.1), rgba(107, 168, 50, 0.06));
    color: var(--color-primario);
    font-weight: 600;
    border-left-color: var(--color-secundario);
}

/* Sin resultados */
.select-sin-resultados {
    padding: 20px;
    text-align: center;
    color: #a0adb8;
    font-size: 14px;
    font-style: italic;
    display: none;
}

/* BADGE FORMATO DOCUMENTO */
.doc-formato-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(46, 111, 163, 0.08), rgba(107, 168, 50, 0.06));
    border: 1px solid rgba(46, 111, 163, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: var(--color-primario);
    font-weight: 500;
    animation: badgeFadeIn 0.3s ease;
}

.doc-formato-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

@keyframes badgeFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Input de número: estado válido / inválido dinámico */
.input-doc-valido {
    border-color: #6ba832 !important;
    background: rgba(107, 168, 50, 0.04) !important;
}

.input-doc-invalido {
    border-color: #e74c3c !important;
    background: rgba(231, 76, 60, 0.04) !important;
}

/* ANIMACIONES - CARGA DE PÁGINA */

@keyframes clipReveal {
    from { clip-path: inset(0 100% 0 0); opacity: 0; }
    to   { clip-path: inset(0 0% 0 0);   opacity: 1; }
}

@keyframes slideBlurUp {
    from { opacity: 0; transform: translateY(35px); filter: blur(8px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

@keyframes slideBlurLeft {
    from { opacity: 0; transform: translateX(-45px); filter: blur(6px); }
    to   { opacity: 1; transform: translateX(0);     filter: blur(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.75) translateY(20px); filter: blur(4px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    filter: blur(0); }
}

@keyframes expandirLinea {
    from { width: 0; opacity: 0; }
    to   { width: 100%; opacity: 1; }
}

@keyframes flotarParticulaBanner {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.4; }
    50%       { transform: translateY(-18px) rotate(180deg); opacity: 0.8; }
}

/* Hero - entrada cinematográfica */
.hero-libro-etiqueta {
    animation: clipReveal 0.8s cubic-bezier(0.77, 0, 0.18, 1) both;
    animation-delay: 0.1s;
}

.hero-libro-titulo {
    animation: slideBlurLeft 0.9s cubic-bezier(0.23, 1, 0.32, 1) both;
    animation-delay: 0.3s;
}

.titulo-destacado::after {
    width: 0;
    opacity: 0;
    animation: expandirLinea 1s cubic-bezier(0.77, 0, 0.18, 1) forwards;
    animation-delay: 1s;
}

.hero-libro-descripcion {
    animation: slideBlurUp 0.9s cubic-bezier(0.23, 1, 0.32, 1) both;
    animation-delay: 0.5s;
}

/* Chips en cascada con blur */
.hero-chip {
    opacity: 0;
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.hero-chip:nth-child(1) { animation-delay: 0.7s; }
.hero-chip:nth-child(2) { animation-delay: 0.85s; }
.hero-chip:nth-child(3) { animation-delay: 1.0s; }

/* Banner con rebote elegante */
.banner-ayuda {
    animation: scaleIn 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 0.9s;
    position: relative;
    overflow: hidden;
}

/* Partículas decorativas dentro del banner */
.banner-ayuda::before {
    display: block !important;
    content: '';
    position: absolute;
    top: -20px;
    right: 80px;
    width: 12px;
    height: 12px;
    background: rgba(107, 168, 50, 0.25);
    border-radius: 50%;
    animation: flotarParticulaBanner 3s ease-in-out infinite;
    animation-delay: 0s;
    pointer-events: none;
}

.banner-ayuda::after {
    display: block !important;
    content: '';
    position: absolute;
    bottom: 10px;
    right: 200px;
    width: 7px;
    height: 7px;
    background: rgba(46, 111, 163, 0.3);
    border-radius: 50%;
    animation: flotarParticulaBanner 4s ease-in-out infinite;
    animation-delay: 1.5s;
    pointer-events: none;
}

/* ANIMACIONES - SCROLL REVEAL */

.animar-scroll {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.animar-scroll.zoom {
    transform: scale(0.92) translateY(20px);
}

.animar-scroll.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Línea brillante que cruza el bloque al entrar */
@keyframes shimmerEntrada {
    0%   { left: -100%; opacity: 0.6; }
    100% { left: 200%;  opacity: 0; }
}

.seccion-bloque {
    transition: box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}

.seccion-bloque .bloque-titulo {
    position: relative;
    overflow: hidden;
}

.seccion-bloque .bloque-titulo::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    pointer-events: none;
    opacity: 0;
}

.seccion-bloque.shimmer .bloque-titulo::after {
    animation: shimmerEntrada 0.9s ease forwards;
}

.seccion-bloque:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(46, 111, 163, 0.16);
}

/* Número del bloque: onda expansiva al entrar */
@keyframes ondaExpansiva {
    0%   { box-shadow: 0 4px 12px rgba(107,168,50,0.35), 0 0 0 0px rgba(107,168,50,0.4); }
    50%  { box-shadow: 0 4px 12px rgba(107,168,50,0.35), 0 0 0 14px rgba(107,168,50,0.0); }
    100% { box-shadow: 0 4px 12px rgba(107,168,50,0.35); }
}

.bloque-numero.animado {
    animation: ondaExpansiva 0.9s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Inputs: borde animado al enfocar */
.campo-grupo input,
.campo-grupo textarea {
    transition: border-color 0.3s ease,
                box-shadow 0.3s ease,
                transform 0.2s ease;
}

.campo-grupo input:focus,
.campo-grupo textarea:focus {
    transform: translateY(-1px);
}

/* Botón enviar: pulso continuo suave */
@keyframes pulsarBoton {
    0%, 100% { box-shadow: 0 8px 30px rgba(46, 111, 163, 0.35); }
    50%       { box-shadow: 0 8px 50px rgba(46, 111, 163, 0.6), 0 0 0 8px rgba(46,111,163,0.08); }
}

.boton-enviar:not(.enviando) {
    animation: pulsarBoton 2.5s ease-in-out infinite;
}

.boton-enviar:hover {
    animation: none;
}

/* Sección terminos: entrada suave */
.seccion-terminos {
    transition: box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.seccion-terminos:hover {
    transform: translateY(-2px);
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        filter: none !important;
    }
}