/* =============================================
   LOGIN — REDISEÑO SPLIT SCREEN
   ============================================= */

.auth-page {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    background: #0b0f1f;
}

.auth-page::before { display: none; }

.auth-split {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* =============================================
   HERO (izquierda)
   ============================================= */

.auth-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 56px;
    color: #fff;
    isolation: isolate;
    background: linear-gradient(135deg, #0f1633 0%, #1a1a2e 40%, #0f3460 100%);
}

/* Slot para la foto de fondo.
   Coloca tu imagen en: assets/images/login-hero.jpg
   Recomendado: 1200x1600px vertical, estilo almacén moderno,
   iluminación oscura con tonos azul/neón. Si no existe, el fondo
   de gradiente se muestra igual sin romper nada. */
.auth-hero__media {
    position: absolute;
    inset: 0;
    background-image: url('../assets/images/login-hero.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    z-index: -2;
    animation: heroZoom 20s ease-in-out infinite alternate;
}

.auth-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.55) 0%, transparent 45%),
        radial-gradient(circle at 80% 75%, rgba(118, 75, 162, 0.55) 0%, transparent 45%),
        linear-gradient(180deg, rgba(10, 14, 31, 0.55) 0%, rgba(10, 14, 31, 0.85) 100%);
    z-index: -1;
    pointer-events: none;
}

/* Cuadrícula tech sutil */
.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
            mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    z-index: -1;
    pointer-events: none;
}

@keyframes heroZoom {
    0%   { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.08) translate(-1%, -1%); }
}

/* Formas flotantes decorativas */
.auth-hero__shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.auth-hero__shapes .shape {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: floatShape 14s ease-in-out infinite;
}

.shape--1 { width: 280px; height: 280px; top: -60px;  left: -60px;  background: rgba(102, 126, 234, 0.7); }
.shape--2 { width: 220px; height: 220px; bottom: 10%; right: -40px; background: rgba(118, 75, 162, 0.6); animation-delay: -3s; }
.shape--3 { width: 180px; height: 180px; top: 40%;    left: 30%;    background: rgba(78, 205, 196, 0.4); animation-delay: -7s; }
.shape--4 { width: 140px; height: 140px; bottom: 20%; left: 10%;    background: rgba(255, 107, 107, 0.3); animation-delay: -10s; }

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -20px) scale(1.1); }
    66%      { transform: translate(-20px, 25px) scale(0.95); }
}

.auth-hero__content {
    position: relative;
    z-index: 2;
    max-width: 520px;
    animation: heroFadeUp 0.9s ease-out;
}

@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-hero__logo {
    width: 90px;
    height: auto;
    margin-bottom: 40px;
    filter: drop-shadow(0 10px 30px rgba(102, 126, 234, 0.5));
}

.auth-hero__title {
    font-size: 46px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.auth-hero__title span {
    display: block;
    background: linear-gradient(135deg, #66bcea 0%, #a98ce8 60%, #ff9ec6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-hero__subtitle {
    font-size: 17px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 36px;
    max-width: 440px;
}

.auth-hero__features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}

.auth-hero__features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.auth-hero__features svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    padding: 6px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: #8ab4ff;
}

.auth-hero__footer {
    position: relative;
    z-index: 2;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
}

/* =============================================
   FORM (derecha)
   ============================================= */

.auth-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background:
        radial-gradient(circle at 100% 0%, rgba(102, 126, 234, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(118, 75, 162, 0.08) 0%, transparent 40%),
        #0b0f1f;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: cardFadeUp 0.7s 0.15s ease-out backwards;
    position: relative;
    overflow: hidden;
}

/* Glow que sigue al cursor */
.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        600px circle at var(--mx, 50%) var(--my, 50%),
        rgba(102, 126, 234, 0.15),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.auth-card:hover::before { opacity: 1; }

@keyframes cardFadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-card__header {
    margin-bottom: 32px;
    text-align: left;
    position: relative;
    z-index: 1;
}

.auth-card__header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.auth-card__header p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.auth-form {
    display: grid;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.auth-field__control {
    position: relative;
}

.auth-field__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 2;
    transition: color 0.25s;
}

.auth-field__icon svg { width: 100%; height: 100%; }

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 14px 44px;
    font-size: 15px;
    border-radius: 12px;
}

.auth-field__control:focus-within .auth-field__icon {
    color: rgba(102, 126, 234, 0.95);
}

.auth-field__toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    transition: all 0.2s;
    z-index: 2;
}

.auth-field__toggle:hover {
    color: rgba(102, 126, 234, 1);
    background: rgba(102, 126, 234, 0.08);
}

.auth-field__toggle svg { width: 18px; height: 18px; }

.auth-field__toggle .icon-eye-off { display: none; }
.auth-field__toggle.is-visible .icon-eye { display: none; }
.auth-field__toggle.is-visible .icon-eye-off { display: block; }

/* Alerta de error */
.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 80, 100, 0.12);
    border: 1px solid rgba(255, 80, 100, 0.35);
    color: #ffb3bd;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.4s;
}

.auth-alert[hidden] { display: none; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Botón */
.auth-btn {
    position: relative;
    width: 100%;
    padding: 15px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow:
        0 10px 30px rgba(102, 126, 234, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.2s, box-shadow 0.25s;
    margin-top: 4px;
}

.auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #7b8fff 0%, #8e5dbd 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.auth-btn > * { position: relative; z-index: 1; }

.auth-btn:hover::before { opacity: 1; }

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 40px rgba(102, 126, 234, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.auth-btn:active { transform: translateY(0); }

.auth-btn__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    margin-left: 10px;
    vertical-align: middle;
    animation: spin 0.7s linear infinite;
}

.auth-btn.is-loading { pointer-events: none; opacity: 0.9; }
.auth-btn.is-loading .auth-btn__spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 960px) {
    .auth-page { overflow: auto; }
    .auth-split {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    .auth-hero {
        padding: 36px 28px;
        min-height: 340px;
    }
    .auth-hero__logo { margin-bottom: 24px; width: 70px; }
    .auth-hero__title { font-size: 32px; }
    .auth-hero__subtitle { font-size: 15px; margin-bottom: 20px; }
    .auth-hero__features { display: none; }
    .auth-hero__footer { display: none; }

    .auth-form-wrap { padding: 28px 20px; }
    .auth-card { padding: 32px 26px; border-radius: 20px; }
}

@media (max-width: 480px) {
    .auth-hero { padding: 28px 20px; min-height: 260px; }
    .auth-hero__title { font-size: 26px; }
    .auth-card__header h2 { font-size: 24px; }
}
