/* =============================================================================
   AUTH CSS - DMS ELECTROCENTRO
   Sistema de Autenticación con Colores Corporativos VíaWeb
   ============================================================================= */

/* -----------------------------------------------------------------------------
   CSS Variables - Paleta VíaWeb
   ----------------------------------------------------------------------------- */
:root {
    /* Colores Corporativos VíaWeb */
    --viaweb-cyan: #00B4D8;           /* Cyan vibrante */
    --viaweb-blue: #0077B6;           /* Azul medio */
    --viaweb-blue-dark: #00567D;      /* Azul profundo */
    --viaweb-gradient: linear-gradient(135deg, #00B4D8 0%, #0088BB 50%, #00567D 100%);
    
    /* Colores de Estado */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    
    /* Neutros */
    --color-dark: #1B2838;
    --color-gray: #4A5568;
    --color-gray-light: #94A3B8;
    --color-border: #E2E8F0;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    
    /* Border Radius */
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* -----------------------------------------------------------------------------
   Base Styles
   ----------------------------------------------------------------------------- */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* -----------------------------------------------------------------------------
   Background - Imagen con Overlay Gradiente VíaWeb
   ----------------------------------------------------------------------------- */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.auth-background-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--viaweb-gradient);
}

.auth-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/SE_SnFco2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(0, 180, 216, 0.3) 0%,
        rgba(0, 119, 182, 0.4) 50%,
        rgba(0, 86, 125, 0.5) 100%
    );
}

/* -----------------------------------------------------------------------------
   Container Principal
   ----------------------------------------------------------------------------- */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

/* -----------------------------------------------------------------------------
   Logo Externo (Fuera del Card)
   ----------------------------------------------------------------------------- */
.auth-logo-external {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo-external img {
    max-height: 60px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 15px rgba(255, 255, 255, 0.6))
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
}

.auth-logo-external .fallback-title {
    display: none;
    color: white;
    font-weight: 700;
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
                 0 0 20px rgba(255, 255, 255, 0.6),
                 0 0 30px rgba(255, 255, 255, 0.4);
}

/* -----------------------------------------------------------------------------
   Card de Autenticación - Glassmorphism
   ----------------------------------------------------------------------------- */
.auth-card {
    background: rgba(255, 255, 255, 0.45);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-card.wide {
    max-width: 700px;
}

.auth-card.extra-wide {
    max-width: 900px;
}

/* -----------------------------------------------------------------------------
   Títulos y Textos
   ----------------------------------------------------------------------------- */
.auth-title {
    color: var(--viaweb-blue-dark);
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--color-gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.5;
}

.section-title {
    color: var(--viaweb-blue-dark);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.section-label {
    font-size: 0.85rem;
    color: var(--color-gray);
    margin-bottom: 0.75rem;
    text-align: center;
}

/* -----------------------------------------------------------------------------
   Botones Sociales - Estilo Minimalista
   ----------------------------------------------------------------------------- */

/* Fila de iconos sociales */
.social-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.btn-social-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
    background: white;
    color: var(--color-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--transition-normal);
    text-decoration: none;
    cursor: pointer;
}

.btn-social-icon:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-social-icon.microsoft:hover {
    border-color: #00a4ef;
    color: #00a4ef;
    background: rgba(0, 164, 239, 0.05);
}

.btn-social-icon.google:hover {
    border-color: #ea4335;
    color: #ea4335;
    background: rgba(234, 67, 53, 0.05);
}

.btn-social-icon.facebook:hover {
    border-color: #1877f2;
    color: #1877f2;
    background: rgba(24, 119, 242, 0.05);
}

/* Botones sociales con texto completo */
.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    text-decoration: none;
    border: 2px solid var(--color-border);
    background: white;
    color: var(--color-dark);
    width: 100%;
    margin-bottom: 0.75rem;
}

.btn-social:hover {
    background: #f8f9fa;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-social i {
    font-size: 1.2rem;
}

/* Botón de email (primario) */
.btn-social.btn-email {
    background: var(--viaweb-gradient);
    border: none;
    color: white;
}

.btn-social.btn-email:hover {
    filter: brightness(1.05);
    box-shadow: var(--shadow-md);
}

/* -----------------------------------------------------------------------------
   Botones Primarios Personalizados
   ----------------------------------------------------------------------------- */
.btn-primary-custom,
.btn-primary {
    background: var(--viaweb-gradient);
    border: none;
    color: white;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all var(--transition-normal);
}

.btn-primary-custom:hover,
.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--viaweb-cyan);
    color: var(--viaweb-blue);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--viaweb-cyan);
    color: white;
    border-color: var(--viaweb-cyan);
}

/* -----------------------------------------------------------------------------
   Divisor
   ----------------------------------------------------------------------------- */
.divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--color-gray);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* -----------------------------------------------------------------------------
   Formularios
   ----------------------------------------------------------------------------- */
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--color-dark);
}

.form-control {
    padding: 0.625rem 0.875rem;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--viaweb-cyan);
    box-shadow: 0 0 0 0.2rem rgba(0, 180, 216, 0.25);
    outline: none;
}

.form-text {
    font-size: 0.8rem;
    color: var(--color-gray-light);
    margin-top: 0.25rem;
}

.invalid-feedback {
    font-size: 0.8rem;
    color: var(--color-danger);
}

/* Input group con botón de toggle password */
.password-toggle {
    border: 1px solid var(--color-border);
    background: white;
    border-left: none;
    color: var(--color-gray);
    transition: all var(--transition-fast);
}

.password-toggle:hover {
    background: #f8f9fa;
    color: var(--color-dark);
}

/* -----------------------------------------------------------------------------
   Tabs Personalizados
   ----------------------------------------------------------------------------- */
.nav-tabs-custom {
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.nav-tabs-custom .nav-link {
    border: none;
    color: var(--color-gray);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
}

.nav-tabs-custom .nav-link.active {
    color: var(--viaweb-blue);
    border-bottom: 2px solid var(--viaweb-cyan);
    background: transparent;
}

.nav-tabs-custom .nav-link:hover:not(.active) {
    color: var(--viaweb-blue);
    border-bottom: 2px solid var(--color-border);
}

/* -----------------------------------------------------------------------------
   Contratos Dinámicos (Para Registro de Contratistas)
   ----------------------------------------------------------------------------- */
.contract-item {
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--color-border);
}

.contract-item .contract-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.contract-item .contract-number {
    font-weight: 600;
    color: var(--viaweb-blue);
    font-size: 0.9rem;
}

.contract-item .btn-remove {
    color: var(--color-danger);
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

/* -----------------------------------------------------------------------------
   Footer del Card
   ----------------------------------------------------------------------------- */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.auth-footer a {
    color: var(--viaweb-blue);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--viaweb-cyan);
    text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   Footer del Sitio
   ----------------------------------------------------------------------------- */
.site-footer {
    text-align: center;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.1);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.site-footer a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--transition-fast);
}

.site-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* -----------------------------------------------------------------------------
   Iconos
   ----------------------------------------------------------------------------- */
.icon-xxl {
    font-size: 4rem;
}

.icon-xl {
    font-size: 3.5rem;
}

.icon-lg {
    font-size: 2.5rem;
}

.icon-md {
    font-size: 1.5rem;
}

/* -----------------------------------------------------------------------------
   Utilidades de Texto
   ----------------------------------------------------------------------------- */
.text-small {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.8rem;
}

.text-gradient-viaweb {
    background: var(--viaweb-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* -----------------------------------------------------------------------------
   Mensajes de Alerta
   ----------------------------------------------------------------------------- */
.alert {
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.alert-dismissible .btn-close {
    padding: 0.5rem;
}

/* -----------------------------------------------------------------------------
   Estados y Badges
   ----------------------------------------------------------------------------- */
.badge-viaweb {
    background: var(--viaweb-gradient);
    color: white;
}

/* -----------------------------------------------------------------------------
   Loading Spinner
   ----------------------------------------------------------------------------- */
.spinner-viaweb {
    border: 3px solid rgba(0, 180, 216, 0.2);
    border-top-color: var(--viaweb-cyan);
}

/* -----------------------------------------------------------------------------
   Animaciones
   ----------------------------------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeIn 0.4s ease;
}

/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .auth-card {
        padding: 1.5rem;
        margin: 0.75rem;
    }
    
    .auth-card.wide,
    .auth-card.extra-wide {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 1.25rem;
        margin: 0.5rem;
    }
    
    .btn-social-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
    
    .auth-logo-external img {
        max-height: 50px;
    }
    
    .auth-title {
        font-size: 1.25rem;
    }
    
    .auth-subtitle {
        font-size: 0.85rem;
    }
}

/* -----------------------------------------------------------------------------
   Compatibilidad con Navegadores
   ----------------------------------------------------------------------------- */
@supports not (backdrop-filter: blur(12px)) {
    .auth-card {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* -----------------------------------------------------------------------------
   Print Styles
   ----------------------------------------------------------------------------- */
@media print {
    .auth-background,
    .site-footer {
        display: none;
    }
    
    .auth-card {
        box-shadow: none;
        background: white;
    }
}