/**
 * Portadas de inicio de sesión: fondo fotográfico + velo + panel cristal.
 * Modificadores: .auth-shell--travel (usuarios), .auth-shell--hotel (portal hotelero), .auth-shell--command (super admin)
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #0f172a;
}

.auth-body *,
.auth-body *::before,
.auth-body *::after {
    box-sizing: border-box;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 32px);
    overflow-x: hidden;
}

.auth-shell__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #0f172a;
    background-image: var(--auth-bg-image);
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
}

.auth-shell__veil {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: var(--auth-veil);
    pointer-events: none;
}

.auth-shell__content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Variante: usuarios / viajes */
.auth-shell--travel {
    --auth-bg-image: url('https://images.unsplash.com/photo-1436491865332-7a61a109cc05?auto=format&fit=crop&w=1920&q=80');
    --auth-veil: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.88) 0%,
        rgba(30, 64, 175, 0.6) 45%,
        rgba(13, 148, 136, 0.5) 100%
    );
    --auth-accent: #0d9488;
    --auth-accent-2: #2563eb;
    --auth-glass-border: rgba(255, 255, 255, 0.38);
    --auth-glass-bg: rgba(255, 255, 255, 0.82);
}

/* Variante: portal hotelero */
.auth-shell--hotel {
    --auth-bg-image: url('https://images.unsplash.com/photo-1566073771259-6a8506099945?auto=format&fit=crop&w=1920&q=80');
    /* Velo tipo “noche”: coherente con login Super Admin, foto de hotel visible */
    --auth-veil: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.88) 0%,
        rgba(15, 23, 42, 0.82) 45%,
        rgba(30, 64, 175, 0.52) 100%
    );
    --auth-accent: #2563eb;
    --auth-accent-2: #1d4ed8;
    --auth-glass-border: rgba(255, 255, 255, 0.35);
    --auth-glass-bg: rgba(255, 255, 255, 0.88);
}

/* Variante: super admin / control — oficina / equipo remoto (evita interiores tipo cocina) */
.auth-shell--command {
    --auth-bg-image: url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=1920&q=80');
    --auth-veil: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.9) 0%,
        rgba(30, 41, 59, 0.82) 42%,
        rgba(37, 99, 235, 0.38) 100%
    );
    --auth-accent: #2563eb;
    --auth-accent-2: #1e40af;
    --auth-glass-border: rgba(255, 255, 255, 0.32);
    --auth-glass-bg: rgba(255, 255, 255, 0.86);
}

/* Tarjeta única (login público y super admin) */
.auth-shell .login-container.auth-card {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(28px, 4vw, 40px);
    text-align: center;
    border-radius: 20px;
    background: var(--auth-glass-bg);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--auth-glass-border);
    box-shadow:
        0 4px 24px rgba(15, 23, 42, 0.12),
        0 24px 80px rgba(15, 23, 42, 0.25);
    animation: authFadeUp 0.65s ease-out;
}

.auth-shell .login-container.auth-card .logo img {
    max-height: 52px;
    width: auto;
    object-fit: contain;
}

.auth-shell .login-container.auth-card h2 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(1.35rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.auth-shell .auth-card__subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 22px;
    line-height: 1.45;
}

.auth-shell .login-container.auth-card .form-group {
    margin-bottom: 18px;
    text-align: left;
}

.auth-shell .login-container.auth-card label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 6px;
    color: #334155;
}

.auth-shell .login-container.auth-card input[type='email'],
.auth-shell .login-container.auth-card input[type='password'],
.auth-shell .login-container.auth-card input[type='text'],
.auth-shell .login-container.auth-card input[type='tel'],
.auth-shell .login-container.auth-card select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.55);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.75);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-shell .login-container.auth-card select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.auth-shell .login-container.auth-card .form-group label:has(input[type='checkbox']) {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    color: #334155;
    cursor: pointer;
    margin-bottom: 0;
}

.auth-shell .login-container.auth-card .form-group label:has(input[type='checkbox']) input[type='checkbox'] {
    width: auto;
    margin: 3px 0 0;
    flex-shrink: 0;
    accent-color: var(--auth-accent);
}

.auth-shell .login-container.auth-card .auth-field-reveal {
    margin-top: 10px;
}

.auth-shell .auth-callout {
    text-align: left;
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.45;
    background: rgba(241, 245, 249, 0.95);
    border: 1px solid #e2e8f0;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.auth-shell .login-container.auth-card input:focus,
.auth-shell .login-container.auth-card select:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-shell--travel .login-container.auth-card input:focus,
.auth-shell--travel .login-container.auth-card select:focus {
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.auth-shell .login-container.auth-card button[type='submit'] {
    width: 100%;
    margin-top: 8px;
    padding: 14px 18px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--auth-accent) 0%, var(--auth-accent-2) 100%);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-shell .login-container.auth-card button[type='submit']:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.28);
}

.auth-shell .login-container.auth-card > p:not(.auth-card__subtitle) {
    margin-top: 20px;
    font-size: 0.88rem;
    color: #475569;
}

.auth-shell .login-container.auth-card a {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-shell .login-container.auth-card a:hover {
    text-decoration: underline;
}

.auth-shell .message {
    color: #047857;
    background: rgba(209, 250, 229, 0.95);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.auth-shell .error,
.auth-shell .message.error {
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.95);
    border: 1px solid rgba(248, 113, 113, 0.45);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    text-align: left;
}

.auth-shell .login-container.auth-card .error i {
    margin-right: 6px;
    opacity: 0.9;
}

/* Portal hoteleros: misma tarjeta blanca + logo que Super Admin, inputs suaves azul hielo */
.auth-shell--hotel .login-container.auth-card.auth-card--hotel {
    max-width: 440px;
    border-radius: 28px;
    padding: clamp(36px, 5vw, 44px);
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 4px 24px rgba(15, 23, 42, 0.1),
        0 32px 72px rgba(15, 23, 42, 0.2);
}

.auth-shell--hotel .login-container.auth-card.auth-card--hotel .logo img {
    max-height: 56px;
}

.auth-shell--hotel .login-container.auth-card.auth-card--hotel input[type='email'],
.auth-shell--hotel .login-container.auth-card.auth-card--hotel input[type='password'],
.auth-shell--hotel .login-container.auth-card.auth-card--hotel input[type='text'],
.auth-shell--hotel .login-container.auth-card.auth-card--hotel select {
    background: #eff6ff;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 10px;
}

.auth-shell--hotel .login-container.auth-card.auth-card--hotel input:focus,
.auth-shell--hotel .login-container.auth-card.auth-card--hotel select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.auth-shell--hotel .login-container.auth-card.auth-card--hotel button[type='submit'] {
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
}

.auth-shell--hotel .login-container.auth-card.auth-card--hotel button[type='submit']:hover {
    box-shadow: 0 14px 36px rgba(29, 78, 216, 0.4);
}

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

@media (prefers-reduced-motion: reduce) {
    .auth-shell .login-container.auth-card {
        animation: none;
    }
    .auth-shell .login-container.auth-card button[type='submit']:hover {
        transform: none;
    }
}

/* —— Portal hotelero: dos columnas (solo si no es .auth-card) —— */
.auth-shell--hotel .login-container:not(.auth-card) {
    max-width: 920px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    border: 1px solid var(--auth-glass-border);
    box-shadow:
        0 4px 30px rgba(15, 23, 42, 0.15),
        0 28px 90px rgba(15, 23, 42, 0.35);
    animation: authFadeUp 0.65s ease-out;
}

.auth-shell--hotel .login-left {
    padding: clamp(40px, 5vw, 64px) clamp(32px, 4vw, 48px);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(
        165deg,
        rgba(255, 255, 255, 0.14) 0%,
        rgba(255, 255, 255, 0.06) 100%
    );
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-shell--hotel .login-left h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    margin: 0 0 16px;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.auth-shell--hotel .login-left p {
    font-size: 1rem;
    line-height: 1.65;
    opacity: 0.95;
    margin: 0;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.auth-shell--hotel .login-left .login-left__icon {
    font-size: clamp(4rem, 12vw, 7rem);
    opacity: 0.22;
    margin-top: 36px;
    align-self: flex-start;
}

.auth-shell--hotel .login-right {
    padding: clamp(40px, 5vw, 56px) clamp(32px, 4vw, 48px);
    background: var(--auth-glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.auth-shell--hotel .login-right h2 {
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
}

.auth-shell--hotel .login-right > p {
    color: #64748b;
    margin: 0 0 24px;
    font-size: 0.95rem;
}

.auth-shell--hotel .form-group label {
    color: #334155;
}

.auth-shell--hotel .form-group input {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.55);
}

.auth-shell--hotel .form-group input:focus {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-shell--hotel .btn-login {
    background: linear-gradient(135deg, #2563eb 0%, #0d9488 100%);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.3);
}

.auth-shell--hotel .btn-login:hover {
    box-shadow: 0 12px 36px rgba(13, 148, 136, 0.35);
}

.auth-shell--hotel .forgot-password a {
    color: #2563eb;
}

.auth-shell--hotel .error-message {
    background: rgba(254, 226, 226, 0.95);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #991b1b;
}

@media (max-width: 768px) {
    .auth-shell--hotel .login-container:not(.auth-card) {
        grid-template-columns: 1fr;
    }

    .auth-shell--hotel .login-left {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        padding: 28px 24px;
        text-align: center;
    }

    .auth-shell--hotel .login-left .login-left__icon {
        display: none;
    }
}
