/* ===================================
   LOGIN - ESTILO GARRIDO LICONA
   Diseño oscuro profesional con acentos rojos
   =================================== */

/* === VARIABLES === */
:root {
    /* Colores principales - Rojo Garrido Licona */
    --primary-color: #e31e24;
    --primary-dark: #b91c1c;
    --primary-light: #ef4444;

    /* Fondos oscuros */
    --bg-dark: #1a1a1a;
    --bg-darker: #0f0f0f;
    --bg-card: #2a2a2a;
    --bg-card-light: #333333;

    /* Textos */
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Bordes y divisores */
    --border-color: #404040;
    --border-focus: #e31e24;

    /* Estados */
    --error-color: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --success-color: #10b981;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    --shadow-red: 0 10px 30px -5px rgba(227, 30, 36, 0.3);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}



/* === WRAPPER PRINCIPAL === */
.login-wrapper {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === CONTENEDOR PRINCIPAL === */
.login-container {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

/* Borde superior rojo - marca Garrido Licona */
.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary-color);
    box-shadow: 0 2px 8px rgba(227, 30, 36, 0.5);
}

/* === HEADER === */
.login-header {
    text-align: center;
    padding: 48px 40px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.login-logo {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.login-logo i {
    font-size: 36px;
    color: var(--primary-color);
}

.login-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* === CONTENIDO === */
.login-content {
    padding: 40px;
}

/* === FORMULARIO === */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* === FORM GROUP === */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.2px;
}

.form-label i {
    font-size: 14px;
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

/* === INPUTS === */
.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:hover {
    border-color: #505050;
    background: var(--bg-darker);
}

.form-input:focus {
    border-color: var(--border-focus);
    background: var(--bg-darker);
    box-shadow: 0 0 0 4px rgba(227, 30, 36, 0.15);
}

.form-input.error {
    border-color: var(--error-color);
    background: var(--error-bg);
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

/* === PASSWORD WRAPPER === */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    background: var(--bg-card-light);
    color: var(--primary-color);
}

.password-toggle i {
    font-size: 16px;
}

/* === ERROR MESSAGE === */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #fca5a5;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 6px;
    border-left: 3px solid var(--error-color);
}

.error-message i {
    font-size: 14px;
    color: var(--error-color);
}

/* === BOTONES === */
.btn {
    position: relative;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-red);
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px rgba(227, 30, 36, 0.5);
    background: linear-gradient(135deg, #f72529 0%, var(--primary-color) 100%);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-red);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === LOADING STATE === */
.btn.loading .btn-text {
    opacity: 0;
}

.btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    position: absolute;
}

.btn.loading .spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .login-wrapper {
        max-width: 100%;
    }

    .login-header {
        padding: 36px 24px 24px;
    }

    .login-logo {
        font-size: 28px;
    }

    .login-logo i {
        font-size: 32px;
    }

    .login-content {
        padding: 32px 24px;
    }

    .form-input {
        font-size: 16px;
        /* Previene zoom en iOS */
    }
}

@media (max-width: 400px) {
    .login-header {
        padding: 28px 20px 20px;
    }

    .login-logo {
        font-size: 24px;
        gap: 8px;
    }

    .login-logo i {
        font-size: 28px;
    }

    .login-content {
        padding: 28px 20px;
    }
}

/* === ACCESIBILIDAD === */
.btn:focus-visible,
.form-input:focus-visible,
.password-toggle:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === MODO OSCURO === */
/* Tema oscuro por defecto - estilo Garrido Licona */

/* === FONDO CON CUADROS Y BURBUJAS === */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-image: url('fondo-login.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}



/* === CUADROS ROJOS FLOTANTES === */



/* Responsive - Reducir elementos en móviles */
/* Reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}