/* ====================================================================
   IMPULSAVET - LOGIN MODERNO
   Hospital Veterinario Alfa Animal
   Archivo: login-modern.css
   ==================================================================== */

/* Variables de colores Alfa Animal */
:root {
    --alfa-primary: #ff6b35;
    --alfa-secondary: #ff8c42;
    --alfa-dark: #e55722;
    --alfa-light: #fff4f0;
    --alfa-gradient: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    --alfa-gradient-dark: linear-gradient(135deg, #e55722 0%, #ff6b35 100%);
    
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --bg-white: #ffffff;
    --bg-gray: #f7fafc;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* Configuración específica para la página de login moderna */
body.login-page-modern {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--alfa-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 0;
    margin: 0;
}

/* Contenedor principal */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 380px;
    margin: 10px;
}

.login-container-modern {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: slideUp 0.8s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header del login */
.login-header-modern {
    background: var(--alfa-gradient);
    color: white;
    padding: 1.25rem 1.5rem;
    text-align: center;
    position: relative;
}

.login-header-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.logo-section {
    position: relative;
    z-index: 1;
}

.logo-icon-modern {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.hospital-logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.75rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    border-radius: 8px;
}

.hospital-name {
    font-size: 1.125rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.system-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
    opacity: 0.95;
}

.location-text {
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Cuerpo del formulario */
.login-body-modern {
    padding: 1.25rem;
}

.login-form-modern {
    margin-bottom: 0.75rem;
}

/* Grupos de formulario */
.form-group-modern {
    margin-bottom: 1rem;
}

.form-label-modern {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.form-label-modern i {
    color: var(--alfa-primary);
    margin-right: 0.5rem;
    width: 14px;
}

/* Input wrapper */
.input-wrapper {
    position: relative;
}

.form-control-modern {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: all 0.3s ease;
    outline: none;
}

.form-control-modern::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-control-modern:focus {
    border-color: var(--alfa-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.input-focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--alfa-gradient);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.form-control-modern:focus + .input-focus-border {
    width: 100%;
}

/* Toggle de contraseña */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.3s ease;
    font-size: 0.85rem;
}

.password-toggle:hover {
    color: var(--alfa-primary);
}

/* Opciones del formulario */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Checkbox personalizado */
.checkbox-modern {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-modern input {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 3px;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-modern input:checked + .checkmark {
    background: var(--alfa-primary);
    border-color: var(--alfa-primary);
}

.checkbox-modern input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 3px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-password {
    color: var(--alfa-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--alfa-dark);
}

/* Botón de login */
.btn-login-modern {
    width: 100%;
    padding: 0.875rem;
    background: var(--alfa-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}

.btn-login-modern:hover {
    background: var(--alfa-gradient-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login-modern:active {
    transform: translateY(0);
}

.btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-login-modern.loading .btn-text {
    opacity: 0;
}

.btn-login-modern.loading .btn-loader {
    opacity: 1;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Separador */
.login-divider {
    text-align: center;
    margin: 0.75rem 0 0.75rem;
    position: relative;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
    z-index: 1;
}

.login-divider span {
    background: var(--bg-white);
    padding: 0 0.75rem;
    position: relative;
    z-index: 2;
}

/* Métodos alternativos */
.alternative-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-alternative {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.625rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-alternative:hover {
    border-color: var(--alfa-primary);
    color: var(--alfa-primary);
    background: rgba(255, 107, 53, 0.05);
}

.btn-alternative i {
    font-size: 0.9rem;
}

/* Footer */
.login-footer-modern {
    background: var(--bg-gray);
    padding: 1rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.login-footer-modern p {
    margin: 0 0 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--alfa-primary);
}

/* Decoraciones del fondo */
.bg-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.circle-1 {
    width: 150px;
    height: 150px;
    top: -75px;
    right: -75px;
    animation-delay: 0s;
}

.circle-2 {
    width: 100px;
    height: 100px;
    bottom: -50px;
    left: -50px;
    animation-delay: 2s;
}

.circle-3 {
    width: 75px;
    height: 75px;
    top: 50%;
    right: -37px;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

/* Responsive */
@media (max-height: 700px) {
    .login-wrapper {
        margin: 5px;
    }
    
    .login-header-modern {
        padding: 1rem 1.25rem;
    }
    
    .hospital-logo, .logo-icon-modern {
        width: 50px;
        height: 50px;
        margin-bottom: 0.5rem;
    }
    
    .login-body-modern {
        padding: 1rem;
    }
    
    .form-group-modern {
        margin-bottom: 0.875rem;
    }
    
    .alternative-methods {
        grid-template-columns: 1fr;
        gap: 0.375rem;
        margin-bottom: 0.75rem;
    }
    
    .login-footer-modern {
        padding: 0.75rem 1rem;
    }
    
    .btn-alternative {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        margin: 10px;
        max-width: 100%;
    }
    
    .login-container-modern {
        border-radius: 12px;
    }
    
    .login-header-modern {
        padding: 1rem 1rem;
    }
    
    .login-body-modern {
        padding: 1rem;
    }
    
    .hospital-logo, .logo-icon-modern {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
    
    .hospital-name {
        font-size: 1rem;
    }
    
    .alternative-methods {
        grid-template-columns: 1fr;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Resoluciones estándar */
@media (min-height: 1024px) {
    .login-wrapper {
        max-width: 420px;
    }
    
    .login-header-modern {
        padding: 1.5rem 1.75rem;
    }
    
    .hospital-logo, .logo-icon-modern {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .login-body-modern {
        padding: 1.75rem;
    }
}

/* Ocultar footer del layout base en login moderno */
body.login-page-modern .alfa-footer {
    display: none;
}

/* Correcciones específicas para evitar desplazamientos */
body.login-page-modern * {
    transform: none !important;
    translate: none !important;
}

body.login-page-modern .form-control-modern {
    position: static !important;
}

body.login-page-modern .form-control-modern:focus {
    transform: none !important;
    translate: none !important;
}

/* Asegurar que el contenedor principal no tenga margin/padding extra */
body.login-page-modern main {
    padding: 0;
    margin: 0;
    display: contents;
}