/* =====================================================
   UTILEX PRIME - MODERN LOGIN PAGE
   Split-panel design inspired by Help Scout
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =====================================================
   PAGE BASE - Light background
   ===================================================== */

body[data-path="login"] {
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: "Inter", system-ui, -apple-system, sans-serif !important;
    background: #F0F2F5 !important;
}

/* Hide default elements */
body[data-path="login"] .web-header,
body[data-path="login"] .navbar,
body[data-path="login"] header,
body[data-path="login"] .web-footer,
body[data-path="login"] footer {
    display: none !important;
}

body[data-path="login"] .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Original Frappe elements are hidden by the JS when it moves the sections container */

/* =====================================================
   LOGIN WRAPPER - Full viewport centered
   ===================================================== */

.ux-login-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
    background: #F0F2F5;
}

.ux-login-container {
    width: 100%;
    max-width: 900px;
}

/* =====================================================
   HEADER WITH LOGO
   ===================================================== */

.ux-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.ux-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ux-logo img {
    height: 48px;
    width: auto;
}

.ux-logo-fallback {
    display: flex !important;
    align-items: center;
    gap: 12px;
}

.ux-logo-fallback span {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

/* =====================================================
   MAIN CARD - Split Panel Design (40%+ of page)
   ===================================================== */

.ux-login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 20px 40px -10px rgba(0, 0, 0, 0.1);
    display: flex;
    overflow: hidden;
    min-height: 500px;
}

/* =====================================================
   LEFT PANEL - Animation Side
   ===================================================== */

.ux-panel-left {
    flex: 0 0 50%;
    width: 50%;
    min-width: 0;
    background: linear-gradient(135deg, #1E3A5C 0%, #2A4F7D 50%, #3D5A80 100%);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.ux-animation-container {
    flex: 1;
    min-height: 420px;
    width: 100%;
    position: relative;
}

.ux-animation-container canvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
}

.ux-panel-content {
    padding: 24px 32px;
    color: #ffffff;
    text-align: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
    position: relative;
    z-index: 2;
}

.ux-panel-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #ffffff;
}

.ux-panel-content p {
    font-size: 13px;
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

/* =====================================================
   RIGHT PANEL - Login Form Side
   ===================================================== */

.ux-panel-right {
    flex: 0 0 50%;
    width: 50%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: #ffffff;
}

/* Hide ALL logos inside the right panel */
.ux-panel-right .login-logo,
.ux-panel-right .app-logo,
.ux-panel-right .navbar-brand,
.ux-panel-right img[src*="logo"],
.ux-panel-right .login-heading {
    display: none !important;
}

.ux-form-container {
    width: 100%;
    max-width: 380px;
}

.ux-form-container h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.ux-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 28px 0 !important;
}

/* =====================================================
   FORM STYLING
   ===================================================== */

.ux-form-container .form-group {
    margin-bottom: 18px !important;
}

.ux-form-container label,
.ux-form-container .control-label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 6px !important;
}

.ux-form-container input[type="text"],
.ux-form-container input[type="email"],
.ux-form-container input[type="password"],
.ux-form-container .form-control {
    width: 100% !important;
    padding: 11px 14px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #1a1a1a !important;
    background: #ffffff !important;
    border: 1px solid #D1D5DB !important;
    border-radius: 8px !important;
    outline: none !important;
    transition: all 0.15s ease !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.ux-form-container input:focus,
.ux-form-container .form-control:focus {
    border-color: #2A4F7D !important;
    box-shadow: 0 0 0 3px rgba(42, 79, 125, 0.1) !important;
}

.ux-form-container input::placeholder {
    color: #9CA3AF !important;
}

/* Hide icons */
.ux-form-container .input-icon-right,
.ux-form-container .input-icon-left,
.ux-form-container .password-strength-indicator {
    display: none !important;
}

/* =====================================================
   LOGIN BUTTON
   ===================================================== */

.ux-form-container .btn-login,
.ux-form-container .btn-primary,
.ux-form-container button[type="submit"] {
    width: 100% !important;
    padding: 11px 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    color: #ffffff !important;
    background: #2A4F7D !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-top: 8px !important;
    box-shadow: none !important;
}

.ux-form-container .btn-login:hover,
.ux-form-container .btn-primary:hover {
    background: #1E3A5C !important;
}

.ux-form-container .btn-login:active {
    transform: scale(0.98) !important;
}

/* =====================================================
   FORGOT PASSWORD & LINKS
   ===================================================== */

.ux-form-container a,
.ux-form-container a[href*="forgot"] {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #6B7280;
    text-decoration: none;
}

.ux-form-container a:hover {
    color: #2A4F7D;
}

/* Social login */
.ux-form-container .social-login-buttons {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #E5E7EB;
}

.ux-form-container .or-divider,
.ux-form-container .hr-or {
    text-align: center;
    color: #9CA3AF;
    font-size: 12px;
    margin: 12px 0;
}

.ux-form-container .btn-oauth,
.ux-form-container .social-login-buttons .btn {
    width: 100%;
    padding: 9px 14px;
    font-size: 13px;
    color: #374151;
    background: #ffffff;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ux-form-container .btn-oauth:hover {
    background: #F9FAFB;
}

/* =====================================================
   ERROR MESSAGES
   ===================================================== */

.ux-form-container .alert,
.ux-form-container .alert-danger {
    padding: 10px 14px;
    font-size: 13px;
    color: #DC2626;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* =====================================================
   RESPONSIVE - Mobile
   ===================================================== */

@media (max-width: 768px) {
    .ux-login-wrapper {
        padding: 20px;
    }

    .ux-login-card {
        flex-direction: column;
        max-width: 400px;
        margin: 0 auto;
        min-height: auto;
    }

    .ux-panel-left {
        min-width: 100%;
        min-height: 200px;
        order: -1;
    }

    .ux-animation-container {
        min-height: 160px;
    }

    .ux-panel-content {
        padding: 16px 20px;
    }

    .ux-panel-content h3 {
        font-size: 16px;
    }

    .ux-panel-content p {
        font-size: 12px;
    }

    .ux-panel-right {
        min-width: 100%;
        padding: 32px 24px;
    }

    .ux-form-container {
        max-width: 100%;
    }
}
