/* --- Iqamat Portal | Premium Split Login Styles --- */

:root {
    --color-primary: #0F2F5F;
    --color-secondary: #C79A1B;
    --color-input-bg: #FFFDE7;
    --color-text-main: #1E1E1E;
}

body {
    background: url('/images/bg.png') center/cover no-repeat fixed;
    /* Keep bg fixed but content scrolls */
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Tajawal', sans-serif;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 9999;
    /* Highest priority on page */
    max-width: 900px;
    width: 100%;
    margin: auto;
    background: #FFFDF3;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 50px 100px -20px rgba(15, 47, 95, 0.4);
    animation: fade-in 0.8s ease-out;
}

@media (min-width: 768px) {
    .login-card {
        flex-direction: row;
        border-radius: 2.5rem;
        min-height: 500px;
    }
}

@media (max-width: 767px) {
    .login-card {
        max-height: none;
        /* Let it expand freely on mobile to use body scroll */
        margin-bottom: 2rem;
    }
}

.role-tab {
    flex: 1;
    padding: 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 900;
    transition: all 0.3s;
    border: 2px solid transparent;
    color: rgba(15, 47, 95, 0.4);
}

.role-tab.active {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 10px 20px rgba(15, 47, 95, 0.2);
}

.etype-radio-label input:checked+.radio-content {
    background: var(--color-secondary);
    color: white;
    box-shadow: 0 8px 20px -5px rgba(199, 154, 27, 0.4);
    transform: scale(1.02);
}

.radio-content {
    color: rgba(15, 47, 95, 0.4);
    letter-spacing: 0.5px;
}

.etype-radio-label input:not(:checked)+.radio-content:hover {
    background: rgba(15, 47, 95, 0.05);
    color: var(--color-primary);
}

/* Input Group Styling */
.form-input-group {
    background: var(--color-input-bg);
    border-radius: 15px;

    position: relative;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.form-input-group:focus-within {
    border-color: var(--color-secondary) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 6px rgba(199, 154, 27, 0.15) !important;
    border-width: 2px !important;
}

.form-input-group i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-primary);
    opacity: 0.2;
    font-size: 1rem;
}

.form-input-group input {
    background: transparent;
    border: none;
    width: 100%;
    font-weight: 700;
    font-size: 0.85rem;
    outline: none !important;
    display: block;
    position: relative;
    padding-left: 3.5rem !important; /* Space for icon on the left */
    padding-right: 1.25rem !important; /* Space for start of text on the right */
    z-index: 1; /* Lower than dropdown */
}

/* Global Input Base Styling */
input, select, textarea {
    border-radius: 15px !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
    padding-left: 3.5rem !important;  /* Space for icons on left */
    padding-right: 1.25rem !important; /* Proper text start on right */
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Intl-Tel-Input Overrides for RTL/Premium */
.iti {
    width: 100%;
    display: block;
    position: relative;
    z-index: 1000;
}

.iti__flag-container {
    direction: ltr;
}

.iti--allow-dropdown .iti__flag-container,
.iti--separate-dial-code .iti__flag-container {
    right: auto;
    left: 0;
}

.iti__selected-flag {
    padding: 0 10px 0 12px;
    border-radius: 15px 0 0 15px;
}

.iti__country-list, [id*="-country-listbox"] {
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 2147483647 !important; /* Max 32-bit integer z-index */
    width: 250px; 
    max-height: 169px;
}

.iti__country {
    padding: 12px 15px;
    /* Spacious items */
    font-size: 0.9rem;
    font-weight: 500;
}

.iti__country:hover {
    background-color: rgba(199, 154, 27, 0.05);
}
/* Premium Select2 Customization */
.select2-container--default .select2-selection--single {
    background-color: #FFFDE7 !important;
    border: 2px solid rgba(199, 154, 27, 0.05) !important;
    border-radius: 15px !important;
    height: 57px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 12px !important;
    transition: all 0.3s ease !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #C79A1B !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(199, 154, 27, 0.1) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    color: #0F2F5F !important;
    padding-right: 25px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 55px !important;
    left: 10px !important;
    right: auto !important;
}

.select2-dropdown {
    border-radius: 20px !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2) !important;
    z-index: 2147483647 !important;
    overflow: hidden !important;
    margin-top: 5px !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px) !important;
}

.select2-container {
    z-index: 2147483647 !important;
}

.select2-results__option {
    padding: 12px 18px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #0F2F5F !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: rgba(199, 154, 27, 0.1) !important;
    color: #C79A1B !important;
}

.select2-search--dropdown .select2-search__field {
    border-radius: 10px !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    padding: 10px 15px !important;
    font-family: inherit !important;
    font-weight: 700 !important;
    outline: none !important;
}

/* Allow Select2 dropdown to float outside the card */
.login-card {
    overflow: visible !important;
}
 
/* Global Focus Styles */
input:focus, select:focus, textarea:focus {
    border-color: var(--color-secondary) !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(199, 154, 27, 0.1) !important;
}
