/* ===================================
   BOOKART - ESTILOS DE SESIÓN
   Identidad de marca artesanal
   =================================== */

:root {
    --amarillo-bookart: #FBD216;
    --verde-bookart: #1E9332;
    --rojo-bookart: #ED2939;
    --azul-bookart: #0033AD;
    --blanco: #FFFFFF;
    --amarillo-claro: #FFDE59;
    --amarillo-oscuro: #E8C20A;
    --verde-oscuro: #166B25;
    --marron-texto: #4A3830;
    --crema-papel: #FFF9F0;
    --font-display: 'Chewy', cursive;
    --font-body: 'Martian Mono', monospace;
}

body {
    background: #fef9e7;
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        /* Brochazo amarillo */
        linear-gradient(135deg, transparent 0%, transparent 10%, var(--amarillo-bookart) 15%, var(--amarillo-bookart) 20%, transparent 25%, transparent 100%),
        
        /* Brochazo verde */
        linear-gradient(125deg, transparent 0%, transparent 25%, var(--verde-bookart) 30%, var(--verde-bookart) 38%, transparent 43%, transparent 100%),
        
        /* Brochazo rojo */
        linear-gradient(140deg, transparent 0%, transparent 45%, var(--rojo-bookart) 50%, var(--rojo-bookart) 58%, transparent 63%, transparent 100%),
        
        /* Brochazo azul */
        linear-gradient(130deg, transparent 0%, transparent 65%, var(--azul-bookart) 70%, var(--azul-bookart) 78%, transparent 83%, transparent 100%),
        
        /* Brochazo amarillo secundario */
        linear-gradient(145deg, transparent 0%, transparent 80%, var(--amarillo-bookart) 85%, var(--amarillo-bookart) 92%, transparent 97%, transparent 100%);
    opacity: 0.85;
    pointer-events: none;
    z-index: 0;
}

/* ===================================
   MODAL Y BACKDROP
   =================================== */

#modal {
    border: none;
    background: whitesmoke;
    max-width: 100%;
    max-height: 100%;
    padding: 0;
    display: flex;
    justify-content: center;
}

#modal::backdrop {
    background: transparent;
    backdrop-filter: blur(8px);
}


/* ===================================
   CONTENEDOR PRINCIPAL
   =================================== */

.iniciarSesion {
    width: 600px;
    max-width: 95vw;
    min-height: 600px;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139, 90, 43, 0.03) 2px,
            rgba(139, 90, 43, 0.03) 3px
        ),
        linear-gradient(
            90deg,
            var(--crema-papel) 0%,
            #f9f5ed 50%,
            var(--crema-papel) 100%
        );
    border: 6px solid var(--marron-texto);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* Textura de papel */
.iniciarSesion::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(139, 90, 43, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 90, 43, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Cinta decorativa superior con relieve */
.iniciarSesion::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        var(--amarillo-bookart) 0px,
        var(--amarillo-bookart) 30px,
        var(--verde-bookart) 30px,
        var(--verde-bookart) 60px,
        var(--rojo-bookart) 60px,
        var(--rojo-bookart) 90px,
        var(--azul-bookart) 90px,
        var(--azul-bookart) 120px
    );
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* ===================================
   BOTÓN CERRAR
   =================================== */

#cerrarSesion {
    position: absolute;
    right: 20px;
    top: 30px;
    z-index: 15;
    width: 45px;
    height: 45px;
    background: var(--rojo-bookart);
    color: var(--blanco);
    border: 3px solid var(--marron-texto);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.8rem;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0px var(--marron-texto);
}

#cerrarSesion:hover {
    background: var(--verde-bookart);
    transform: rotate(90deg) scale(1.1);
}

/* ===================================
   SECCIÓN INICIAL (Bienvenida)
   =================================== */

.Sesion {
    width: 100%;
    padding: 4rem 3rem;
    position: relative;
    z-index: 2;
}

.Sesion h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--marron-texto);
    margin-bottom: 1rem;
    text-align: center;
}

.Sesion p {
    text-align: center;
    color: var(--marron-texto);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.pLeyenda {
    font-size: 1.05rem;
    margin: 1.5rem 0 2.5rem;
}

.pSesion {
    color: var(--verde-bookart);
    font-weight: 700;
    cursor: pointer;
    margin: 2rem 0;
    transition: color 0.3s ease;
}

.pSesion:hover {
    color: var(--verde-oscuro);
    text-decoration: underline;
}

.condiciones {
    color: #999;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 2rem;
}

.Sesion button {
    width: 100%;
    max-width: 400px;
    height: 55px;
    margin: 0 auto 1rem;
    display: block;
    background: var(--verde-bookart);
    color: var(--blanco);
    border: 4px solid var(--marron-texto);
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 0px var(--marron-texto);
}

.Sesion button:hover {
    background: var(--verde-oscuro);
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0px var(--marron-texto);
}

/* ===================================
   IMAGEN LATERAL - OCULTA
   =================================== */

.imgP {
    display: none;
}

.imgSesion {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.imgSesion span {
    pointer-events: all;
}

/* ===================================
   INICIO DE SESIÓN
   =================================== */

.inicioSesion {
    width: 100%;
    padding: 4rem 3rem;
    display: none;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.inicioSesion h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--marron-texto);
    margin-bottom: 2rem;
    text-align: center;
}

.ingresaUsuario, .ingresaContra {
    color: var(--marron-texto);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.ingresaContra {
    margin-top: 2rem;
}

#imgVerContrasena {
    position: absolute;
    right: 15px;
    top: 38px;
    color: var(--verde-bookart);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 5;
    padding-top: .5em;
}

.inicioSesion input {
    width: 100%;
    height: 50px;
    padding: 0 1rem;
    margin-top: 0.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--marron-texto);
    background: var(--crema-papel);
    border: 4px solid var(--marron-texto);
    transition: all 0.3s ease;
}

.inicioSesion input:focus {
    outline: none;
    border-color: var(--verde-bookart);
    box-shadow: 0 0 0 3px rgba(30, 147, 50, 0.2);
}

.olvidaContra {
    margin-top: 1rem;
    text-align: center;
    color: var(--verde-bookart);
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 2rem;
}

.olvidaContra:hover {
    text-decoration: underline;
    color: var(--verde-oscuro);
}

.ISbtn {
    width: 100%;
    max-width: 400px;
    height: 55px;
    margin: 0 auto 1.5rem;
    display: block;
    background: var(--verde-bookart);
    color: var(--blanco);
    border: 4px solid var(--marron-texto);
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 0px var(--marron-texto);
}

.ISbtn:hover {
    background: var(--verde-oscuro);
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0px var(--marron-texto);
}

.faltaCuenta {
    text-align: center;
    color: var(--marron-texto);
}

.creaCuentaDesdeInicio {
    color: var(--verde-bookart);
    font-weight: 700;
    cursor: pointer;
    margin-left: 0.5rem;
}

.creaCuentaDesdeInicio:hover {
    text-decoration: underline;
    color: var(--verde-oscuro);
}

/* ===================================
   CREAR CUENTA
   =================================== */

.crearCuenta {
    width: 100%;
    padding: 3rem 2rem;
    display: none;
    overflow-y: auto;
    max-height: 80vh;
    position: relative;
    z-index: 2;
}

/* Scrollbar personalizada */
.crearCuenta::-webkit-scrollbar {
    width: 8px;
}

.crearCuenta::-webkit-scrollbar-track {
    background: var(--crema-papel);
}

.crearCuenta::-webkit-scrollbar-thumb {
    background: var(--verde-bookart);
    border-radius: 4px;
}

.crearCuenta h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--marron-texto);
    margin-bottom: 2rem;
    text-align: center;
}

.crearCuenta p {
    color: var(--marron-texto);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.crearCuenta input, .crearCuenta select {
    font-family: var(--font-body);
    color: var(--marron-texto);
    background: var(--crema-papel);
    border: 3px solid var(--marron-texto);
    height: 40px;
    padding: 0 0.8rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.crearCuenta input:focus, .crearCuenta select:focus {
    outline: none;
    border-color: var(--verde-bookart);
    box-shadow: 0 0 0 3px rgba(30, 147, 50, 0.2);
}

.crearCuenta button {
    width: 100%;
    max-width: 400px;
    height: 50px;
    margin: 2rem auto 0;
    display: block;
    background: var(--amarillo-bookart);
    color: var(--marron-texto);
    border: 4px solid var(--marron-texto);
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 0px var(--marron-texto);
}

.crearCuenta button:hover:not(:disabled) {
    background: var(--amarillo-oscuro);
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0px var(--marron-texto);
}

.crearCuenta button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tituloFechaN {
    text-align: center;
    color: var(--marron-texto);
    font-weight: 700;
    font-size: 1.1rem;
    margin: 2rem 0 1rem;
}

/* ===================================
   CAMPOS DEL FORMULARIO
   =================================== */

.cNombre, .cApellidoP, .cApellidoM, .cUsuario, .cTelefono,
.cDia, .cMes, .cAño, .cCorreo, .cContraseña, .cCContraseña {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.cNombre, .cApellidoP, .cApellidoM {
    width: calc(33.33% - 0.67rem);
    margin-right: 1rem;
}

.cApellidoM {
    margin-right: 0;
}

.cNombre input, .cApellidoP input, .cApellidoM input {
    width: 100%;
}

.cUsuario, .cTelefono {
    width: calc(50% - 0.5rem);
    margin-right: 1rem;
}

.cTelefono {
    margin-right: 0;
}

.cUsuario input, .cTelefono input {
    width: 100%;
}

.cDia, .cMes {
    width: calc(33.33% - 0.67rem);
    margin-right: 1rem;
}

.cAño {
    width: calc(33.33% - 0.67rem);
    margin-right: 0;
}

.cDia select, .cMes select, .cAño input {
    width: 100%;
}

.cCorreo {
    width: 100%;
}

.cCorreo input {
    width: 100%;
}

.cContraseña, .cCContraseña {
    width: calc(50% - 0.5rem);
    margin-right: 1rem;
}

.cCContraseña {
    margin-right: 0;
}

.cContraseña input, .cCContraseña input {
    width: 100%;
    padding-right: 40px;
}

/* Iconos de visibilidad */
.crearCuenta span {
    position: absolute;
    right: 10px;
    top: 40px;
    color: var(--verde-bookart);
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 5;
}

.verCuenta {
    text-align: center;
    margin-top: 1.5rem;
}

.verCuenta p {
    display: inline;
    font-weight: 400;
}

.cambiarInicio {
    display: inline-block;
    position: relative;
    color: var(--verde-bookart);
    cursor: pointer;
}

.cambiarInicio:hover {
    text-decoration: underline;
    color: var(--verde-oscuro);
}

.botonCrearCuenta {
    text-align: center;
}

/* ===================================
   RECUPERACIÓN DE CONTRASEÑA
   =================================== */

.recuperacion {
    width: 100%;
    padding: 4rem 3rem;
    display: none;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.recuperacion h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--marron-texto);
    margin-bottom: 2rem;
    text-align: center;
}

.contentR {
    margin-top: 2rem;
}

.contentR p {
    color: var(--marron-texto);
    font-weight: 700;
    margin: 1.5rem 0 0.5rem;
    font-size: 0.95rem;
}

.contentR input {
    width: 100%;
    height: 50px;
    padding: 0 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--marron-texto);
    background: var(--crema-papel);
    border: 4px solid var(--marron-texto);
    transition: all 0.3s ease;
}

.contentR input:focus {
    outline: none;
    border-color: var(--verde-bookart);
    box-shadow: 0 0 0 3px rgba(30, 147, 50, 0.2);
}

.recuperacion button {
    width: 100%;
    max-width: 400px;
    height: 55px;
    margin: 2rem auto 0;
    display: block;
    background: var(--verde-bookart);
    color: var(--blanco);
    border: 4px solid var(--marron-texto);
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 5px 5px 0px var(--marron-texto);
}

.recuperacion button:hover {
    background: var(--verde-oscuro);
    transform: translate(3px, 3px);
    box-shadow: 2px 2px 0px var(--marron-texto);
}

.btnReestablecer {
    text-align: center;
}

.recuperacion span {
    position: absolute;
    right: 15px;
    padding: .5em 0;
    color: var(--verde-bookart);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 5;
}

/* ===================================
   ETIQUETAS DE VALIDACIÓN
   =================================== */

.etiquetaUsuario, .etiquetaContra, .etiquetaContra2, .etiquetaCorreo,
.etiquetaTel, .etiquetaPaterno, .etiquetaMaterno,
.etiquetaNombre, .etiquetaError, .etiquetaAño {
    color: var(--rojo-bookart) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    position: absolute;
    margin-top: 0.3rem;
    visibility: hidden;
    width: 100%; 
    max-width: 280px; 
    word-wrap: break-word;
    line-height: 1.3;
}

.etiquetaCoincidenciaC{
    color: var(--rojo-bookart) !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    position: absolute;
    margin-top: 2rem;
    visibility: hidden;
    width: 100%; 
    max-width: 280px; 
    word-wrap: break-word;
    line-height: 1.3;
}

/* DIALOG PERSONALIZADO - ESTILOS COMPLETOS */
#warning {
    border: none;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 450px;
    min-width: 350px;
    background: var(--crema-papel);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0; /* IMPORTANTE: quitar margin auto */
}

#warning::backdrop {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

#warning #mensaje {
    padding: 2rem 2rem 1.5rem 2rem;
    font-size: 1.1rem;
    color: var(--marron-texto);
    text-align: center;
    line-height: 1.6;
    margin: 0;
    font-family: var(--font-body);
}

/* Estilos por tipo de mensaje */
#warning #mensaje.error {
    color: var(--rojo-bookart);
    border-left: 5px solid var(--rojo-bookart);
}

#warning #mensaje.success {
    color: var(--verde-bookart);
    border-left: 5px solid var(--verde-bookart);
}

#warning #mensaje.warning {
    color: var(--amarillo-oscuro);
    border-left: 5px solid var(--amarillo-bookart);
}

/* CONTENEDOR DEL BOTÓN */
#warning .btnModal {
    padding: 0 2rem 2rem 2rem;
    text-align: center;
    display: block; /* AGREGAR ESTO */
}

/* BOTÓN ACEPTAR */
#warning #btnAcept {
    padding: 0.8rem 2rem;
    background: var(--verde-bookart);
    color: white;
    border: 3px solid var(--marron-texto);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0px var(--marron-texto);
    display: inline-block; /* AGREGAR ESTO */
}

#warning #btnAcept:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px var(--marron-texto);
    background: var(--verde-oscuro);
}

/* ===================================
   RESPONSIVE
   =================================== */

@media screen and (max-width: 768px) {
    .iniciarSesion {
        width: 95vw;
        flex-direction: column;
        min-height: auto;
        max-height: 90vh;
    }

    .Sesion, .inicioSesion, .crearCuenta, .recuperacion {
        width: 100%;
    }

    .Sesion, .inicioSesion, .recuperacion {
        padding: 3rem 2rem;
    }

    .crearCuenta {
        padding: 2rem 1.5rem;
        max-height: 70vh;
    }

    .cNombre, .cApellidoP, .cApellidoM,
    .cUsuario, .cTelefono, .cContraseña, .cCContraseña,
    .cDia, .cMes, .cAño {
        width: 100%;
        margin-right: 0;
    }

    .ISbtn, .crearCuenta button, .recuperacion button {
        width: 100%;
    }

    .Sesion h1, .inicioSesion h1, .recuperacion h1 {
        font-size: 2rem;
    }

    .crearCuenta h1 {
        font-size: 1.8rem;
    }
}

@media screen and (max-width: 480px) {
    .iniciarSesion {
        width: 98vw;
    }

    .Sesion, .inicioSesion, .recuperacion {
        padding: 2rem 1.5rem;
    }

    .crearCuenta {
        padding: 1.5rem 1rem;
    }

    .Sesion button, .ISbtn, .crearCuenta button, .recuperacion button {
        font-size: 0.9rem;
        height: 50px;
    }
}