/* Login Styles - Basado en el diseño proporcionado pero adaptado a AliPos */

/* Colors - Nueva Paleta ALS POS con toques dorados */
:root {
    --primary-blue: #70798C;
    --secondary-blue: #5a6268;
    --dark-charcoal: #000000;
    --light-beige: #F8F8F8;
    --light-gray: #F5F1ED;
    --white: #FFFFFF;
    --error-red: #E53E3E;
    --gold-accent: #FFD700;
    --gold-bright: #FFD700;
    --gold-light: #FFF8DC;
}

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;500;600;700&display=swap');

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

body {
    background: #70798C;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Animaciones de fondo */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s infinite linear;
    z-index: 0;
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-50px, -50px) rotate(360deg);
    }
}

/* Contenedor principal */
.login-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Formulario de login */
.login {
    overflow: hidden;
    background-color: var(--white);
    padding: 40px 30px 30px 30px;
    border-radius: 15px;
    position: relative;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 300ms ease, box-shadow 300ms ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Efectos de fondo animados */
.login::before,
.login::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-top-left-radius: 40%;
    border-top-right-radius: 45%;
    border-bottom-left-radius: 35%;
    border-bottom-right-radius: 40%;
    z-index: -1;
    opacity: 0.1;
}

.login::before {
    left: 40%;
    bottom: -130%;
    background: #000000;
    animation: waves 6s infinite linear;
}

.login::after {
    left: 35%;
    bottom: -125%;
    background: #FFD700;
    animation: waves 7s infinite;
}

@keyframes waves {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Contenedor del logo con animación */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container.animated-logo {
    position: relative;
}

.logo-animation-wrapper {
    position: relative;
    display: inline-block;
    padding: 20px;
    margin-bottom: 15px;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: wrapperPulse 1s ease-out;
    overflow: visible;
}

.logo-border {
    position: absolute;
    inset: 8px;
    border: 3px solid #FFD700;
    border-radius: 14px;
    opacity: 0;
    transform: rotate(10deg);
    animation: borderReveal 0.8s ease-out 0.3s forwards;
    pointer-events: none;
}

.login-logo {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    transition: transform 300ms ease;
    position: relative;
    z-index: 1;
    display: block;
}

.login-logo.animated {
    animation: logoExpand 1s ease-out 0.4s both, logoGlow 2.5s ease-in-out 1.5s infinite;
    filter: drop-shadow(0 6px 20px rgba(255, 215, 0, 0.4));
}

.logo-trail {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    border-radius: 12px;
    animation: trailEffect 1.2s ease-in-out 0.4s;
}

.login-logo:hover {
    transform: scale(1.08);
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: #FFD700;
    margin-bottom: 8px;
    letter-spacing: 3px;
    text-shadow: 0 3px 15px rgba(255, 215, 0, 0.4);
}

.login-title.animated-text {
    opacity: 0;
    animation: textReveal 0.8s ease-out 0.8s forwards;
}

.login-subtitle {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.login-subtitle.animated-text {
    opacity: 0;
    animation: textReveal 0.8s ease-out 1s forwards;
}

/* Animación del wrapper */
@keyframes wrapperPulse {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Grupo de formulario */
.form-group {
    position: relative;
}

/* Inputs */
.login input {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: block;
    border-radius: 8px;
    font-size: 16px;
    background: var(--white);
    width: 100%;
    border: 2px solid #E8E8E8;
    padding: 15px 20px;
    margin: 15px 0;
    transition: all 300ms ease;
    outline: none;
    color: var(--dark-charcoal);
}

.login input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
}

.login input:hover {
    border-color: #70798C;
    transform: translateY(-1px);
}

.login input::placeholder {
    color: #999;
    font-weight: 400;
}

/* Botón de login */
.login button {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    cursor: pointer;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    border: 0;
    padding: 15px 0;
    margin-top: 20px;
    border-radius: 8px;
    background: #000000;
    transition: all 300ms ease;
    position: relative;
    overflow: hidden;
}

.login button:hover {
    background: #70798C;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

.login button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Efecto de carga en el botón */
.login button.loading {
    position: relative;
    color: transparent;
}

.login button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mensaje de error */
.error-message {
    background: #FEE;
    color: var(--error-red);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    margin-top: 15px;
    border: 1px solid #FCC;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .login {
        margin: 20px;
        padding: 30px 20px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-logo {
        width: 60px;
        height: 60px;
    }
}

/* Efectos adicionales */
.login input:valid {
    border-color: #4CAF50;
}

.login input:invalid:not(:placeholder-shown) {
    border-color: var(--error-red);
}

/* Animación de entrada */
.login {
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== INTRO ANIMATION ==================== */

.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #70798C;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeOutOverlay 0.8s ease-out 3.5s forwards;
}

.intro-overlay.hidden {
    display: none;
}

.intro-card {
    width: 320px;
    height: 220px;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    position: relative;
    display: grid;
    place-content: center;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    animation: cardPulse 3.5s ease-in-out;
}

.intro-border {
    position: absolute;
    inset: 0px;
    border: 2px solid #FFD700;
    border-radius: 16px;
    opacity: 0;
    transform: rotate(10deg);
    animation: borderReveal 0.6s ease-out 0.3s forwards;
}

.intro-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.intro-logo-wrapper {
    position: relative;
    width: 70px;
    height: 70px;
    overflow: hidden;
    animation: logoExpand 1.2s ease-out 0.5s forwards;
}

.intro-logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 4px 15px rgba(255, 215, 0, 0.3));
    animation: logoGlow 2s ease-in-out infinite;
}

.intro-trail {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    animation: trailEffect 1.2s ease-in-out 0.5s;
}

.intro-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 0;
    animation: textReveal 0.8s ease-out 1s forwards;
}

.intro-title {
    font-size: 32px;
    font-weight: 700;
    color: #FFD700;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.intro-subtitle {
    font-size: 13px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 400;
}

/* Intro Animations */
@keyframes fadeOutOverlay {
    0% {
        opacity: 1;
        visibility: visible;
    }

    100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@keyframes cardPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    15% {
        transform: scale(1.02);
        opacity: 1;
    }

    25% {
        transform: scale(1);
    }

    85% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

@keyframes borderReveal {
    0% {
        inset: 0px;
        opacity: 0;
        transform: rotate(10deg);
    }

    100% {
        inset: 12px;
        opacity: 1;
        transform: rotate(0deg);
    }
}

@keyframes logoExpand {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes logoGlow {

    0%,
    100% {
        filter: drop-shadow(0 4px 15px rgba(255, 215, 0, 0.3));
    }

    50% {
        filter: drop-shadow(0 4px 25px rgba(255, 215, 0, 0.6));
    }
}

@keyframes trailEffect {
    0% {
        background: linear-gradient(90deg, rgba(255, 215, 0, 0) 90%, rgba(255, 215, 0, 1) 100%);
        opacity: 0;
    }

    30% {
        background: linear-gradient(90deg, rgba(255, 215, 0, 0) 70%, rgba(255, 215, 0, 1) 100%);
        opacity: 1;
    }

    70% {
        background: linear-gradient(90deg, rgba(255, 215, 0, 0) 70%, rgba(255, 215, 0, 1) 100%);
        opacity: 1;
    }

    100% {
        background: linear-gradient(90deg, rgba(255, 215, 0, 0) 90%, rgba(255, 215, 0, 1) 100%);
        opacity: 0;
    }
}

@keyframes textReveal {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginReveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}