/* ===================================
   CARPIPUNTOS - WEBPANEL LOGIN STYLES
   =================================== */

/* Variables CSS para login - Se sobrescriben dinámicamente */
:root {
    --login-primary: var(--primary-color, #DC011B);
    --login-primary-dark: var(--primary-dark, #b30015);
    --login-secondary: var(--secondary-color, #DC011B);
    --login-secondary-dark: var(--secondary-color, #b30015);
    --login-accent: var(--accent-color, #667eea);
    --login-bg-gradient: linear-gradient(135deg, var(--login-primary) 0%, var(--login-secondary) 100%);
    --login-bg-gradient-hover: linear-gradient(135deg, var(--login-primary-dark) 0%, var(--login-secondary-dark) 100%);
    --login-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --login-border-radius: 15px;
    --login-transition: all 0.3s ease;
    --login-text-color: var(--text-color, #000000);
    --login-text-color-hover: var(--primary-color, #DC011B);
}

/* Optimizaciones de rendimiento */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* ===================================
   BODY Y LAYOUT
   =================================== */

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    font-family: 'Roboto', sans-serif;
    position: relative;
    background: linear-gradient(135deg, rgba(220, 1, 27, 0.1) 0%, rgba(220, 1, 27, 0.05) 100%);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/assets/img/fondo/Fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%) brightness(0.7);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

body.loaded::before {
    opacity: 1;
}

/* ===================================
   LOGIN CARD
   =================================== */

.login-card {
    background: white;
    border-radius: var(--login-border-radius);
    box-shadow: var(--login-shadow);
    overflow: hidden;
    transition: var(--login-transition);
    position: relative;
    z-index: 1;
}

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

/* ===================================
   LOGIN HEADER
   =================================== */

.login-header {
    color: white;
    border-radius: var(--login-border-radius) var(--login-border-radius) 0 0;
    padding: 0.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
    opacity: 0.5;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.login-header img {
    max-width: 15em;
    max-height: 8em;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.login-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.75rem;
    position: relative;
    z-index: 1;
}

.login-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* ===================================
   FORM CONTROLS
   =================================== */

.form-control {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--login-transition);
    background-color: #f8f9fa;
}

.form-control:focus {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background-color: white;
    outline: none;
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* ===================================
    FORM LABELS
   =================================== */

.form-label {
    font-weight: 600;
    color: var(--login-text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ===================================
    BUTTONS
   =================================== */

.btn-primary {
    background: var(--login-bg-gradient);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--login-transition);
    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 {
    background: var(--login-bg-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

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

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.btn-secondary {
    background: #000000;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--login-transition);
    position: relative;
    overflow: hidden;
}

.btn-secondary::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-secondary:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

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

.btn-secondary:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}



/* ===================================
   FORM CHECK
   =================================== */

.form-check-input {
    border: 2px solid #dee2e6;
    border-radius: 4px;
    transition: var(--login-transition);
}

.form-check-input:checked {
    background-color: var(--login-primary);
    border-color: var(--login-primary);
}

.form-check-input:focus {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-check-label {
    color: #6c757d;
    font-weight: 500;
    cursor: pointer;
}

/* ===================================
   ALERTS
   =================================== */

.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-danger {
    background: linear-gradient(135deg, #DC011B 0%, #e12037 100%);
    color: white;
}

.alert-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ffd43b 0%, #fcc419 100%);
    color: #212529;
}

.alert-info {
    background: linear-gradient(135deg, #74c0fc 0%, #4dabf7 100%);
    color: white;
}

/* ===================================
   INVALID FEEDBACK
   =================================== */

.invalid-feedback {
    color: #dc3545;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ===================================
   LINKS
   =================================== */

a {
    color: var(--login-text-color);
    text-decoration: none;
    transition: var(--login-transition);
}

a:hover {
    color: var(--login-primary-dark);
    text-decoration: underline;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
        border-radius: 12px;
    }
    
    .login-header {
        padding: 1.5rem;
        border-radius: 12px 12px 0 0;
        min-height: 100px;
    }
    
    .login-header img {
        max-width: 150px;
        max-height: 60px;
    }
    
    .login-header h3 {
        font-size: 1.5rem;
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    body {
        padding: 1rem;
    }
    
    .login-card {
        margin: 0;
    }
    
    .login-header {
        padding: 1rem;
        min-height: 80px;
    }
    
    .login-header img {
        max-width: 120px;
        max-height: 50px;
    }
    
    .login-header h3 {
        font-size: 1.25rem;
    }
}

/* ===================================
   ANIMACIONES
   =================================== */

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

.login-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.4s ease-out forwards;
    animation-delay: 0.1s;
    will-change: transform, opacity;
}

/* Estado inicial para evitar parpadeo */
.login-card.loading {
    opacity: 0;
    transform: translateY(20px);
}

/* ===================================
   LOADING STATES
   =================================== */

.btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-primary.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 white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===================================
   UTILIDADES
   =================================== */

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.d-grid {
    display: grid;
}

.text-decoration-none {
    text-decoration: none;
}

.text-decoration-none:hover {
    text-decoration: none;
}

/* ===================================
   CAMBIAR CONTRASEÑA - ESTILOS ESPECÍFICOS
   =================================== */

.password-requirements {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #dee2e6;
}

.requirements-title {
    font-weight: 600;
    color: #000;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.requirements-list li {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.requirement-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.requirement-icon.valid {
    background: #28a745;
}

.requirement-icon.invalid {
    background: #dc3545;
}

.password-toggle {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.password-toggle-btn:hover {
    background: #f8f9fa;
    color: #DC011B;
}

/* Botón de cerrar */
.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
    transform: scale(1.1);
}

.close-btn i {
    font-size: 18px;
}

/* Responsive para botón de cerrar */
@media (max-width: 576px) {
    .close-btn {
        top: 10px;
        right: 10px;
        width: 25px;
        height: 25px;
    }
    
    .close-btn i {
        font-size: 16px;
    }
} 