
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --azul: #2359d8;
    --oscuro: #14233d;
    --texto: #53627a;
    --fondo: #f5f8fd;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', Arial, sans-serif;
    color: var(--oscuro);
    background: white;
}

a { text-decoration: none; }

.navbar {
    min-height: 86px;
    padding: 18px 6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 3px 20px rgba(25, 45, 85, .06);
}

.logo {
    font-size: 25px;
    font-weight: 800;
    color: var(--azul);
    white-space: nowrap;
}

.menu, .acciones {
    display: flex;
    align-items: center;
    gap: 25px;
}

.menu a {
    color: #46546d;
    font-size: 14px;
    font-weight: 600;
}

.menu a:hover { color: var(--azul); }

.btn-ingresar {
    color: var(--azul);
    font-weight: 700;
    font-size: 14px;
}

.btn-registro, .btn-principal {
    display: inline-block;
    padding: 15px 25px;
    background: var(--azul);
    color: white;
    border-radius: 10px;
    font-weight: 700;
}

.btn-registro { padding: 12px 19px; }

.hero {
    min-height: 610px;
    display: flex;
    align-items: center;
    padding: 90px 8%;
    color: white;
    background:
            linear-gradient(90deg, rgba(8,25,53,.96),
            rgba(15,43,87,.82), rgba(19,51,93,.3)),
            url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?auto=format&fit=crop&w=1800&q=85')
            center/cover;
}

.hero-contenido { max-width: 730px; }

.etiqueta, .subtitulo {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

.etiqueta { color: #9bc0ff; }

.hero h1 {
    font-size: clamp(38px, 5vw, 65px);
    line-height: 1.15;
    margin: 20px 0;
}

.hero h1 span { color: #9ec2ff; }

.hero p {
    color: #e0e8f5;
    font-size: 17px;
    line-height: 1.9;
    max-width: 620px;
}

.hero-botones {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.btn-secundario {
    display: inline-block;
    padding: 15px 25px;
    color: white;
    border: 1px solid #ffffff88;
    border-radius: 10px;
    font-weight: 700;
}

.seccion { padding: 90px 8%; }

.seccion-suave { background: var(--fondo); }

.encabezado {
    max-width: 720px;
    text-align: center;
    margin: 0 auto 45px;
}

.subtitulo { color: var(--azul); }

h2 {
    font-size: clamp(28px, 3vw, 40px);
    margin: 15px 0;
}

.encabezado p, .tarjeta p,
.catalogo-presentacion p, .lectura p, .contacto p {
    color: var(--texto);
    line-height: 1.8;
}

.tarjetas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.tarjeta {
    padding: 35px;
    border: 1px solid #e7edf7;
    border-radius: 18px;
    background: white;
    box-shadow: 0 10px 35px #1b36510a;
}

.icono { font-size: 35px; }

.tarjeta h3 { margin-top: 25px; }

.catalogo-presentacion, .lectura {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    align-items: center;
    gap: 35px;
    padding: 55px;
    background: white;
    border-radius: 22px;
}

.catalogo-presentacion h3 { font-size: 30px; }

.ilustracion, .lectura-icono {
    font-size: 120px;
    text-align: center;
}

.lectura { background: #eef4ff; }

.estado {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #e6efff;
    color: var(--azul);
    font-size: 13px;
    font-weight: 700;
}

.contacto {
    text-align: center;
    background: #f5f8fd;
}

.contacto p {
    max-width: 600px;
    margin: 15px auto 30px;
}

footer {
    padding: 45px 8%;
    text-align: center;
    background: #14233d;
    color: white;
}

footer p, footer small { color: #b5c4dd; }

@media (max-width: 1050px) {
    .navbar { flex-wrap: wrap; }
    .menu { order: 3; width: 100%; justify-content: center; }
}

@media (max-width: 700px) {
    .navbar { padding: 20px; }
    .menu { gap: 13px; flex-wrap: wrap; }
    .menu a { font-size: 12px; }
    .acciones { gap: 12px; }
    .hero { min-height: 530px; padding: 65px 7%; }
    .seccion { padding: 65px 6%; }
    .tarjetas { grid-template-columns: 1fr; }
    .catalogo-presentacion, .lectura {
        grid-template-columns: 1fr;
        padding: 30px;
    }
    .ilustracion, .lectura-icono { font-size: 75px; }
}

.usuario-portal {
    display: flex;
    align-items: center;
    gap: 12px;
}

.foto-usuario,
.avatar-usuario {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dbeafe;
}

.avatar-usuario {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
}

.nombre-usuario {
    font-weight: 600;
    color: #1e293b;
}

.usuario-portal form {
    margin: 0;
}

.btn-cerrar-sesion {
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    border-radius: 8px;
    padding: 11px 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-cerrar-sesion:hover {
    background: #fecaca;
}

@media (max-width: 900px) {
    .usuario-portal {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Menú desplegable de cuenta */

.cuenta-menu {
    position: relative;
}

.cuenta-boton {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    padding: 8px 12px;
    border-radius: 12px;
    transition: background .2s;
}

.cuenta-boton::-webkit-details-marker {
    display: none;
}

.cuenta-boton:hover {
    background: #f1f5ff;
}

.cuenta-flecha {
    font-size: 20px;
    color: #64748b;
}

.cuenta-desplegable {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 220px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e8edf6;
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(15, 35, 70, .14);
    z-index: 1000;
}

.cuenta-desplegable a,
.cuenta-salir {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: left;
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
}

.cuenta-desplegable a {
    color: #243b60;
}

.cuenta-desplegable a:hover {
    background: #f1f5ff;
}

.cuenta-separador {
    height: 1px;
    background: #e8edf6;
    margin: 7px 0;
}

.cuenta-desplegable form {
    margin: 0;
}

.cuenta-salir {
    border: none;
    background: transparent;
    color: #dc2626;
    cursor: pointer;
    font-weight: 600;
}

.cuenta-salir:hover {
    background: #fef2f2;
}

/* Catálogo de libros conectado a SQL Server */

.catalogo-libros {
    max-width: 1200px;
    margin: 40px auto 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.libro-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(20, 40, 80, 0.07);
    transition: transform .25s, box-shadow .25s;
}

.libro-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(20, 40, 80, 0.13);
}

.libro-imagen {
    height: 270px;
    background: #eaf0fb;
    overflow: hidden;
}

.libro-imagen img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.libro-sin-portada {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 65px;
    background: linear-gradient(135deg, #e8efff, #d5e3ff);
}

.libro-informacion {
    padding: 20px;
}

.libro-categoria {
    display: inline-block;
    font-size: 12px;
    color: #2459dc;
    font-weight: 700;
    margin-bottom: 10px;
}

.libro-informacion h3 {
    color: #102b56;
    font-size: 18px;
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.libro-autor {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 15px;
}

.libro-disponible {
    color: #15803d;
    font-size: 13px;
    font-weight: 700;
}

.libro-no-disponible {
    color: #b45309;
    font-size: 13px;
    font-weight: 700;
}

.catalogo-mensaje {
    grid-column: 1 / -1;
    text-align: center;
    padding: 45px;
    background: white;
    border-radius: 14px;
    color: #64748b;
}

@media (max-width: 1000px) {
    .catalogo-libros {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .catalogo-libros {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 450px) {
    .catalogo-libros {
        grid-template-columns: 1fr;
    }
}