/* هيكل «auth shell»: كل شاشات ما قبل التطبيق (الدخول، الاستعادة، نوع الحساب، الهوية، المزرعة، توثيق البريد).
 * داكن دائماً كالرئيسية (css/home_v2.css) بألوانه المحلية؛ لا يتبع فاتح/داكن النظام ولا مظاهر classic/modern/wasm/copper.
 * جوال أولاً: الحقول 52px بخط 16px (لا تكبير تلقائي في iOS)، أهداف اللمس 48، مناطق الأمان، ارتفاع ديناميكي dvh.
 * الاستجابة للمساحة الفعلية لا للجهاز (NN-23): البطاقة تتبع العرض المتاح بسقف نموذج مبرَّر أدناه.
 * كل المحدِّدات تحت .auth-screen/.auth-card فلا أثر على بقية التطبيق. */

html:has(.auth-screen:not([hidden])) body { background: var(--c-forest-900); }

.auth-screen {
  --a-font: -apple-system, BlinkMacSystemFont, "SF Arabic", "SF Pro Text", "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  color-scheme: dark; position: relative; isolation: isolate; overflow-x: clip;
  min-height: 100vh; min-height: 100dvh; background: var(--c-forest-900); color: var(--c-paper); font-family: var(--a-font);
  -webkit-text-size-adjust: 100%;
}
#login.auth-screen, #signup.auth-screen { display: block; padding: 0; place-items: initial; }

/* صورة القطيع: شريط علوي يتلاشى في الخلفية كالرئيسية؛ يُخفى في الارتفاعات القصيرة أو مع لوحة المفاتيح */
.auth-screen::before {
  content: ""; position: absolute; inset: 0 0 auto 0; z-index: -1; height: min(34dvh, 260px); pointer-events: none;
  background: linear-gradient(180deg, var(--c-black-a70) 0, var(--c-black-a45) 45%, var(--c-forest-900) 100%),
              var(--c-sand-ink) url("/app/img/hero-flock.jpg") 34% 30% / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, var(--video-bg) 0%, var(--video-bg) 62%, transparent 100%);
  mask-image: linear-gradient(180deg, var(--video-bg) 0%, var(--video-bg) 62%, transparent 100%);
}
@media (max-height: 600px) { .auth-screen::before { display: none; } }
@media (min-width: 900px) { .auth-screen::before { height: min(55dvh, 520px); } }

.auth-wrap {
  position: relative; min-height: 100vh; min-height: 100dvh; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* سقف عرض النموذج 440px مقصود: حقول أعرض من ذلك تُصعّب القراءة؛ دونه تتبع البطاقة عرض الشاشة كله (NN-23) */
.auth-screen .auth-card {
  width: min(440px, 100%); margin: 0 auto; padding: 24px 20px 22px; border-radius: 22px;
  background: var(--c-black-a70); border: .5px solid var(--c-paper-a60);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: none; display: flex; flex-direction: column; gap: 14px; text-align: start;
}
@media (min-width: 480px) { .auth-screen .auth-card { padding: 30px 28px 26px; } }
@media (prefers-reduced-motion: no-preference) {
  .auth-screen .auth-card { animation: auth-rise .22s ease-out both; }
  @keyframes auth-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

.auth-screen .auth-logo { display: block; width: 168px; height: auto; max-width: 70%; margin: 0 auto -4px; }
.auth-screen .auth-title { margin: 0; text-align: center; font: 700 26px/1.35 var(--a-font); color: var(--c-paper); }
.auth-screen .auth-sub { margin: 0; text-align: center; font: 400 16px/1.6 var(--a-font); color: var(--c-paper-a80); }
.auth-screen .auth-status { margin: 0; text-align: center; font: 400 15px/1.6 var(--a-font); color: var(--c-paper-a80); }
.auth-screen .auth-muted { color: var(--c-paper-a60); font-size: 15px; }
.auth-screen .auth-fineprint, .auth-screen .hint { margin: 0; font: 400 13.5px/1.7 var(--a-font); color: var(--c-paper-a60); }
.auth-screen .auth-legal { margin: 0; text-align: center; font: 400 13.5px/1.7 var(--a-font); color: var(--c-paper-a60); }
.auth-screen a { color: var(--c-sand); text-underline-offset: 3px; }
.auth-screen a:focus-visible { outline: 2px solid var(--c-sand); outline-offset: 2px; border-radius: 4px; }
.auth-screen .hint { background: var(--c-white-a06); border-radius: 12px; padding: 8px 12px; }

/* الحقول */
.auth-screen .auth-field { display: flex; flex-direction: column; gap: 6px; text-align: start; }
.auth-screen .auth-field > label { margin: 0; font: 600 14.5px/1.4 var(--a-font); color: var(--c-paper-a80); }
.auth-screen .auth-input { position: relative; }
.auth-screen .auth-input input {
  width: 100%; height: 52px; margin: 0; padding: 0 14px; border-radius: 14px; border: 1px solid var(--c-paper-a60);
  background: var(--c-forest-700); color: var(--c-paper); font: 400 max(16px, 1rem)/1.4 var(--a-font);
  box-shadow: none; appearance: none; -webkit-appearance: none;
}
.auth-screen .auth-input input[dir="ltr"] { text-align: right; }
.auth-screen .auth-input input::placeholder { color: var(--c-paper-a60); opacity: 1; }
.auth-screen .auth-input input:focus { outline: none; border-color: var(--c-sand); box-shadow: 0 0 0 3px var(--c-sand-a22); }
.auth-screen .auth-input input[aria-invalid="true"] { border-color: var(--c-sos); box-shadow: 0 0 0 3px var(--c-sos-a14); }
.auth-screen .auth-input:has(.auth-reveal) input { padding-inline-end: 14px; }
html[dir="rtl"] .auth-screen .auth-input:has(.auth-reveal) input { padding-left: 56px; padding-right: 14px; }
html[dir="ltr"] .auth-screen .auth-input:has(.auth-reveal) input { padding-right: 56px; padding-left: 14px; }
html[dir="ltr"] .auth-screen .auth-input input[dir="ltr"] { text-align: left; }
.auth-screen .auth-input input:-webkit-autofill, .auth-screen .auth-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--c-paper); caret-color: var(--c-paper); box-shadow: 0 0 0 1000px var(--c-forest-800) inset; transition: background-color 9999s;
}
.auth-screen .auth-reveal {
  position: absolute; inset-block: 2px; inset-inline-end: 2px; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: var(--c-paper-a80); display: grid; place-items: center; cursor: pointer;
}
.auth-screen .auth-reveal svg { width: 22px; height: 22px; }
.auth-screen .auth-reveal:hover { background: var(--c-white-a06); }
.auth-screen .auth-reveal:focus-visible { outline: 2px solid var(--c-sand); outline-offset: -2px; }
.auth-screen .auth-reveal[aria-pressed="true"], .auth-screen .auth-reveal.revealed { color: var(--c-sand); }
.auth-screen .auth-reveal .slash { opacity: 1; }
.auth-screen .auth-reveal.revealed .slash { opacity: 0; }
.auth-screen .auth-field-hint { margin: 0; font: 400 13px/1.6 var(--a-font); color: var(--c-paper-a60); }
.auth-screen .auth-field-error { margin: 0; font: 600 13.5px/1.5 var(--a-font); color: var(--c-sos); }

/* الأزرار والروابط */
.auth-screen .auth-card .primary, .auth-screen .auth-card .ghost {
  width: 100%; min-height: 52px; padding: 0 18px; border-radius: 14px; font: 700 17px/1.2 var(--a-font);
  display: inline-flex; align-items: center; justify-content: center; text-align: center; margin: 0; box-shadow: none;
}
.auth-screen .auth-card .primary { background: var(--c-sand); color: var(--c-sand-ink); border: 1px solid var(--c-sand); }
.auth-screen .auth-card .primary:hover:not(:disabled) { filter: brightness(1.06); }
.auth-screen .auth-card .primary:active:not(:disabled) { transform: translateY(1px); }
.auth-screen .auth-card .primary:disabled { background: var(--c-sand-a22); border-color: transparent; color: var(--c-paper-a60); cursor: not-allowed; }
.auth-screen .auth-card .ghost { background: transparent; color: var(--c-paper); border: 1px solid var(--c-paper-a60); font-weight: 600; }
.auth-screen .auth-card .ghost:hover:not(:disabled) { background: var(--c-white-a06); }
.auth-screen .auth-card .ghost:disabled { opacity: .5; cursor: not-allowed; }
.auth-screen .auth-card .primary:focus-visible, .auth-screen .auth-card .ghost:focus-visible { outline: 2px solid var(--c-sand); outline-offset: 3px; }
.auth-screen .auth-link {
  min-height: 48px; padding: 0 8px; border: 0; background: none; color: var(--c-sand); font: 600 15px/1.3 var(--a-font);
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer; display: inline-flex; align-items: center;
}
.auth-screen .auth-link.strong { font-weight: 700; }
.auth-screen .auth-link:focus-visible { outline: 2px solid var(--c-sand); outline-offset: 1px; border-radius: 8px; }
.auth-screen .auth-row, .auth-screen .auth-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.auth-screen .auth-links { justify-content: center; }
.auth-screen .auth-actions { display: flex; gap: 12px; align-items: stretch; }
.auth-screen .auth-actions .auth-back { width: auto; flex: 0 0 34%; }
.auth-screen .auth-actions .primary { flex: 1; }
.auth-screen .auth-resend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; color: var(--c-paper-a60); font-size: 15px; }
.auth-screen .auth-resend .ghost { width: auto; min-height: 48px; font-size: 15px; }

/* الموافقة على الشروط: مربع 24px داخل تسمية بارتفاع 48، النص يلتف بجانب المربع لا فوقه */
.auth-screen .auth-check { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 8px 0; margin: 0; font: 400 15px/1.7 var(--a-font); color: var(--c-paper-a80); cursor: pointer; }
.auth-screen .auth-check input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--c-sand); }
.auth-screen .auth-check span { flex: 1; min-width: 0; }

/* الرسائل */
.auth-screen .auth-card .error, .auth-screen .auth-notice {
  margin: 0; padding: 10px 14px; border-radius: 12px; font: 600 14.5px/1.6 var(--a-font);
}
.auth-screen .auth-card .error { color: var(--c-sos); background: var(--c-sos-a14); border: 1px solid var(--c-sos-a40); }
.auth-screen .auth-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; text-align: start; }
.auth-screen .auth-notice.info { color: var(--c-paper); background: var(--c-ok-a14); border: 1px solid var(--c-ok-a14); }
.auth-screen .auth-notice.warn { color: var(--c-paper); background: var(--c-amber-a14); border: 1px solid var(--c-amber-a40); }

/* شريط المراحل */
.auth-screen .auth-steps { list-style: none; margin: 0 0 2px; padding: 0; display: flex; justify-content: center; gap: 6px 14px; flex-wrap: wrap; font: 600 13.5px/1.3 var(--a-font); color: var(--c-paper-a60); }
.auth-screen .auth-steps li { display: inline-flex; align-items: center; gap: 8px; }
.auth-screen .auth-step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--c-paper-a60); font-size: 13px; }
.auth-screen .auth-steps .current { color: var(--c-paper); }
.auth-screen .auth-steps .current .auth-step-dot { background: var(--c-sand); border-color: var(--c-sand); color: var(--c-sand-ink); }
.auth-screen .auth-steps .done .auth-step-dot { background: var(--c-ok-a14); border-color: var(--c-ok); color: var(--c-ok); }

/* خطوات التسجيل */
.auth-screen .signup-step { display: flex; flex-direction: column; gap: 14px; }
.auth-screen .signup-step[hidden] { display: none; }
.auth-screen .auth-more { border: 1px solid var(--c-paper-a60); border-radius: 14px; padding: 0 14px 12px; background: var(--c-white-a06); }
.auth-screen .auth-more > summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; color: var(--c-sand); font: 600 15px/1.3 var(--a-font); list-style-position: inside; }
.auth-screen .auth-more > summary:focus-visible { outline: 2px solid var(--c-sand); outline-offset: 2px; border-radius: 10px; }
.auth-screen .auth-more[open] > summary { margin-bottom: 8px; }
.auth-screen .auth-map { height: 220px; border-radius: 14px; overflow: hidden; border: 1px solid var(--c-paper-a60); }

/* بطاقات نوع الحساب */
.auth-screen .account-types { display: grid; gap: 10px; margin: 4px 0 0; }
.auth-screen .account-type-card {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 14px; border-radius: 16px;
  border: 1px solid var(--c-paper-a60); background: var(--c-white-a06); color: var(--c-paper); text-align: start; font: inherit; cursor: pointer;
}
.auth-screen .account-type-card:hover, .auth-screen .account-type-card:focus-visible { border-color: var(--c-sand); outline: none; }
.auth-screen .account-type-card:focus-visible { box-shadow: 0 0 0 3px var(--c-sand-a22); }
.auth-screen .account-type-icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--c-sand-a12); color: var(--c-sand); }
.auth-screen .account-type-icon svg { width: 26px; height: 26px; }
.auth-screen .account-type-copy { display: grid; gap: 3px; min-width: 0; }
.auth-screen .account-type-copy strong { font-size: 16px; }
.auth-screen .account-type-copy small { color: var(--c-paper-a60); font-size: 13px; line-height: 1.55; }

/* توثيق البريد */
.auth-screen .otp-screen { text-align: center; }
.auth-screen .otp-email-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 0; }
.auth-screen .otp-email { direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; font-size: 17px; }
.auth-screen .otp-change { min-height: 44px; min-width: 64px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--c-sand-a12); color: var(--c-sand); font: 700 14.5px/1 var(--a-font); cursor: pointer; }
.auth-screen .otp-change:focus-visible { outline: 2px solid var(--c-sand); outline-offset: 2px; }
.auth-screen .otp-edit { display: flex; flex-direction: column; gap: 10px; text-align: start; }
.auth-screen .otp-edit input { height: 52px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--c-paper-a60); background: var(--c-white-a06); color: var(--c-paper); font-size: 16px; text-align: right; }
.auth-screen .otp-field { width: 100%; max-width: 360px; margin: 4px auto; }
.auth-screen .otp-box { min-height: 56px; border: 1.5px solid var(--c-paper-a60); border-radius: 14px; background: var(--c-white-a06); color: var(--c-paper); }
.auth-screen .otp-box.filled { border-color: var(--c-sand); }
.auth-screen .otp-box.active { border-color: var(--c-sand); box-shadow: 0 0 0 3px var(--c-sand-a22); }
.auth-screen .otp-tip { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--c-sand-a12); color: var(--c-paper-a80); text-align: start; font-size: 14px; line-height: 1.6; }
.auth-screen .otp-tip .ui-icon { flex: none; color: var(--c-sand); }

/* شاشة الدخول: قائمة اللغة مدمجة في الزاوية */
.auth-screen .auth-card > .language-select {
  align-self: flex-end; width: auto; max-width: 150px; min-height: 44px; margin: 0; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--c-paper-a60); background: var(--c-white-a06); color: var(--c-paper); font: 500 15px/1 var(--a-font);
}
.auth-screen .auth-card > .language-select:focus-visible { outline: 2px solid var(--c-sand); outline-offset: 2px; }
.auth-screen .oauth-buttons { display: grid; gap: 10px; }
.auth-screen #login-oauth { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; border-top: 1px solid var(--c-paper-a60); }
.auth-screen #login-oauth:empty { display: none; }

@media (prefers-reduced-motion: reduce) { .auth-screen *, .auth-screen *::before { animation: none !important; transition: none !important; } }

/* نماذج خام داخل الهيكل: بوابة المزوّدين (/app/providers/) حقولها أشقاء مباشرون بلا تغليف .auth-field */
.auth-screen .auth-card form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.auth-screen .auth-card form[hidden] { display: none; }
.auth-screen .auth-card form > label { display: block; margin: 6px 0 0; font: 600 14.5px/1.4 var(--a-font); color: var(--c-paper-a80); }
.auth-screen .auth-card form > :is(input, select, textarea), .auth-screen .auth-card #reg-vet-fields :is(input, textarea) {
  width: 100%; margin: 0; padding: 0 14px; border-radius: 14px; border: 1px solid var(--c-paper-a60); background: var(--c-white-a06);
  color: var(--c-paper); font: 400 max(16px, 1rem)/1.4 var(--a-font); box-shadow: none;
}
.auth-screen .auth-card form > :is(input, select), .auth-screen .auth-card #reg-vet-fields input { height: 52px; }
.auth-screen .auth-card form > select option { color: var(--c-forest-900); }
.auth-screen .auth-card form > textarea, .auth-screen .auth-card #reg-vet-fields textarea { min-height: 96px; padding: 12px 14px; }
.auth-screen .auth-card form > :is(input, select, textarea):focus, .auth-screen .auth-card #reg-vet-fields :is(input, textarea):focus {
  outline: none; border-color: var(--c-sand); box-shadow: 0 0 0 3px var(--c-sand-a22);
}
.auth-screen .auth-card form > input[dir="ltr"] { text-align: right; }
.auth-screen .auth-card #reg-vet-fields { display: flex; flex-direction: column; gap: 10px; }
.auth-screen .auth-card #reg-vet-fields label { display: block; margin: 6px 0 0; font: 600 14.5px/1.4 var(--a-font); color: var(--c-paper-a80); }
.auth-screen .switch-row { display: flex; gap: 6px; padding: 4px; margin: 0 0 4px; border: 1px solid var(--c-paper-a60); border-radius: 16px; background: var(--c-white-a06); }
.auth-screen .switch-btn { flex: 1; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; color: var(--c-paper-a80); font: 600 15px/1 var(--a-font); cursor: pointer; }
.auth-screen .switch-btn.on { background: var(--c-sand); color: var(--c-sand-ink); }
.auth-screen .switch-btn:focus-visible { outline: 2px solid var(--c-sand); outline-offset: 2px; }
body:has(#login.auth-screen:not([hidden])) #lang-bar { position: absolute; z-index: 5; inset-block-start: max(10px, env(safe-area-inset-top)); inset-inline-start: 12px; }
body:has(#login.auth-screen:not([hidden])) #lang-bar select { min-height: 44px; border-radius: 12px; border: 1px solid var(--c-paper-a60); background: var(--c-black-a70); color: var(--c-paper); padding: 0 12px; font-size: 15px; }
/* بوابة المزوّدين: قائمة اللغة عائمة فوق الصفحة، فيُترك لها مكان لا يتداخل مع شعار البطاقة في النماذج الطويلة */
body:has(#lang-bar select) #login.auth-screen .auth-wrap { padding-top: max(68px, env(safe-area-inset-top)); }

/* ── مراجعة بصرية مستقلة (R2) ── */
/* البطاقة تبدأ من أعلى ثابت في كل الخطوات: لا قفزة بين خطوة قصيرة وأخرى طويلة */
.auth-wrap { justify-content: flex-start; padding-top: max(24px, min(10dvh, 96px)); }
/* نصوص مساعدة لا تقل عن 14px */
.auth-screen .auth-fineprint, .auth-screen .hint, .auth-screen .auth-legal, .auth-screen .auth-field-hint { font-size: 14px; }
/* القسم الاختياري: مؤشر توسيع (سهم بحدود لا إيموجي) */
.auth-screen .auth-more > summary { list-style: none; justify-content: space-between; }
.auth-screen .auth-more > summary::-webkit-details-marker { display: none; }
.auth-screen .auth-more > summary::after { content: ""; flex: none; width: 9px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; margin-inline-start: 12px; }
.auth-screen .auth-more[open] > summary::after { transform: rotate(-135deg); }
.auth-screen .auth-more .auth-field { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .auth-screen .auth-more > summary::after { transition: none; } }
/* خريطة Leaflet بمظهر داكن متسق (الإسناد يبقى ظاهراً: شرط ترخيص OpenStreetMap) */
.auth-screen .auth-map .leaflet-tile-pane { filter: brightness(.72) contrast(1.05) saturate(.7); }
.auth-screen .auth-map .leaflet-bar a { background: var(--c-forest-800); color: var(--c-sand); border-color: var(--c-paper-a60); }
.auth-screen .auth-map .leaflet-bar a:hover { background: var(--c-forest-700); }
.auth-screen .auth-map .leaflet-control-attribution { background: var(--c-black-a70); color: var(--c-paper-a80); }
.auth-screen .auth-map .leaflet-control-attribution a { color: var(--c-sand); }
/* خطأ الموافقة على الشروط: حد بلون الخطأ على المربع */
.auth-screen .auth-check input[aria-invalid="true"] { outline: 2px solid var(--c-sos); outline-offset: 2px; }
/* الجوال الصغير/القصير: شعار أصغر وبطاقة أقرب للحافة ليظهر زر الدخول مبكراً */
@media (max-height: 680px), (max-width: 359px) {
  .auth-screen .auth-logo { width: 120px; margin-bottom: -10px; }
  .auth-wrap { padding-inline: 8px; padding-top: 12px; }
  .auth-screen .auth-card { padding: 14px 14px 16px; gap: 10px; border-radius: 18px; }
  .auth-screen .auth-title { font-size: 22px; }
  .auth-screen .auth-sub { font-size: 15px; }
}

/* نافذة الدخول بخطوتين فوق شاشة الدخول: نفس الهيكل الداكن (النافذة خارج .auth-screen فتحمل متغيراتها بنفسها) */
.modal-box:has(.auth-2fa) { --a-font: -apple-system, BlinkMacSystemFont, "SF Arabic", "SF Pro Text", "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  background: var(--c-forest-800); color: var(--c-paper); border: .5px solid var(--c-paper-a60); border-radius: 22px; color-scheme: dark; font-family: var(--a-font);
}
.auth-2fa h2 { margin: 0 0 12px; text-align: center; font: 700 22px/1.4 var(--a-font); color: var(--c-paper); }
.auth-2fa .hint { margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; background: var(--c-white-a06); color: var(--c-paper-a60); font: 400 14px/1.7 var(--a-font); }
.auth-2fa .otp-box { min-height: 56px; border: 1.5px solid var(--c-paper-a60); border-radius: 14px; background: var(--c-forest-700); color: var(--c-paper); }
.auth-2fa .otp-box.filled, .auth-2fa .otp-box.active { border-color: var(--c-sand); }
.auth-2fa .otp-box.active { box-shadow: 0 0 0 3px var(--c-sand-a22); }
.auth-2fa .error { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; color: var(--c-sos); background: var(--c-sos-a14); border: 1px solid var(--c-sos-a40); font: 600 14.5px/1.6 var(--a-font); }
.auth-2fa .row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.auth-2fa .row-actions > button { flex: 1 1 140px; min-height: 52px; border-radius: 14px; font: 700 16px/1.2 var(--a-font); }
.auth-2fa .primary { background: var(--c-sand); color: var(--c-sand-ink); border: 1px solid var(--c-sand); }
.auth-2fa .primary:disabled { background: var(--c-sand-a22); border-color: transparent; color: var(--c-paper-a60); cursor: not-allowed; }
.auth-2fa .ghost { background: transparent; color: var(--c-paper); border: 1px solid var(--c-paper-a60); font-weight: 600; }
.auth-2fa button:focus-visible { outline: 2px solid var(--c-sand); outline-offset: 3px; }

/* فحص قابلية الاستخدام 320/390: قائمة اللغة بخط 16px (لا تكبير تلقائي في iOS)، وأزرار تكبير الخريطة بهدف لمس 44 */
.auth-screen .auth-card > .language-select, body:has(#login.auth-screen:not([hidden])) #lang-bar select { font-size: max(16px, 1rem); }
.auth-screen .auth-map .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 22px; }

/* قبول دعوة عضو (قرار المالك 2026-11-13، المعاينة المعتمدة): ملخص الدعوة وحالة «الرابط منتهٍ» على هيكل الدخول نفسه */
.auth-screen .auth-invite-sum { display: grid; border: 1px solid var(--c-sand-a22); border-radius: 16px; background: var(--c-white-a06); overflow: hidden; }
.auth-screen .auth-invite-sum > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--c-white-a06); }
.auth-screen .auth-invite-sum > div:last-child { border-bottom: 0; }
.auth-screen .auth-invite-sum span { font-size: 14px; color: var(--c-paper-a80); flex: none; }
.auth-screen .auth-invite-sum b { font-size: 15.5px; font-weight: 800; text-align: end; overflow-wrap: anywhere; }
.auth-screen .auth-dead { display: grid; justify-items: center; gap: 10px; padding: 8px 0 4px; }
.auth-screen .fx-mark { background: var(--c-sand-a12); }

/* ── S1: مطابقة إطارات m-login / m-signup-* / m-verify-email (دفتر القيادة) ──
 * إجراء رئيسي واحد بلون --primary، عنوان وصف بمحاذاة البداية، بطاقة هادئة بلا زجاج على الجوال، صورة علوية أعلى. */
.auth-screen::before { height: min(40dvh, 320px); }
.auth-screen .auth-card .primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.auth-screen .auth-card .primary:disabled { background: var(--c-sand-a22); border-color: transparent; color: var(--c-paper-a80); }
.auth-2fa .primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.auth-screen .auth-title { text-align: start; font-size: 28px; }
.auth-screen .auth-sub, .auth-screen .auth-status { text-align: start; color: var(--c-paper-a80); font-size: 15px; }
.auth-screen .auth-logo { margin: 0 0 0 auto; width: 120px; max-width: 120px; }
html[dir="ltr"] .auth-screen .auth-logo { margin: 0 auto 0 0; }
.auth-screen .otp-screen { text-align: start; }
.auth-screen .otp-email-row { justify-content: flex-start; }
.auth-screen .auth-field > label { font-size: 14px; }
.auth-screen .auth-input input, .auth-screen .otp-box { background: var(--c-forest-800); border-color: var(--c-paper-a60); }
.auth-screen .auth-input input:focus { border-color: var(--c-sand); }
.auth-screen .auth-link { text-decoration: none; }
.auth-screen .account-type-card { background: var(--c-forest-800); }
@media (max-width: 767px) {
  .auth-screen .auth-card { background: transparent; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; padding-inline: 4px; }
}
@media (min-width: 768px) { .auth-screen .auth-card { background: var(--c-forest-800); } }
.auth-screen .oauth-buttons { grid-template-columns: 1fr 1fr; }
@media (max-width: 359px) { .auth-screen .oauth-buttons { grid-template-columns: 1fr; } }

/* الشعار الرسمي «رغث»: ترويسة عربية بنسختين (للفاتح/للداكن)، تظهر واحدة بحسب المظهر */
.auth-screen .auth-brand { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; }
.auth-screen .auth-brand .auth-logo { width: auto; height: 56px; max-width: none; margin: 0; }
.brand-art-for-light { display: none !important; }
html[data-theme="light"] .brand-art-for-light { display: block !important; }
html[data-theme="light"] .brand-art-for-dark { display: none !important; }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) .brand-art-for-light { display: block !important; }
  html:not([data-theme]) .brand-art-for-dark { display: none !important; }
}
