/* =========================================
   LOGIN PAGE - RASTRO RIPOLLET
   ========================================= */

:root {
    --login-aside-w: 48%; /* Ampliado según sugerencia para equilibrar el espacio */
    --login-bg: #ffffff; /* Blanco puro para fundirse con login.png y eliminar franjas */
    --login-text: #1e293b;
    --login-accent: #2563eb;
    --login-google-border: #e2e8f0;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
}

.login-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* --- ASIDE (Izquierda - Imagen Branding) --- */
.login-aside {
    position: relative;
    width: var(--login-aside-w);
    height: 100%;
    background-image: url('../media/login.webp');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Texto abajo como solicitado */
    padding: 60px;
    color: #fff;
    overflow: hidden;
}

.aside-content {
    position: relative;
    z-index: 2;
    max-width: 420px;
}

.aside-logo img {
    height: 60px;
    margin-bottom: 30px;
    filter: brightness(0) invert(1);
    /* Logo blanco */
    display: block;
}

.aside-text h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.aside-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
    font-weight: 400;
}

.aside-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
}

/* --- MAIN (Derecha - Login Form) --- */
.login-main {
    flex: 1;
    height: 100%;
    background-color: var(--login-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 40px;
}

.login-header-mobile {
    display: none;
    text-align: center;
    margin-bottom: 40px;
}

.login-header-mobile img {
    height: 48px;
}

.login-card-container {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    position: relative;
    z-index: 10;
}

.login-content {
    margin-top: auto;
    margin-bottom: auto;
    background: #fff;
    padding: 48px;
    border-radius: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    text-align: center;
}

.login-intro {
    font-size: 1.05rem;
    color: #64748b;
    margin-bottom: 40px;
    line-height: 1.5;
    text-align: center;
}

/* Métodos de Auth */
.auth-methods {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    color: #2D3748;
    border: 1px solid var(--login-google-border);
    padding: 16px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

@media (hover: hover) {
    .btn-google:hover {
        background: #fdfdfd;
        border-color: #cbd5e1;
        transform: translateY(-2px);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    }
}

.btn-google svg {
    flex-shrink: 0;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: #94a3b8;
    font-size: 14px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #e2e8f0;
}

.login-divider span {
    padding: 0 16px;
}

.btn-guest {
    display: block;
    text-align: center;
    text-decoration: none;
    color: #4b5563;
    font-size: 15px;
    font-weight: 500;
    padding: 14px;
    border-radius: 16px;
    background: #f1f5f9;
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .btn-guest:hover {
        background: #e2e8f0;
        color: #1f2937;
    }
}

/* FOOTER REDISEÑADO (Glassmorphism para Legibilidad) */
.login-footer {
    padding: 24px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5); /* Capa cristalina */
    backdrop-filter: blur(10px); /* Desenfoque de los iconos de fondo */
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 11;
    position: relative;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}

.footer-links a {
    text-decoration: none;
    color: #475569; /* Gris oscuro para contraste real */
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

@media (hover: hover) {
    .footer-links a:hover {
        color: #1e293b;
        transform: translateY(-1px);
    }
}

.copyright {
    color: #64748b; /* Texto legible */
    font-size: 11px;
    margin: 0;
    opacity: 0.8;
}

/* --- DECORATIONS (Sistema Grid Anti-Solapamientos) --- */
.login-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;

    /* Grid de Seguridad: 8 columnas x 7 filas = 56 celdas únicas */
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 10px;
    padding: 10px;
}

/* Capa de Viñeta Blanca (Suavizado de bordes) */
.login-decorations::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 30%, #ffffff 100%);
    pointer-events: none;
    z-index: 1;
}

.decor-icon {
    /* El Grid maneja la posición, quitamos absolute */
    position: relative;
    opacity: 0.05; 
    filter: grayscale(1);
    pointer-events: none;
    user-select: none;
    z-index: 0;
    transition: transform 0.3s ease;
    
    /* Centrado perfecto en cada celda */
    margin: auto;
    width: 6.5vmin; /* Tamaño controlado para evitar que toquen los bordes de la celda */
    max-width: 80px;
}

/* Toque Orgánico (Variaciones sin riesgo de solapamiento) */
.decor-icon:nth-child(2n) { transform: rotate(12deg) translate(3px, 3px); }
.decor-icon:nth-child(3n) { transform: rotate(-15deg) translate(-5px, 2px); }
.decor-icon:nth-child(4n) { transform: rotate(20deg) scale(1.1); }
.decor-icon:nth-child(5n) { transform: rotate(-10deg) translate(2px, -4px); }
.decor-icon:nth-child(7n) { transform: rotate(8deg) scale(0.9); }
.decor-icon:nth-child(11n) { transform: rotate(-25deg); }

@media (max-width: 900px) {
    .login-decorations { 
        display: grid; /* Activado para móvil */
        grid-template-columns: repeat(4, 1fr); /* 4 col x 14 filas = 56 slots */
        grid-template-rows: repeat(14, 1fr);
        gap: 5px;
    }

    .decor-icon {
        width: 10vw; /* Tamaño optimizado para pantallas pequeñas */
        opacity: 0.12; /* Aumentada visibilidad para que se aprecien bien los doodles */
    }

    /* Ajuste de iluminación: Elipse para cubrir el alto de la pantalla móvil de forma uniforme */
    .login-decorations::after {
        background: radial-gradient(ellipse at center, transparent 20%, #ffffff 90%);
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    :root {
        --login-aside-w: 35%;
    }

    .aside-text h1 {
        font-size: 2.2rem;
    }
}

@media (orientation: portrait) and (min-width: 901px) {
    body, html { overflow-y: auto; height: auto; }
    .login-wrapper { flex-direction: column; height: auto; min-height: 100vh; }
    .login-aside { width: 100%; height: 38vh; padding: 40px; }
    .aside-content { max-width: 100%; text-align: center; display: flex; flex-direction: column; align-items: center; }
    .aside-text h1 { font-size: 2.2rem; }
    .login-main { flex: 1; width: 100%; padding: 60px 20px; display: flex; flex-direction: column; justify-content: center; position: relative; }
    .login-card-container { width: 100%; height: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; }
}

@media (max-width: 900px) {

    body,
    html {
        overflow: auto;
        height: auto;
    }

    .login-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .login-aside {
        display: none;
        /* Quitamos la imagen, logo y texto en móvil como solicitado */
    }

    .login-header-mobile {
        display: none;
    }

    .aside-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .aside-text {
        display: block;
        /* Ahora mostramos el título en móvil para mejorar branding */
    }

    .aside-text h1 {
        font-size: 1.6rem;
        margin-bottom: 0;
    }

    .aside-text p {
        display: none;
        /* Seguimos ocultando el párrafo para ahorrar espacio */
    }

    .aside-logo img {
        height: 45px;
        margin-bottom: 20px;
    }

    .login-main {
        flex: 1;
        width: 100%;
        padding: 40px 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        position: relative;
    }

    .login-content {
        padding: 40px 24px;
        border-radius: 28px;
        margin-top: 0;
    }

    .login-card-container {
        max-width: 100%;
    }
}