/**
 * Login Page Styles — صفحة تسجيل الدخول
 * مجموعة الوكالة التجارية | Al Wakalah Trading Group
 */
:root {
    --brand-primary: #891811;
    --brand-primary-light: #E30613;
    --brand-primary-hover: #70130E;
    --brand-primary-gradient: linear-gradient(135deg, #E30613 0%, #891811 100%);
    --metallic-dark: #1A1A1A;
    --metallic-silver: #8C8C8C;
    --metallic-light: #E0E0E0;
    --metallic-border: rgba(140, 140, 140, 0.35);
    --brand-red: #891811;
    --brand-red-active: #70130E;
    --brand-gray: #65686f;
    --brand-gray-active: #4e5057;
    --text-dark: #1A1A1A;
    --text-muted: #5A5A5A;
    --radius-sm: 10px;
    --btn-radius: 10px;
    --badge-radius: 14px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body, .viewport-wrapper { width: 100%; height: 100%; background-color: #ebedef; overflow-x: hidden; display: flex; justify-content: center; align-items: center; }
html[dir="rtl"] { direction: rtl; text-align: right; font-family: 'Cairo', sans-serif; }
html[dir="ltr"] { direction: ltr; text-align: left; font-family: 'Inter', -apple-system, 'Noto Sans SC', sans-serif; }

/* تعديلات المكونات لاتجاه LTR */
html[dir="ltr"] .input-control-wrap i.field-icon { left: 12px; right: auto; }
html[dir="ltr"] .input-control-wrap i.toggle-pwd { right: 12px; left: auto; }
html[dir="ltr"] .close-dialog-btn { right: 14px; left: auto; }
html[dir="ltr"] .modal-dialog-card { direction: ltr; text-align: left; }

/* شرائح تبديل اللغات */
.lang-switch-chips { display: inline-flex; align-items: center; justify-content: center; gap: 4px; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 3px 6px; border-radius: 20px; border: 1px solid rgba(220, 224, 230, 0.6); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); margin-bottom: 6px; }
.lang-chip { padding: 3px 9px; border-radius: 14px; font-size: 0.72rem; font-weight: 800; text-decoration: none; transition: var(--transition); }
.lang-chip.active { background-color: var(--brand-red); color: #ffffff; box-shadow: 0 2px 6px rgba(130, 0, 8, 0.3); }
.lang-chip:not(.active) { background-color: transparent; color: var(--brand-gray); }
.lang-chip:not(.active):hover { background-color: rgba(255, 255, 255, 0.9); color: var(--brand-red); }

/* حاوية التطبيق الرئيسية */
.app-container { width: 100%; max-width: 440px; height: 100vh; height: 100dvh; background: #ebedef linear-gradient(180deg, #f8fafc 0%, #ebedef 50%, #e2e8f0 100%); position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 18px) 20px; overflow-y: auto; overflow-x: hidden; }
@media (min-width: 500px) {
    .app-container { height: 880px; max-height: 94vh; border-radius: 46px; border: 6px solid #282a30; box-shadow: 0 25px 65px rgba(0, 0, 0, 0.6); }
}

/* شاشة التحميل (Splash Screen) */
#splash-screen { position: absolute; inset: 0; background: #ebedef; display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 999; border-radius: inherit; transition: opacity 0.6s ease, visibility 0.6s ease; }
#splash-screen.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-logo { width: 240px; max-width: 80%; animation: pulseIn 2s ease-in-out infinite alternate; }
.splash-logo img { width: 100%; height: auto; object-fit: contain; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.12)); }
.splash-progress-track { width: 200px; height: 5px; background: rgba(0, 0, 0, 0.08); border-radius: 10px; margin-top: 30px; overflow: hidden; position: relative; }
.splash-progress-bar { position: absolute; left: 0; top: 0; height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand-gray), var(--brand-red)); box-shadow: 0 0 10px rgba(130, 0, 8, 0.5); border-radius: 10px; transition: width 2.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.splash-loading-text { color: var(--brand-gray); font-size: 0.88rem; font-weight: 800; margin-top: 12px; }
.splash-footer-copyright { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 18px); left: 20px; right: 20px; text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--brand-gray); opacity: 0.85; letter-spacing: 0.2px; line-height: 1.4; }
@keyframes pulseIn {
    0% { transform: scale(0.96); opacity: 0.9; }
    100% { transform: scale(1.03); opacity: 1; }
}

/* محتوى الصفحة الرئيسي */
.content-body { position: relative; z-index: 2; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; }
.brand-section { width: 100%; display: flex; justify-content: center; align-items: center; margin-top: 10px; }
.brand-logo { width: 240px; height: 96px; max-width: 90%; max-height: 105px; object-fit: contain; display: block; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.10)); }

/* تعديلات الشريط المتحرك داخل صفحة تسجيل الدخول */
.aw-agencies-carousel-section { padding: 0 !important; margin: 6px 0 2px !important; }
.aw-agencies-carousel-section .aw-brand-infinite-slider { border-radius: 8px; }

/* قسم النصوص التعريفية */
.intro-section { margin: auto 0; padding: 0 14px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 105px; height: 105px; width: 100%; overflow: hidden; }
.intro-title { font-size: clamp(1.05rem, 3.6vw, 1.2rem); font-weight: 900; color: var(--brand-red); line-height: 1.3; margin-bottom: 4px; min-height: 1.85rem; display: flex; align-items: center; justify-content: center; transition: opacity 0.35s ease, transform 0.35s ease; white-space: nowrap; }
.intro-desc { font-size: clamp(0.72rem, 2.3vw, 0.78rem); font-weight: 700; color: var(--text-muted); line-height: 1.45; max-width: 290px; width: 100%; margin: 0 auto; min-height: 2.3rem; display: flex; align-items: center; justify-content: center; transition: opacity 0.35s ease, transform 0.35s ease; text-align: center; }
.intro-title.fade-out, .intro-desc.fade-out { opacity: 0 !important; transform: translateY(-6px) scale(0.98); }
.typing-cursor::after { content: '|'; color: var(--brand-red); font-weight: 900; display: inline-block; margin: 0 2px; animation: blink 0.75s infinite; }
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* أزرار الإجراءات */
.action-buttons-group { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.action-buttons-group .btn { width: 100%; min-height: 38px; font-size: 0.95rem; }

/* التذييل وقنوات التواصل */
.bottom-section { width: 100%; display: flex; flex-direction: column; align-items: center; }
.languages-support { font-size: 0.72rem; font-weight: 800; color: var(--brand-gray); margin-bottom: 12px; background: rgba(255, 255, 255, 0.75); padding: 5px 12px; border-radius: 20px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04); display: flex; align-items: center; gap: 5px; }
.contact-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 320px; margin: 0 auto; align-items: flex-start; }
.contact-btn-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-decoration: none; gap: 6px; padding: 4px 2px; transition: var(--transition); border-radius: 12px; }
.contact-badge-box { width: 44px; height: 44px; border-radius: 14px; display: flex; justify-content: center; align-items: center; font-size: 1.28rem; color: #ffffff; transition: var(--transition); position: relative; }
.contact-badge-box.gray-bg { background: linear-gradient(rgb(58, 61, 66) 0%, rgb(37, 40, 44) 40%, rgb(26, 26, 26) 85%, rgb(10, 10, 10) 100%); border: 1px solid #383B40; box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.4), inset 1px 0 1px rgba(255, 255, 255, 0.15), inset -1px -1px 2px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(70, 74, 80, 0.22); }
.contact-badge-box.red-bg { background: linear-gradient(180deg, #A80B15 0%, #891811 40%, #6E100A 85%, #520904 100%); border: 1px solid #480703; box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.42), inset 1px 0 1px rgba(255, 255, 255, 0.2), inset -1px -1px 2px rgba(0, 0, 0, 0.4), 0 3px 10px rgba(137, 24, 17, 0.3); }
.contact-btn-item:hover .contact-badge-box { transform: translateY(-3px) scale(1.06); }
.contact-btn-item:hover .contact-badge-box.gray-bg { box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.55), 0 6px 14px rgba(70, 74, 80, 0.32); }
.contact-btn-item:hover .contact-badge-box.red-bg { box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 6px 16px rgba(168, 11, 21, 0.4); }
.contact-btn-item span { font-size: 0.68rem; font-weight: 800; color: var(--brand-gray); text-align: center; line-height: 1.25; transition: color 0.2s ease; max-width: 72px; white-space: normal; word-break: break-word; }
.contact-btn-item:hover span { color: var(--brand-red); }
.login-footer-copyright { margin-top: 14px; font-size: 0.72rem; font-weight: 700; color: var(--brand-gray); text-align: center; line-height: 1.5; opacity: 0.85; letter-spacing: 0.2px; padding: 2px 8px; }

/* النوافذ المنبثقة (Modals) */
.modal-overlay { position: fixed; inset: 0; background: rgba(12, 13, 16, 0.65); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 10000; display: flex; justify-content: center; align-items: center; padding: 8px; opacity: 0; visibility: hidden; transition: all 0.35s ease; }
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-dialog-card { background: #ffffff; width: 100%; max-width: 360px; max-height: 90vh; overflow-y: auto; border-radius: 20px; padding: 20px 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25); transform: translateY(20px) scale(0.96); transition: var(--transition); position: relative; border: 1px solid rgba(0, 0, 0, 0.05); scrollbar-width: thin; scrollbar-color: #dce0e6 transparent; }
.modal-dialog-card::-webkit-scrollbar { width: 5px; }
.modal-dialog-card::-webkit-scrollbar-thumb { background-color: #dce0e6; border-radius: 4px; }
.modal-overlay.open .modal-dialog-card { transform: translateY(0) scale(1); }
.close-dialog-btn { position: absolute; top: 14px; left: 14px; background: #f0f2f5; border: none; width: 30px; height: 30px; border-radius: 50%; font-size: 0.85rem; color: var(--brand-gray); cursor: pointer; display: flex; justify-content: center; align-items: center; transition: var(--transition); z-index: 2; }
.close-dialog-btn:hover { background: #e2e4e8; color: var(--brand-red); }
.modal-head { text-align: center; margin-bottom: 8px; }
.modal-head h3 { font-size: 1.25rem; font-weight: 900; color: var(--brand-red); margin-bottom: 3px; }
.modal-head p { font-size: 0.78rem; color: var(--brand-gray); font-weight: 700; }

/* Avatar Picker */
.avatar-picker-container { display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 8px; }
.avatar-preview-wrap { position: relative; width: 76px; height: 76px; border-radius: 50%; border: 2.5px solid var(--brand-red); padding: 2px; background: #ffffff; box-shadow: 0 4px 14px rgba(130, 0, 8, 0.15); cursor: pointer; transition: var(--transition); }
.avatar-preview-wrap:hover { transform: scale(1.05); }
.avatar-preview-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background-color: #f0f2f5; }
.avatar-upload-badge { position: absolute; bottom: -2px; right: -2px; width: 26px; height: 26px; background: var(--brand-red); color: #ffffff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; border: 2px solid #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.avatar-picker-hint { font-size: 0.72rem; color: var(--brand-gray); font-weight: 700; margin-top: 6px; }

/* حقول النماذج */
.form-field-group { margin-bottom: 11px; }
.form-field-group label { display: block; font-size: 0.76rem; font-weight: 800; color: #333; margin-bottom: 4px; }
.input-control-wrap { position: relative; display: flex; align-items: center; }
.input-control-wrap i.field-icon { position: absolute; right: 12px; color: var(--brand-gray); font-size: 0.92rem; pointer-events: none; z-index: 1; }
.input-control-wrap i.toggle-pwd { position: absolute; left: 12px; color: var(--brand-gray); font-size: 0.92rem; cursor: pointer; transition: color 0.2s ease; z-index: 1; }
.input-control-wrap i.toggle-pwd:hover { color: var(--brand-red); }
.input-control-wrap input, .input-control-wrap select { width: 100%; height: 42px; padding: 0 38px 0 38px; border: 1.5px solid #dce0e6; border-radius: 12px; font-size: 0.85rem; font-weight: 700; background-color: #fafbfc; outline: none; transition: var(--transition); font-family: inherit; }
.input-control-wrap select { appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2365686f'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; background-size: 13px 13px; cursor: pointer; }
html[dir="ltr"] .input-control-wrap select { background-position: right 12px center; }
.input-control-wrap input:focus, .input-control-wrap select:focus { border-color: var(--brand-red); background-color: #ffffff; box-shadow: 0 0 0 3px rgba(130, 0, 8, 0.12); }

/* Account Type Grid */
.account-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.account-type-card { position: relative; cursor: pointer; user-select: none; }
.account-type-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.account-type-content { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; height: 38px; padding: 0 4px; border-radius: 10px; background: #fafbfc; border: 1.5px solid #dce0e6; color: var(--brand-gray); font-size: 0.76rem; font-weight: 800; transition: var(--transition); white-space: nowrap; }
.account-type-content i { font-size: 0.88rem; transition: transform 0.2s ease; }
.account-type-card input[type="radio"]:checked + .account-type-content { background: linear-gradient(180deg, #A80B15 0%, #891811 40%, #6E100A 85%, #520904 100%); border-color: #480703; color: #ffffff !important; box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.42), inset 1px 0 1px rgba(255, 255, 255, 0.2), inset -1px -1px 2px rgba(0, 0, 0, 0.4), 0 3px 10px rgba(137, 24, 17, 0.28); }
.account-type-card input[type="radio"]:checked + .account-type-content i { transform: scale(1.1); }
.account-type-card:hover .account-type-content { border-color: var(--brand-red); }

/* Name Split Grid */
.name-split-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.name-split-item { display: flex; flex-direction: column; }
.name-split-item label { font-size: 0.72rem; font-weight: 700; color: #4a4d52; margin-bottom: 3px; }
.name-split-item .input-control-wrap input { padding: 0 32px 0 10px; font-size: 0.82rem; height: 40px; }
html[dir="ltr"] .name-split-item .input-control-wrap input { padding: 0 10px 0 32px; }
.name-split-item .input-control-wrap i.field-icon { right: 10px; font-size: 0.82rem; }
html[dir="ltr"] .name-split-item .input-control-wrap i.field-icon { right: auto; left: 10px; }
.full-name-preview { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 10px; background: rgba(137, 24, 17, 0.05); border-radius: 8px; font-size: 0.75rem; font-weight: 700; color: var(--brand-red); border: 1px dashed rgba(137, 24, 17, 0.25); min-height: 28px; word-break: break-word; }
.full-name-preview i { font-size: 0.85rem; flex-shrink: 0; }

/* Checkbox & Switch Row */
.checkbox-agreement { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 0.74rem; font-weight: 700; color: #555; cursor: pointer; }
.checkbox-agreement input { accent-color: var(--brand-red); width: 15px; height: 15px; }
.dialog-switch-row { text-align: center; margin-top: 14px; font-size: 0.78rem; font-weight: 800; color: var(--brand-gray); }
.dialog-switch-row a { color: var(--brand-red); text-decoration: none; cursor: pointer; font-weight: 900; }
.dialog-switch-row a:hover { text-decoration: underline; }

/* Cookie Banner */
.cookie-banner { bottom: 20px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 32px), 410px); border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22), 0 2px 10px rgba(137, 24, 17, 0.12); }
@media (min-width: 500px) {
    .cookie-banner { position: fixed; bottom: 24px; max-width: 410px; }
}
