/**
 * Custom Login Page Styling - Two Column Layout
 *
 * Design: Split screen with branded left panel and login form on right
 * Upgrade Safe: Only CSS overrides, no core file modifications
 */

/* ========================================
   TWO-COLUMN LAYOUT STRUCTURE
   ======================================== */

body {
    overflow-x: hidden !important;
}

/* Hide default logo at top */
.page-anonymous .text-center .glpi-logo {
    display: none !important;
}

/* Full width page layout */
.page-anonymous {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.page-anonymous > .flex-fill {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    min-height: 100vh !important;
}

/* Container for two-column layout */
.page-anonymous .container-tight {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    min-height: 100vh !important;
    flex-direction: row !important;
}

/* ========================================
   LEFT PANEL - BRANDED SECTION
   ======================================== */

.page-anonymous .container-tight::before {
    content: "" !important;
    flex: 0 0 50% !important;
    width: 50% !important;
    background-image: url("/pics/custom/login-assets/login-background.png") !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 60px !important;
}

/* LEFT PANEL - Hide overlapping text and illustration */
.page-anonymous .text-center:first-of-type {
    display: none !important;
}

/* ========================================
   RIGHT PANEL - LOGIN FORM
   ======================================== */

.page-anonymous .card {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
    margin: 0 !important;
    margin-left: auto !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px 0 60px 0 !important;
    min-height: 100vh !important;
    border-left: 8px solid #66C4D6 !important;
}

/* Company Logo at Top of Form */
.page-anonymous .card::before {
    content: "" !important;
    width: 400px !important;
    height: 128px !important;
    background-image: url("/pics/custom/logo.png") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    display: block !important;
    margin-bottom: 20px !important;
}

.page-anonymous .card-header {
    display: none !important;
}

.page-anonymous .card-body {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

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

/* Hide form title (we'll use field labels) */
.page-anonymous .card-body form::before {
    display: none !important;
}

/* Input Field Labels - Professional Styling */
.page-anonymous .form-label {
    display: flex !important;
    align-items: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 10px !important;
    letter-spacing: 0.2px !important;
    text-transform: none !important;
}

/* Add icons before labels using Font Awesome */
.page-anonymous .form-label::before {
    display: inline-block !important;
    margin-right: 8px !important;
    font-family: "Font Awesome 6 Free", sans-serif !important;
    font-weight: 900 !important;
    font-size: 13px !important;
    color: #1f2937 !important;
}

/* Email icon */
.page-anonymous .card-body .mb-3:first-of-type .form-label::before {
    content: "\f0e0" !important; /* fa-envelope */
}

/* Password icon */
.page-anonymous .card-body .mb-4 .form-label::before {
    content: "\f023" !important; /* fa-lock */
}

/* Input Fields - Professional Box Styling */
.page-anonymous .form-control {
    width: 100% !important;
    max-width: 100% !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    color: #1f2937 !important;
    font-weight: 400 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.page-anonymous .form-control:hover {
    border-color: #d1d5db !important;
}

.page-anonymous .form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    outline: none !important;
    background: #ffffff !important;
}

.page-anonymous .form-control::placeholder {
    color: #9ca3af !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

/* Password field label styling */
.page-anonymous .mb-4 .form-label {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Input wrapper styling for better visual hierarchy */
.page-anonymous .mb-3,
.page-anonymous .mb-4 {
    margin-bottom: 24px !important;
    width: 100% !important;
}

/* Form container centering */
.page-anonymous .card-body form {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
}

/* Login Button */
.page-anonymous .btn-primary {
    width: 100% !important;
    background: #000000 !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: white !important;
    transition: all 0.2s ease !important;
    margin-top: 24px !important;
}

.page-anonymous .btn-primary:hover {
    background: #1f2937 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.page-anonymous .btn-primary:active {
    transform: translateY(0) !important;
}

/* Remember Me & Forgot Password - Professional Styling */
.page-anonymous .form-check {
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.page-anonymous .form-check-input {
    width: 18px !important;
    height: 18px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 3px !important;
    margin-right: 8px !important;
    cursor: pointer !important;
}

.page-anonymous .form-check-input:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.page-anonymous .form-check-label {
    font-size: 13px !important;
    color: #4b5563 !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    user-select: none !important;
}

.page-anonymous .forgot_password a {
    font-size: 13px !important;
    color: #3b82f6 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
}

.page-anonymous .forgot_password a:hover {
    color: #2563eb !important;
    text-decoration: none !important;
}

/* Hide extra elements */
.page-anonymous .text-center.text-muted {
    display: none !important;
}

/* Login Source Dropdown - Professional Styling */
.page-anonymous .form-select,
.page-anonymous select.form-control {
    width: 100% !important;
    max-width: 100% !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 14px 18px !important;
    font-size: 15px !important;
    background: #ffffff !important;
    color: #1f2937 !important;
    font-weight: 400 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.page-anonymous .form-select:hover,
.page-anonymous select.form-control:hover {
    border-color: #d1d5db !important;
}

.page-anonymous .form-select:focus,
.page-anonymous select.form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    outline: none !important;
}

/* FAQ Link */
.page-anonymous .text-center.mt-4 {
    margin-top: 32px !important;
    padding-top: 32px !important;
    border-top: 1px solid #e5e7eb !important;
}

/* Form spacing adjustments - consolidated with centering rules above */

/* Better spacing between form sections */
.page-anonymous .d-flex.align-items-start.justify-content-between {
    margin-top: 16px !important;
    margin-bottom: 24px !important;
}

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

/* Tablet view (768px - 1024px) */
@media (max-width: 1024px) {
    .page-anonymous .container-tight::before {
        flex: 0 0 40% !important;
        width: 40% !important;
    }

    .page-anonymous .text-center:first-of-type {
        width: 40% !important;
        padding: 40px !important;
    }

    .page-anonymous .text-center:first-of-type::before {
        font-size: 32px !important;
    }

    .page-anonymous .card {
        flex: 0 0 60% !important;
        width: 60% !important;
        padding: 40px 0 !important;
    }

    .page-anonymous .card-body {
        width: 60% !important;
    }
}

/* Mobile view (<768px) - ONLY SHOW LOGIN FORM */
@media (max-width: 768px) {
    /* Hide left panel completely on mobile */
    .page-anonymous .container-tight::before {
        display: none !important;
    }

    .page-anonymous .text-center:first-of-type {
        display: none !important;
    }

    /* Remove top white space on mobile */
    .page-anonymous {
        min-height: 100vh !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .page-anonymous > .flex-fill {
        min-height: 100vh !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Make form full width and centered */
    .page-anonymous .container-tight {
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        background: #f9fafb !important;
        min-height: 100vh !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .page-anonymous .card {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 40px 24px !important;
        min-height: 100vh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #ffffff !important;
        justify-content: flex-start !important;
        padding-top: 60px !important;
        overflow: hidden !important;
        border-left:  none !important;
    }

    .page-anonymous .card::before {
        width: 180px !important;
        height: 70px !important;
        margin-bottom: 40px !important;
        margin-top: 0 !important;
    }

    .page-anonymous .card-body {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 20px !important;
    }

    /* Adjust form spacing for mobile */
    .page-anonymous .form-control {
        padding: 16px 14px !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
    }

    .page-anonymous .form-select,
    .page-anonymous select.form-control {
        padding: 16px 14px !important;
        font-size: 16px !important;
    }

    .page-anonymous .btn-primary {
        padding: 16px 24px !important;
        font-size: 16px !important;
    }
}

/* Extra small mobile (<480px) */
@media (max-width: 480px) {
    .page-anonymous .card {
        margin: 0 !important;
        padding: 40px 20px !important;
        padding-top: 40px !important;
        border-radius: 0 !important;
    }

    .page-anonymous .card::before {
        width: 160px !important;
        height: 60px !important;
        margin-bottom: 32px !important;
    }
}

/* ========================================
   ADDITIONAL ENHANCEMENTS
   ======================================== */

/* Left panel styling consolidated above */

/* Loading state for form */
.page-anonymous form[data-submit-once] button[type="submit"]:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Input validation states */
.page-anonymous .form-control:invalid:not(:placeholder-shown) {
    border-color: #ef4444 !important;
}

.page-anonymous .form-control:valid:not(:placeholder-shown) {
    border-color: #10b981 !important;
}

/* Smooth transitions */
.page-anonymous * {
    transition: all 0.2s ease !important;
}