/**
 * Modern Login Pages Design - Perfex CRM
 * Beautiful, elegant design with animations and visual effects
 * For both admin and client login pages
 */

/* ==========================================
   Animated Background with Gradients
   ========================================== */
body.login_admin,
body.customers_login,
body.login {
    min-height: 100vh !important;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* Animated gradient overlay */
body.login_admin::before,
body.customers_login::before,
body.login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
            rgba(102, 126, 234, 0.8) 0%,
            rgba(118, 75, 162, 0.8) 25%,
            rgba(74, 144, 226, 0.8) 50%,
            rgba(80, 227, 194, 0.8) 75%,
            rgba(102, 126, 234, 0.8) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: 0;
}

/* Floating shapes animation */
body.login_admin::after,
body.customers_login::after,
body.login::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes float {

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

    33% {
        transform: translateY(-20px) rotate(5deg);
    }

    66% {
        transform: translateY(20px) rotate(-5deg);
    }
}

/* ==========================================
   Login Form Container - Enhanced
   ========================================== */
.authentication-form-wrapper {
    position: relative;
    z-index: 100 !important;
    animation: slideInUp 0.8s ease-out;
}

/* Ensure all login content is above background */
.authentication-form-wrapper>*,
.panel_s,
.login-form,
.mtop40>* {
    position: relative;
    z-index: 10;
}

/* Panel enhancement */
.panel_s,
.authentication-form-wrapper>div:last-child {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) !important;
    border: none !important;
    overflow: hidden;
    position: relative;
    animation: fadeInScale 0.6s ease-out 0.2s backwards;
}

/* Glass effect shimmer */
.panel_s::before,
.authentication-form-wrapper>div:last-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* ==========================================
   Logo Animation
   ========================================== */
.company-logo,
.authentication-form-wrapper .company-logo {
    animation: bounceIn 0.8s ease-out;
    margin-bottom: 2rem;
}

.company-logo img {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.company-logo img:hover {
    transform: scale(1.05);
}

/* ==========================================
   Headings
   ========================================== */
.login-heading,
.authentication-form-wrapper h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeIn 1s ease-out 0.3s backwards;
}

.authentication-form-wrapper p {
    animation: fadeIn 1s ease-out 0.4s backwards;
}

/* ==========================================
   Form Elements - Modern Style
   ========================================== */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-control {
    border: 2px solid rgba(102, 126, 234, 0.2) !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

.form-control:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1),
        0 8px 16px rgba(102, 126, 234, 0.15) !important;
    transform: translateY(-2px);
    background: white !important;
}

/* Floating label effect */
.control-label {
    font-weight: 600 !important;
    color: #4a5568 !important;
    margin-bottom: 8px !important;
    display: block;
    transition: all 0.3s ease;
}

/* ==========================================
   Buttons - Modern & Interactive
   ========================================== */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 24px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4) !important;
}

.btn-primary:active {
    transform: translateY(-1px) !important;
}

/* Default button style */
.btn-default {
    border: 2px solid #667eea !important;
    border-radius: 12px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    color: #667eea !important;
    background: white !important;
    transition: all 0.3s ease !important;
}

.btn-default:hover {
    background: #667eea !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* ==========================================
   Checkbox & Remember Me
   ========================================== */
.checkbox {
    margin: 18px 0;
}

.checkbox label {
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: color 0.3s ease;
}

.checkbox label:hover {
    color: #667eea;
}

.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accentcolor: #667eea;
}

/* ==========================================
   Links - Elegant Style
   ========================================== */
a.text-muted {
    color: #667eea !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    position: relative;
}

a.text-muted::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

a.text-muted:hover::after {
    width: 100%;
}

a.text-muted:hover {
    color: #764ba2 !important;
}

/* ==========================================
   Language Selector (Client Login)
   ========================================== */
.selectpicker {
    border-radius: 12px !important;
}

/* ==========================================
   Animations Keyframes
   ========================================== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.95);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ==========================================
   Alerts - Modern Style
   ========================================== */
.alert {
    border-radius: 12px !important;
    border: none !important;
    padding: 16px 20px !important;
    animation: slideInDown 0.5s ease-out;
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%) !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3) !important;
}

.alert-success {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%) !important;
    color: white !important;
    box-shadow: 0 8px 20px rgba(81, 207, 102, 0.3) !important;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

/* ==========================================
   Recaptcha Styling
   ========================================== */
.g-recaptcha {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    transform: scale(0.95);
    border-radius: 8px;
    overflow: hidden;
}

/* ==========================================
   Responsive Adjustments
   ========================================== */
@media (max-width: 768px) {

    body.login_admin::before,
    body.login::before {
        animation-duration: 20s;
    }

    .authentication-form-wrapper {
        padding: 20px;
    }

    .panel_s,
    .authentication-form-wrapper>div:last-child {
        border-radius: 16px !important;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {

    body.login_admin::before,
    body.login::before,
    body.login_admin::after,
    body.login::after {
        display: none;
    }
}

/* ==========================================
   Accessibility - Focus States
   ========================================== */
.form-control:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}