/* Sharjah Government Font - Regular */
@font-face {
    font-family: 'Sharjah Government';
    src: url('../fonts/sharjah-govt/WOFF2/AvenirArabic-SharjahGovt-Rg.woff2') format('woff2'),
         url('../fonts/sharjah-govt/WOFF/AvenirArabic-SharjahGovt-Rg.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Sharjah Government Font - Medium */
@font-face {
    font-family: 'Sharjah Government';
    src: url('../fonts/sharjah-govt/WOFF2/AvenirArabic-SharjahGovt-Md.woff2') format('woff2'),
         url('../fonts/sharjah-govt/WOFF/AvenirArabic-SharjahGovt-Md.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Sharjah Government Font - Heavy */
@font-face {
    font-family: 'Sharjah Government';
    src: url('../fonts/sharjah-govt/WOFF2/AvenirArabic-SharjahGovt-Hv.woff2') format('woff2'),
         url('../fonts/sharjah-govt/WOFF/AvenirArabic-SharjahGovt-Hv.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Set Sharjah Government as the main font */
/* CENTRALIZED FONT CONFIGURATION:
   To change the global font, update ONLY the --font-primary variable below.
   This variable is used across all pages for both LTR (English) and RTL (Arabic/Urdu). */
:root {
    --font-primary: 'Sharjah Government', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    font-family: var(--font-primary);
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Font weight utilities */
.font-regular {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-heavy {
    font-weight: 700;
}

/* Ensure all form elements inherit the global font (browsers reset these by default) */
input,
select,
textarea,
button,
optgroup {
    font-family: inherit;
}

/* Form input styling */
.form-input {
    transition: all 0.2s ease-in-out;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    height: 40px
}

select.form-input {
    padding: 8px 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

[dir="rtl"] select.form-input {
    background-position: left 12px center;
    padding-right: 12px;
    padding-left: 32px;
}

.form-input:focus {
    border-color: #82B42E;
    box-shadow: 0 0 0 3px rgba(130, 180, 46, 0.1);
}

/* Form button styling */
.form-button {
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: #ACD563;
    color: #203669;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    min-height: 40px;
}

.form-button:hover {
    background-color: rgba(172, 213, 99, 0.8);
}

.form-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Secondary form button styling */
.form-button-secondary {
    transition: all 0.2s ease-in-out;
    border: 1px solid #ACD563;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: transparent;
    color: #ACD563;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    min-height: 40px;
}

.form-button-secondary:hover {
    background-color: rgba(172, 213, 99, 0.1);
    border-color: rgba(172, 213, 99, 0.8);
}

.form-button-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom Tailwind text size overrides to match design system */
.text-xs { font-size: 14px !important; }
.text-sm { font-size: 16px !important; }
.text-base { font-size: 18px !important; }
.text-lg { font-size: 20px !important; }
.text-xl { font-size: 24px !important; }
.text-2xl { font-size: 28px !important; }
.text-3xl { font-size: 32px !important; }
 
/* Heading overrides */
h1, .text-h1 { font-size: 36px !important; }
h2, .text-h2 { font-size: 32px !important; }
h3, .text-h3 { font-size: 28px !important; }
h4, .text-h4 { font-size: 24px !important; }
h5, .text-h5 { font-size: 20px !important; }
h6, .text-h6 { font-size: 18px !important; }

/* ========================================
   Auth Modal Container - Responsive Fixes
   ======================================== */

/* Base auth modal container - allows container to grow/shrink properly */
.auth-modal-container {
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 1250px;
    min-height: auto; /* Let content determine minimum height */
    max-height: calc(100vh - 32px); /* Account for section padding */
    overflow: hidden; /* Container clips decorative elements */
    position: relative;
}

/* On very small screens, allow full height minus padding */
@media (max-height: 600px) {
    .auth-modal-container {
        max-height: calc(100vh - 32px);
    }
}

/* On medium and larger screens */
@media (min-height: 700px) {
    .auth-modal-container {
        max-height: 90vh;
    }
}

/* The inner flex wrapper must also be flex with proper constraints */
.auth-modal-container > .flex {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0; /* CRITICAL: allows flex children to shrink below content size */
    max-height: 100%;
    overflow: hidden;
}

/* Content area inside auth modal - MUST use overflow-auto for scrolling */
.auth-modal-content {
    flex: 1 1 auto;
    min-height: 0; /* CRITICAL: allows this element to shrink and enable scroll */
    overflow-y: auto !important; /* Force scrolling */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    position: relative;
    z-index: 2;
}

/* ========================================
   Custom Scrollbar Styling - Design System
   Colors: Primary #203669, Accent #ACD563, Light Blue #5BC5F4
   ======================================== */

/* Webkit browsers (Chrome, Safari, Edge) */
.auth-modal-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.auth-modal-content::-webkit-scrollbar-track {
    background: rgba(32, 54, 105, 0.05);
    border-radius: 4px;
    margin: 8px 0;
}

.auth-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ACD563 0%, #82B42E 100%);
    border-radius: 4px;
    border: 1px solid rgba(32, 54, 105, 0.1);
    transition: all 0.2s ease;
}

.auth-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #82B42E 0%, #6a9625 100%);
    box-shadow: 0 0 4px rgba(172, 213, 99, 0.5);
}

.auth-modal-content::-webkit-scrollbar-thumb:active {
    background: #6a9625;
}

.auth-modal-content::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox scrollbar styling */
.auth-modal-content {
    scrollbar-width: thin;
    scrollbar-color: #ACD563 rgba(32, 54, 105, 0.05);
}

/* Alternative scrollbar style for other containers */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(32, 54, 105, 0.03);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #5BC5F4;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #4ab0db;
}

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #5BC5F4 rgba(32, 54, 105, 0.03);
}

/* Dark themed scrollbar for dark backgrounds */
.dark-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.dark-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.dark-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(172, 213, 99, 0.7);
    border-radius: 3px;
}

.dark-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(172, 213, 99, 1);
}

.dark-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(172, 213, 99, 0.7) rgba(255, 255, 255, 0.1);
}

/* ========================================
   End of Scrollbar Styling
   ======================================== */

/* Responsive padding for auth modal content */
.auth-modal-padding {
    padding: 12px 16px 80px 16px; /* Small screens: reduced padding, extra bottom for SVGs */
}

@media (min-width: 640px) {
    .auth-modal-padding {
        padding: 24px 60px 100px 60px;
    }
}

@media (min-width: 768px) {
    .auth-modal-padding {
        padding: 32px 80px 100px 80px;
    }
}

@media (min-width: 1024px) {
    .auth-modal-padding {
        padding: 48px 160px 120px 160px;
    }
}

@media (min-width: 1280px) {
    .auth-modal-padding {
        padding: 48px 318px 128px 318px;
    }
}

/* Hide decorative SVGs on very small screens to save space */
@media (max-height: 600px) {
    .auth-modal-container .decorative-svg {
        display: none;
    }
    
    .auth-modal-padding {
        padding-bottom: 24px; /* Reduced when SVGs are hidden */
    }
}

/* Decorative SVG positioning - give them lower z-index so content can scroll over */
.auth-modal-container .decorative-svg {
    pointer-events: none;
    z-index: 1;
}

/* Small screen text size adjustments */
@media (max-width: 640px) {
    .auth-modal-container h3 {
        font-size: 20px !important;
    }
    
    .auth-modal-container .text-xs {
        font-size: 12px !important;
    }
    
    .auth-modal-container .text-sm {
        font-size: 14px !important;
    }
}