/*!
 * مدد — صفحات الدخول والتسجيل (A01–A07) — الاتجاه A «هادئ سريري» (10.0)
 * تخطيط مقسوم: لوحة النموذج (بداية الصفحة) + لوحة صورة مع رسالة (نهاية الصفحة، تختفي ≤1024px).
 * الأجزاء المشتركة: PARTIAL:_AuthTop (الشعار + اللغة + الثيم) و PARTIAL:_AuthFoot (الحقوق والروابط).
 * بالمرحلة البرمجية: Views/Shared/_AuthLayout.cshtml.
 */

body.jb-auth-body { background: var(--jb-canvas); }
.jb-auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
@media (max-width: 1024px) { .jb-auth { grid-template-columns: minmax(0, 1fr); } }

/* ===== لوحة النموذج ===== */
.jb-auth__panel { display: flex; flex-direction: column; min-width: 0; padding: var(--sp-3) clamp(1rem, .5rem + 3vw, 3rem) var(--sp-4); }
.jb-auth__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 60px; }
.jb-auth__top .jb-brand .jb-logo { height: 42px; width: auto; }
.jb-auth__actions { display: flex; align-items: center; gap: var(--sp-1); }
.jb-auth__main { flex: 1; display: flex; align-items: center; justify-content: center; padding-block: clamp(1.5rem, 1rem + 3vw, 3.5rem); }
.jb-auth__main:focus { outline: none; }
.jb-auth__card { width: 100%; max-width: 440px; }
.jb-auth__card--wide { max-width: 600px; }

.jb-auth__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; margin-block-end: var(--sp-4); border-radius: var(--r-lg); background: var(--jb-primary-subtle); color: var(--jb-primary); font-size: 1.5rem; }
.jb-auth__title { margin: 0 0 var(--sp-2); font-size: clamp(1.6rem, 1.35rem + 1vw, 2.1rem); line-height: 1.3; }
.jb-auth__lead { margin: 0 0 var(--sp-5); color: var(--jb-text-muted); }
.jb-auth__form { display: grid; gap: var(--sp-4); }
.jb-auth__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.jb-auth__row a, .jb-auth__link { font-weight: 600; text-decoration: none; }
.jb-auth__row a:hover, .jb-auth__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.jb-auth__submit { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; width: 100%; min-height: 50px; }
.jb-auth__alt { margin: var(--sp-5) 0 0; text-align: center; color: var(--jb-text-muted); }
.jb-auth__alt + .jb-auth__alt { margin-block-start: var(--sp-2); }
.jb-auth__sep { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-5) 0 0; color: var(--jb-text-muted); font-size: var(--fs-xs); font-weight: 600; }
.jb-auth__sep::before, .jb-auth__sep::after { content: ""; flex: 1; height: 1px; background: var(--jb-border); }
.jb-auth__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.jb-auth__grid > .jb-auth__full { grid-column: 1 / -1; }
@media (max-width: 560px) { .jb-auth__grid { grid-template-columns: minmax(0, 1fr); } }
.jb-auth .jb-alert[hidden] { display: none; }
.jb-auth .jb-alert:focus { outline: none; }

/* ===== الفوتر ===== */
.jb-auth__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); padding-block-start: var(--sp-3); border-block-start: 1px solid var(--jb-border); color: var(--jb-text-muted); font-size: var(--fs-xs); }
.jb-auth__foot ul { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin: 0; padding: 0; list-style: none; }
.jb-auth__foot a { display: inline-flex; align-items: center; min-height: 32px; color: inherit; text-decoration: none; }
.jb-auth__foot a:hover { color: var(--jb-primary); text-decoration: underline; }
.jb-auth__foot p { margin: 0; }

/* ===== لوحة الصورة ===== */
.jb-auth__aside { position: sticky; top: var(--sp-3); align-self: start; display: flex; flex-direction: column; justify-content: flex-end; height: calc(100vh - 2 * var(--sp-3)); height: calc(100dvh - 2 * var(--sp-3)); margin: var(--sp-3); margin-inline-start: 0; padding: clamp(2rem, 1.5rem + 2vw, 3.5rem); overflow: hidden; border-radius: var(--r-xl); color: #FFFFFF; isolation: isolate; }
@media (max-width: 1024px) { .jb-auth__aside { display: none; } }
.jb-auth__aside img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.jb-auth__aside::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 45% at 50% 100%, rgba(46, 196, 206, .16), transparent 70%), linear-gradient(to top, rgba(15, 31, 61, .94) 0%, rgba(15, 31, 61, .72) 42%, rgba(15, 31, 61, .12) 100%); }
.jb-auth__quote { max-width: 34rem; }
.jb-auth__quote h2 { margin: 0 0 var(--sp-3); color: #FFFFFF; font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); line-height: 1.35; }
.jb-auth__quote p { margin: 0 0 var(--sp-4); color: #DFE6F0; }
.jb-auth__points { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.jb-auth__points li { display: flex; align-items: flex-start; gap: var(--sp-2); color: #EEF3FA; font-weight: 500; }
.jb-auth__points .bi { flex: none; margin-block-start: .25rem; color: #9CC3FF; }

/* كلمة المرور (jb-pass / jb-meter / jb-rules) نُقلت إلى components.css */

/* ===== لوحة المعاينة (بروتوتايب فقط) ===== */
.jb-proto { margin-block-start: var(--sp-6); padding: var(--sp-4); border-radius: var(--r-lg); border: 1px dashed var(--jb-border-input); background: var(--jb-surface); }
.jb-proto__title { display: flex; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-1); font-size: var(--fs-sm); font-weight: 700; }
.jb-proto__hint { margin: 0 0 var(--sp-3); color: var(--jb-text-muted); font-size: var(--fs-xs); }
.jb-proto__sub { margin: var(--sp-3) 0 var(--sp-2); color: var(--jb-text-muted); font-size: var(--fs-xs); font-weight: 700; }
.jb-proto__list { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.jb-proto__list .btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; font-size: var(--fs-xs); font-weight: 600; }

/* بطاقات الاختيار jb-choice / jb-choices من components.css */

/* ===== معالج التسجيل (A02) والخطوات ===== */
.au-wizard { display: grid; }
.au-step { display: grid; gap: var(--sp-4); margin: 0; padding: 0; border: 0; min-width: 0; }
.au-step[hidden] { display: none; }
.au-step__title { float: none; width: auto; margin: 0; padding: 0; font-size: 1.25rem; font-weight: 700; }
.au-step__title:focus { outline: none; }
.au-step__help { margin-block-start: calc(-1 * var(--sp-2)); font-size: var(--fs-sm); }
.au-step__nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); margin-block-start: var(--sp-2); }
.au-step__nav .btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 48px; }
.au-step__nav .btn[data-jb-step-prev] { margin-inline-end: auto; }
@media (max-width: 480px) { .au-step__nav .btn { flex: 1 1 auto; justify-content: center; } }
/* «السابق»: عكس سهم «للأمام» بكل اتجاه */
.au-back { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .au-back { transform: none; }
.au-types { margin: 0; padding: 0; border: 0; min-width: 0; }
.au-types .jb-help { margin-block-end: var(--sp-2); }

.au-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 560px) { .au-plans { grid-template-columns: minmax(0, 1fr); } }
.au-plan { position: relative; display: flex; gap: var(--sp-2); padding: var(--sp-4); border-radius: var(--r-lg); border: 1px solid var(--jb-border-input); background: var(--jb-surface); cursor: pointer; transition: border-color var(--mo-fast) var(--mo-ease), box-shadow var(--mo-fast) var(--mo-ease); }
.au-plan input { flex: none; margin-block-start: .3rem; accent-color: var(--jb-primary); width: 1.1rem; height: 1.1rem; }
.au-plan:hover { border-color: var(--jb-primary); }
.au-plan:has(input:checked) { border-color: var(--jb-primary); box-shadow: inset 0 0 0 1px var(--jb-primary); background: var(--jb-primary-subtle); }
.au-plan:has(input:focus-visible) { outline: 3px solid var(--jb-primary); outline-offset: 2px; }
.au-plan__body { display: grid; gap: 2px; min-width: 0; }
.au-plan__name { font-weight: 700; font-size: 1.0625rem; }
.au-plan__price { font-weight: 700; color: var(--jb-primary); }
.au-plan__limits { color: var(--jb-text-muted); font-size: var(--fs-xs); }
.au-step__compare { margin: calc(-1 * var(--sp-2)) 0 0; font-size: var(--fs-sm); }
.au-step__compare a { display: inline-flex; align-items: center; gap: .35rem; min-height: 32px; }
.au-terms { padding: var(--sp-4); border-radius: var(--r-lg); background: var(--jb-surface); border: 1px solid var(--jb-border); }
.au-terms .form-check-label a { font-weight: 600; }

/* ===== حالات الإرسال والصفحات الصغيرة (A03–A07) ===== */
.au-done { display: grid; justify-items: start; gap: var(--sp-1); }
.au-done:focus { outline: none; }
.au-done__icon { background: var(--jb-st-completed-bg); color: var(--jb-st-completed); }
.au-done__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-block-start: var(--sp-2); }
.au-done__actions .btn { min-height: 48px; }
.au-done__proto { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-block-start: var(--sp-4); }
.au-expired { margin-block-end: var(--sp-4); }

.au-invite { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-lg); background: var(--jb-surface); border: 1px solid var(--jb-border); }
.au-invite__logo { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-md); background: var(--jb-primary); color: var(--jb-on-primary); font-size: 1.4rem; font-weight: 700; }
.au-invite b { display: block; font-size: 1.0625rem; }
.au-invite__text { color: var(--jb-text-muted); font-size: var(--fs-sm); }

.au-verify .jb-otp { margin-block: var(--sp-1); }
.au-verify .jb-otp input[aria-invalid="true"] { border-color: var(--jb-danger); }
.au-verify__error { justify-content: center; }
.au-verify__email { unicode-bidi: isolate; }
.au-verify__resend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem; color: var(--jb-text-muted); font-size: var(--fs-sm); }
.au-verify__btn { min-height: 40px; padding-inline: .25rem; font-weight: 600; text-decoration: none; }
.au-verify__btn:disabled { color: var(--jb-text-muted); opacity: 1; }
.au-verify__btn [data-au-timer][hidden] { display: none; }

.au-section { display: grid; gap: var(--sp-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.au-section__title { float: none; width: auto; margin: 0; padding: 0 0 var(--sp-2); border-block-end: 1px solid var(--jb-border); font-size: 1.0625rem; font-weight: 700; }
.au-logo { display: flex; align-items: flex-start; gap: var(--sp-3); }
.au-logo__preview { flex: none; display: grid; place-items: center; width: 72px; height: 72px; overflow: hidden; border-radius: var(--r-md); border: 1px dashed var(--jb-border-input); background: var(--jb-surface-2); color: var(--jb-text-muted); font-size: 1.5rem; }
.au-logo__preview img { width: 100%; height: 100%; object-fit: contain; }
.au-logo__body { display: grid; gap: var(--sp-1); justify-items: start; min-width: 0; }
.au-logo__body .btn { display: inline-flex; align-items: center; gap: .35rem; }
.au-logo__body:has(input:focus-visible) .btn { outline: 3px solid var(--jb-primary); outline-offset: 2px; }

.au-next { display: grid; gap: var(--sp-2); margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.au-next li { display: flex; align-items: center; gap: var(--sp-2); color: var(--jb-text-muted); font-weight: 600; }
.au-next li.is-done { color: var(--jb-success); }
.au-next li.is-current { color: var(--jb-primary); }
