/**
 * Bienestar Municipal - Estilos de Login
 * Vista de autenticación moderna
 */

/* ========================================
   PÁGINA DE LOGIN
   ======================================== */

.login-page {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #a7154f 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Patrón de fondo decorativo */
.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 80%, rgba(167, 21, 79, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(167, 21, 79, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.03) 0%, transparent 30%);
    animation: backgroundFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(1%, 1%) rotate(1deg);
    }

    50% {
        transform: translate(0, 2%) rotate(0deg);
    }

    75% {
        transform: translate(-1%, 1%) rotate(-1deg);
    }
}

/* Formas geométricas flotantes */
.login-page::after {
    content: '';
    position: absolute;
    width: 900px;
    height: 900px;
    border: 1px solid rgba(167, 21, 79, 0.2);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: rotate 30s linear infinite;
}

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

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

/* ========================================
   LOGIN BOX
   ======================================== */

.login-box {
    width: 620px;
    max-width: 95%;
    position: relative;
    z-index: 10;
}

/* Card principal */
.login-box .card {
    background: rgba(255, 255, 255, 0.98);
    border: none;
    border-radius: 24px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

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

.login-box .card.card-outline {
    border-top: none;
}

.login-box .card.card-outline.card-primary {
    border-top: none;
}

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

.login-box .card-header {
    background: linear-gradient(135deg, #a7154f 0%, #6b0d33 100%);
    border: none;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    position: relative;
}
.login-card-body{
    background-color: #62625c42!important;
    border-top: 0;
    color: #666;
    padding: 20px;
}

.login-box .card-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-top: 20px solid #6b0d33;
}

/* Logo del login */
.login-logo {
    margin-bottom: 0;
}

.login-logo a {
    color: #fff !important;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.login-logo a b {
    font-weight: 800;
}

.login-logo img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: #fff;
    padding: 8px;
}

/* Mensaje de login */
.login-box-msg {
    color: #4d4d4d;
    font-size: 1rem;
    font-weight: 500;
    padding: 2rem 2rem 0.5rem;
    margin: 0;
}

/* ========================================
   CUERPO DEL LOGIN
   ======================================== */

.login-box .card-body {
    padding: 1.5rem 2rem 2rem;
}

/* Campos de formulario */
.login-box .input-group {
    margin-bottom: 1.25rem;
}

.login-box .form-control {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    height: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-box .form-control:focus {
    background: #fff;
    border-color: #a7154f;
    box-shadow: 0 0 0 4px rgba(167, 21, 79, 0.1);
}

.login-box .form-control::placeholder {
    color: #adb5bd;
}

.login-box .input-group-append {
    margin-left: -1px;
}

.login-box .input-group-text {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-left: none;
    border-radius: 0 12px 12px 0;
    padding: 0 1rem;
    color: #6c757d;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-box .form-control:focus+.input-group-append .input-group-text {
    border-color: #a7154f;
    color: #a7154f;
}

/* ========================================
   CHECKBOX PERSONALIZADO
   ======================================== */

.login-box .icheck-primary {
    padding-left: 0;
}

.login-box .icheck-primary input[type="checkbox"] {
    display: none;
}

.login-box .icheck-primary label {
    padding-left: 28px;
    position: relative;
    cursor: pointer;
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.5;
}

.login-box .icheck-primary label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #d4d4d4;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
}

.login-box .icheck-primary label::after {
    content: '✓';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    font-size: 14px;
    color: #fff;
    transition: all 0.2s ease;
}

.login-box .icheck-primary input[type="checkbox"]:checked+label::before {
    background: #a7154f;
    border-color: #a7154f;
}

.login-box .icheck-primary input[type="checkbox"]:checked+label::after {
    transform: translateY(-50%) scale(1);
}

/* ========================================
   BOTÓN DE LOGIN
   ======================================== */

.login-box .btn-primary,
.login-box .btn-flat.btn-primary {
    background: linear-gradient(135deg, #a7154f 0%, #8c1142 100%);
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    box-shadow: 0 4px 15px rgba(167, 21, 79, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-box .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 ease;
}

.login-box .btn-primary:hover {
    background: linear-gradient(135deg, #c91a5f 0%, #a7154f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(167, 21, 79, 0.5);
}

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

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

.login-box .btn-block {
    width: 100%;
}

/* ========================================
   FOOTER DEL LOGIN
   ======================================== */

.login-box .card-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1.25rem 2rem;
    text-align: center;
}

.login-box .card-footer a {
    color: #a7154f;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.login-box .card-footer a:hover {
    color: #6b0d33;
    text-decoration: underline;
}

/* ========================================
    ALERTAS EN LOGIN
   ======================================== */

.login-box .alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.login-box .alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.login-box .alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 4px solid #28a745;
}

/* ========================================
    VALIDACIÓN DE ERRORES
   ======================================== */

.login-box .is-invalid {
    border-color: #dc3545 !important;
}

.login-box .invalid-feedback {
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 0.5rem;
}

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

@media (max-width: 480px) {
    .login-box {
        width: 100%;
        padding: 1rem;
    }

    .login-box .card {
        border-radius: 20px;
    }

    .login-box .card-header {
        padding: 2rem 1.5rem 1.5rem;
    }

    .login-logo a {
        font-size: 1.5rem;
    }

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

    .login-box .card-body {
        padding: 1.25rem 1.5rem 1.5rem;
    }
}

/* ========================================
    ANIMACIÓN DE CARGA
   ======================================== */

.login-box .btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.login-box .btn-primary.loading::after {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   MARCA DE AGUA / FOOTER
   ======================================== */

.login-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    text-align: center;
    z-index: 5;
}

.login-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.login-footer a:hover {
    color: #fff;
}