@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0b10;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --primary-glow: #6366f1;
    --secondary-glow: #a855f7;
    --glass-bg: rgba(17, 25, 40, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto; /* Permitir scroll vertical para que nunca se recorte el login */
    position: relative;
}

/* --- Layout: imagen de fondo a sangre completa + login a la derecha --- */
.auth-layout {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: 100vh;            /* Altura exacta del viewport: sin scroll vertical en PC */
    overflow: hidden;          /* Evita que la imagen empuje el contenido hacia abajo */
}

/* Imagen comercial como fondo que ocupa TODA la pantalla (no solo la mitad izquierda) */
.brand-panel {
    grid-column: 1 / -1; /* cubre todo el ancho */
    grid-row: 1;
    z-index: 1;
    padding: 0;
    overflow: hidden;
}

.brand-logo {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    object-position: center;
    display: block;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Login superpuesto en la mitad derecha, encima de la imagen */
.login-panel {
    grid-column: 2; /* se mantiene a la derecha */
    grid-row: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 60px 40px 370px;
    /* Sin fondo propio: la imagen comercial se ve completa, solo el login encima */
    background: transparent;
}

/* Responsive: en pantallas angostas la imagen cubre todo el fondo
   y el login queda superpuesto encima (igual que en PC) */
@media (max-width: 768px) {
    .auth-layout {
        grid-template-columns: 1fr;
        height: auto;            /* permitir que crezca si el login no cabe */
        min-height: 100vh;
        overflow: visible;       /* permitir scroll en pantallas pequeñas */
    }
    .brand-panel {
        grid-column: 1 / -1; /* cubre todo el ancho */
        grid-row: 1;
        max-height: none;
        overflow: hidden;
    }
    .brand-logo {
        width: 100%;
        height: 100vh; /* ocupa toda la altura de la pantalla */
        object-fit: cover;
        object-position: center;
    }
    /* El formulario se superpone centrado encima de la imagen */
    .login-panel {
        grid-column: 1;
        grid-row: 1;
        align-items: center;
        justify-content: center;
        padding: 28px 24px;
        z-index: 2;
    }
}

/* Background Animated Glow Blobs */
.glow-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.45;
    animation: float 20s infinite alternate;
}

.blob-1 {
    width: 450px;
    height: 450px;
    background: var(--primary-glow);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary-glow);
    bottom: -15%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(80px, 50px) scale(1.1);
    }
    100% {
        transform: translate(-40px, -60px) scale(0.95);
    }
}

/* Glassmorphism Container (fondo transparente: el logo y el formulario flotan sobre el fondo animado) */
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
    background: transparent;
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Styles */
.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    max-width: 170px;
    width: auto;
    height: auto;
    max-height: 115px;
    object-fit: contain;
    display: block;
    margin: 0 auto 14px;
}

.login-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Form inputs & styles */
.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 46px 14px 16px; /* Espacio de seguridad para el botón del ojo */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-password-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.3s, transform 0.2s;
    user-select: none;
    z-index: 10;
}

.toggle-password-btn:hover {
    color: var(--text-primary);
    transform: scale(1.08);
}

.toggle-password-btn:active {
    transform: scale(0.95);
}

.input-wrapper input:focus {
    border-color: var(--primary-glow);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.input-group:focus-within label {
    color: #a5b4fc;
}

/* Button design */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-glow) 0%, var(--secondary-glow) 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.25);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.submit-btn:active {
    transform: translateY(1px);
}

.submit-btn:disabled {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.65;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Toast Notification Dropdown (Deslizamiento desde arriba) */
.toast-container {
    position: fixed;
    top: -100px; /* Oculto arriba de la pantalla */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.toast-container.show {
    top: 30px;
    opacity: 1;
}

.toast {
    padding: 16px 28px;
    border-radius: 16px;
    background: rgba(20, 24, 33, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
}

.toast.success {
    box-shadow: 0 0 25px rgba(52, 211, 153, 0.15), 0 15px 35px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #34d399;
}

.toast.error {
    box-shadow: 0 0 25px rgba(248, 113, 113, 0.15), 0 15px 35px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #f87171;
}

.toast.loading {
    box-shadow: 0 0 25px rgba(96, 165, 250, 0.15), 0 15px 35px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #60a5fa;
}
