/* ============================================================
   login.css
   Pantalla de login de Luna Publicidad.
   Lenguaje visual consistente con index.jsp (landing glassmorphism).
   Paleta basada en luna-modules.css (--luna-primary: #4152A1).
   ============================================================ */

:root {
    --luna-primary: #4152A1;
    --luna-primary-dark: #343F7A;
    --luna-primary-light: #5A6BBF;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1628 0%, #1a2d50 30%, #2a4a7f 60%, #3b6cb5 100%);
    overflow: hidden;
    position: relative;
    color: #fff;
}

/* Fondo animado */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 80%, rgba(59, 108, 181, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(100, 149, 237, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
    animation: loginBgShift 20s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes loginBgShift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, 5%) rotate(3deg); }
}

/* Orbs flotantes */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #4a7ec7, transparent);
    top: -100px;
    right: -100px;
    animation: floatOrb1 15s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #2a5298, transparent);
    bottom: -80px;
    left: -80px;
    animation: floatOrb2 18s ease-in-out infinite;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #6495ed, transparent);
    top: 50%;
    left: 60%;
    animation: floatOrb3 12s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-40px, 40px); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(30px, -30px); }
}

@keyframes floatOrb3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-20px, 20px) scale(1.1); }
}

/* Marca en la esquina (watermark) */
.brand-corner {
    position: fixed;
    left: 28px;
    bottom: 24px;
    z-index: 2;
    display: inline-block;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    text-decoration: none;
}

.brand-corner:hover,
.brand-corner:focus {
    opacity: 0.9;
    transform: translateY(-1px);
    outline: none;
}

.brand-corner img {
    display: block;
    width: 100px;
    height: auto;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35));
}

@media (max-width: 480px) {
    .brand-corner {
        left: 16px;
        bottom: 14px;
    }
    .brand-corner img {
        width: 80px;
    }
}

/* Shell */
.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    animation: loginFadeIn 0.9s ease-out;
}

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

/* Glass card */
.login-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 2.5rem 2.25rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-align: center;
}

/* Logo */
.login-logo-wrapper {
    margin-bottom: 1.25rem;
    position: relative;
    display: inline-block;
}

.login-logo-wrapper::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    border-radius: 2px;
}

.login-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 4px 18px rgba(59, 108, 181, 0.45));
    animation: loginLogoPulse 4s ease-in-out infinite;
}

@keyframes loginLogoPulse {
    0%, 100% { filter: drop-shadow(0 4px 18px rgba(59, 108, 181, 0.45)); }
    50%      { filter: drop-shadow(0 4px 28px rgba(100, 149, 237, 0.65)); }
}

/* Textos */
.login-title {
    color: #fff;
    font-size: 1.35rem;
    font-weight: 600;
    margin: 1.25rem 0 0.35rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    font-weight: 300;
    margin-bottom: 1.75rem;
}

/* Alerta de error */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    background: rgba(231, 76, 60, 0.14);
    border: 1px solid rgba(231, 76, 60, 0.35);
    color: #ffd4cf;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(8px);
}

.login-alert i {
    font-size: 15px;
    margin-top: 1px;
    color: #ff8e82;
    flex-shrink: 0;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.login-field {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field-icon {
    position: absolute;
    left: 16px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.55);
    pointer-events: none;
    z-index: 2;
}

.login-input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    appearance: none;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 300;
}

.login-input:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.22);
}

.login-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(144, 170, 236, 0.55);
    box-shadow: 0 0 0 3px rgba(144, 170, 236, 0.18);
}

/* Autofill amigable con el tema oscuro */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px rgba(32, 50, 88, 0.95) inset;
    caret-color: #fff;
    transition: background-color 5000s ease-in-out 0s;
}

/* Botón mostrar/ocultar contraseña */
.login-toggle-password {
    position: absolute;
    right: 10px;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.55);
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    z-index: 2;
}

.login-toggle-password:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.login-toggle-password:focus {
    outline: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.10);
}

.login-field:has(.login-toggle-password) .login-input {
    padding-right: 52px;
}

/* Submit */
.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #4a7ec7 0%, #3b6cb5 50%, #2a5298 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow:
        0 4px 16px rgba(42, 82, 152, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transition: left 0.55s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 28px rgba(42, 82, 152, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    background: linear-gradient(135deg, #5a8ed7 0%, #4a7ec7 50%, #3b6cb5 100%);
}

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

.login-btn i {
    transition: transform 0.25s ease;
    font-size: 16px;
}

.login-btn:hover i {
    transform: translateX(4px);
}

/* Footer link */
.login-footer {
    margin-top: 1.75rem;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.82rem;
    font-weight: 300;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.25s ease;
}

.login-footer a:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive */
@media (max-width: 480px) {
    .login-shell {
        padding: 1rem;
    }
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 22px;
    }
    .login-logo {
        width: 90px;
        height: 90px;
    }
    .login-title {
        font-size: 1.2rem;
    }
    .login-btn {
        padding: 13px 20px;
        font-size: 0.95rem;
    }
}
