/* =====================================================================
   صفحات ورود و ثبت‌نام — پوستهٔ دوستونه: پنل برند تیره با صحنهٔ سه‌بعدی
   و کارت فرم شیشه‌ای؛ تب‌های segmented، ورودی‌های آیکن‌دار، کد یکبارمصرف
   با خانه‌های جدا، نمایش رمز و سنجش قدرت آن. رنگ‌ها از site-theme.css و public-3d.css.
   ===================================================================== */
.x-auth .x-footer { margin-top: 40px; }

.au-wrap { position: relative; isolation: isolate; padding: 2.5rem 0 3rem; overflow: hidden; }
.au-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.au-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; }
.au-blob.b1 { width: 420px; height: 420px; background: #2AABEE; top: -140px; inset-inline-end: -80px; }
.au-blob.b2 { width: 360px; height: 360px; background: #7B61FF; bottom: -160px; inset-inline-start: -100px; opacity: .3; }
.au-grid { position: absolute; inset: 0; opacity: .5;
    background-image: radial-gradient(rgba(34,158,217,.18) 1px, transparent 1px); background-size: 22px 22px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }

/* ---------- پوسته ---------- */
.au-shell {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); max-width: 1040px; margin: 0 auto;
    border-radius: 32px; overflow: hidden; background: var(--surface);
    border: 1px solid var(--x-glass-border); box-shadow: 0 30px 80px rgba(15, 27, 45, .14), 0 2px 6px rgba(15,27,45,.05);
    animation: au-in .6s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes au-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------- پنل برند ---------- */
.au-side {
    position: relative; color: #fff; overflow: hidden; isolation: isolate;
    background: radial-gradient(120% 80% at 100% 0%, rgba(42,171,238,.45), transparent 60%),
                radial-gradient(90% 70% at 0% 100%, rgba(123,97,255,.4), transparent 60%),
                linear-gradient(160deg, var(--x-hero-2), var(--x-hero-1));
}
.au-side::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 34px 34px; mask-image: linear-gradient(180deg, #000, transparent); -webkit-mask-image: linear-gradient(180deg, #000, transparent); }
.au-side-inner { padding: 2.6rem 2.4rem; height: 100%; display: flex; flex-direction: column; }
.au-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.1rem; }
.au-side-title { font-weight: 800; font-size: clamp(1.4rem, 2.3vw, 1.85rem); line-height: 1.45; margin: 2rem 0 .6rem; letter-spacing: -.01em; }
.au-side-lead { color: rgba(255,255,255,.7); line-height: 1.9; margin: 0; }
.au-feats { list-style: none; padding: 0; margin: auto 0 0; display: grid; gap: .7rem; }
.au-feats li { display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.86); font-size: .93rem; }
.au-feats i { width: 34px; height: 34px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); color: #6FD3FF; }

/* صحنهٔ سه‌بعدی */
.au-scene { perspective: 1000px; display: flex; justify-content: center; padding: 2.2rem 0 2.4rem; }
.au-card3d { position: relative; width: min(290px, 100%); transform-style: preserve-3d; transform: rotateX(14deg) rotateY(-16deg) rotateZ(2deg);
    animation: au-float 7s ease-in-out infinite; }
[dir="rtl"] .au-card3d { transform: rotateX(14deg) rotateY(16deg) rotateZ(-2deg); animation-name: au-float-rtl; }
@keyframes au-float { 0%,100% { transform: rotateX(14deg) rotateY(-16deg) rotateZ(2deg) translateY(0); } 50% { transform: rotateX(8deg) rotateY(-8deg) rotateZ(1deg) translateY(-10px); } }
@keyframes au-float-rtl { 0%,100% { transform: rotateX(14deg) rotateY(16deg) rotateZ(-2deg) translateY(0); } 50% { transform: rotateX(8deg) rotateY(8deg) rotateZ(-1deg) translateY(-10px); } }
.au-ad { background: #fff; color: #0F1B2D; border-radius: 20px; padding: 16px; box-shadow: 0 30px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.4) inset;
    display: flex; flex-direction: column; gap: 8px; }
.au-ad-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.au-ad-av { width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--x-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.au-ad-tag { margin-inline-start: auto; font-size: .7rem; font-weight: 600; color: #229ED9; background: rgba(34,158,217,.1); padding: 2px 8px; border-radius: 999px; }
.au-line { display: block; height: 8px; border-radius: 4px; background: #E6ECF2; width: 100%; }
.au-line.w80 { width: 80%; } .au-line.w60 { width: 60%; } .au-line.w40 { width: 46px; background: rgba(255,255,255,.35); }
.au-ad-btn { display: block; height: 32px; border-radius: 10px; background: var(--x-grad); margin-top: 6px; box-shadow: 0 8px 18px rgba(34,158,217,.4); }
.au-chip { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 14px; font-size: .8rem;
    color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 14px 30px rgba(0,0,0,.3); transform: translateZ(60px); animation: au-bob 5s ease-in-out infinite; }
.au-chip.c1 { top: -18px; inset-inline-end: -26px; }
.au-chip.c2 { bottom: -38px; inset-inline-start: -24px; animation-delay: -2s; }
.au-chip.c3 { top: 44%; inset-inline-end: -22px; padding: 8px; border-radius: 50%; background: linear-gradient(135deg, #34D399, #10B981); border: 0; animation-delay: -1s; }
.au-chip i { color: #6FD3FF; } .au-chip.c3 i { color: #fff; font-size: 1.1rem; }
.au-spark { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.au-spark i { width: 4px; border-radius: 2px; background: #6FD3FF; }
.au-spark i:nth-child(1) { height: 30%; } .au-spark i:nth-child(2) { height: 55%; } .au-spark i:nth-child(3) { height: 40%; } .au-spark i:nth-child(4) { height: 80%; } .au-spark i:nth-child(5) { height: 100%; }
@keyframes au-bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -7px; } }

/* ---------- کارت فرم ---------- */
.au-main { padding: 2.6rem clamp(1.25rem, 4vw, 3rem) 1.6rem; display: flex; flex-direction: column; justify-content: center; }
.au-card { width: 100%; max-width: 420px; margin: 0 auto; }
.au-head { text-align: center; margin-bottom: 1.6rem; }
.au-ic { width: 60px; height: 60px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem;
    color: #fff; background: var(--x-grad); box-shadow: 0 12px 28px var(--x-glow); margin-bottom: 1rem;
    transform: perspective(240px) rotateX(10deg) rotateY(-10deg); }
.au-ic.ok { background: linear-gradient(135deg, #34D399, #10B981); box-shadow: 0 12px 28px rgba(16,185,129,.4); }
.au-ic.bad { background: linear-gradient(135deg, #FB7185, #E11D48); box-shadow: 0 12px 28px rgba(225,29,72,.35); }
.au-title { font-weight: 800; font-size: 1.5rem; margin: 0 0 .4rem; letter-spacing: -.01em; }
.au-lead { color: var(--text-muted, #6B7A90); margin: 0; font-size: .94rem; line-height: 1.8; }
.au-foot { text-align: center; font-size: .78rem; color: var(--text-muted, #6B7A90); margin-top: 1.6rem; }
.au-foot a { color: inherit; text-decoration: none; } .au-foot a:hover { color: var(--brand-primary); text-decoration: underline; }
.au-foot .bi-shield-lock-fill { color: #10B981; }

/* تب‌های segmented */
.au-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 4px; border-radius: 14px;
    background: var(--surface-2, rgba(15,27,45,.05)); border: 1px solid var(--border); margin-bottom: 1.4rem; }
.au-seg .nav-link { border: 0; border-radius: 10px !important; color: var(--text-muted, #6B7A90); font-weight: 600; font-size: .9rem; padding: .6rem .5rem;
    display: flex; align-items: center; justify-content: center; gap: .45rem; background: transparent; transition: color .2s, background .2s, box-shadow .2s; }
.au-seg .nav-link.active { background: var(--surface); color: var(--brand-primary); box-shadow: 0 4px 14px rgba(15,27,45,.1), 0 0 0 1px var(--border); }

/* فیلدها */
.au-field { margin-bottom: 1rem; }
.au-field > .form-label { font-weight: 600; font-size: .86rem; margin-bottom: .4rem; }
.au-input { position: relative; display: flex; align-items: center; }
.au-input > .bi:first-child { position: absolute; inset-inline-start: 14px; color: var(--text-muted, #8A97AA); pointer-events: none; font-size: 1.05rem; transition: color .2s; }
.au-input .form-control { height: 52px; border-radius: 14px; padding-inline-start: 44px; background: var(--surface-2, #F5F8FB); border: 1.5px solid transparent;
    font-size: 1rem; transition: border-color .2s, background .2s, box-shadow .2s; }
.au-input .form-control:hover { border-color: var(--border); }
.au-input .form-control:focus { background: var(--surface); border-color: var(--brand-primary); box-shadow: 0 0 0 4px var(--brand-primary-soft); }
.au-input:focus-within > .bi:first-child { color: var(--brand-primary); }
.au-input .form-control.input-validation-error { border-color: #E11D48; }
.au-input .form-control.has-toggle { padding-inline-end: 46px; }
.au-input .form-control.ltr::placeholder { direction: ltr; }
[dir="rtl"] .au-input .form-control.ltr { text-align: left; direction: ltr; }
.au-eye { position: absolute; inset-inline-end: 6px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted, #8A97AA); }
.au-eye:hover { background: var(--brand-primary-soft); color: var(--brand-primary); }
.au-prefix { position: absolute; inset-inline-end: 12px; font-size: .78rem; font-weight: 600; color: var(--text-muted, #8A97AA); direction: ltr;
    padding: 3px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); pointer-events: none; }
.au-hint { font-size: .78rem; color: var(--text-muted, #6B7A90); margin-top: .4rem; display: flex; gap: .35rem; align-items: flex-start; }
.au-field .text-danger { display: block; margin-top: .3rem; font-size: .8rem; }

/* سنجش قدرت رمز */
.au-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: .55rem; }
.au-meter i { height: 4px; border-radius: 2px; background: var(--border); transition: background .25s; }
.au-meter[data-level="1"] i:nth-child(-n+1) { background: #E11D48; }
.au-meter[data-level="2"] i:nth-child(-n+2) { background: #F59E0B; }
.au-meter[data-level="3"] i:nth-child(-n+3) { background: #22C55E; }
.au-meter[data-level="4"] i { background: #10B981; }
.au-meter-label { font-size: .74rem; color: var(--text-muted, #6B7A90); margin-top: .3rem; min-height: 1.1em; }

/* دکمه‌ها */
.au-btn { height: 52px; border-radius: 14px; font-weight: 700; font-size: 1rem; border: 0; color: #fff; width: 100%;
    background: var(--x-grad); background-size: 140% 100%; box-shadow: 0 12px 26px rgba(34,158,217,.35);
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; transition: transform .15s, box-shadow .2s, background-position .4s; }
.au-btn:hover { color: #fff; background-position: 100% 0; box-shadow: 0 16px 32px rgba(34,158,217,.45); transform: translateY(-1px); }
.au-btn:active { transform: translateY(0); }
.au-btn:disabled, .au-btn.is-busy { opacity: .8; pointer-events: none; }
.au-btn .spinner-border { width: 1.1rem; height: 1.1rem; border-width: .15em; }
[dir="rtl"] .au-btn .bi-arrow-right { transform: scaleX(-1); }
.au-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: 1.1rem; font-size: .86rem; }
.au-row a { font-weight: 600; text-decoration: none; }

.au-or { display: flex; align-items: center; gap: .9rem; color: var(--text-muted, #8A97AA); font-size: .8rem; margin: 1.5rem 0 1.1rem; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.au-social { display: grid; gap: .6rem; }
.au-sbtn { height: 50px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text, inherit); font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: .6rem; text-decoration: none; transition: border-color .2s, background .2s, transform .15s; }
.au-sbtn:hover { border-color: var(--brand-primary); background: var(--brand-primary-soft); color: inherit; transform: translateY(-1px); }
.au-tg { display: flex; justify-content: center; min-height: 44px; padding: .25rem; border-radius: 14px; border: 1.5px dashed var(--border); }
.au-switch { text-align: center; font-size: .9rem; margin-top: 1.4rem; color: var(--text-muted, #6B7A90); }
.au-switch a { font-weight: 700; text-decoration: none; }
.au-note { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 14px; font-size: .86rem; line-height: 1.8;
    background: var(--brand-primary-soft); color: var(--text, inherit); margin-bottom: 1.2rem; }
.au-note > .bi { color: var(--brand-primary); font-size: 1.1rem; }
.au-note a { font-weight: 700; }
.au-card .alert { border-radius: 14px; border: 0; }
.au-card .validation-summary-valid { display: none; }

/* کپچا */
.au-captcha { margin-bottom: 1.1rem; }
.au-captcha .form-label { font-weight: 600; font-size: .86rem; margin-bottom: .4rem; }
.au-captcha-row { display: flex; gap: .5rem; align-items: stretch; }
.au-captcha .captcha-image { display: inline-flex; align-items: center; justify-content: center; border-radius: 14px !important; overflow: hidden;
    background: #fff; border: 1.5px solid var(--border) !important; height: 52px; padding: 0 6px; flex: none; }
.au-captcha .captcha-image svg { max-height: 46px; width: auto; }
.au-captcha .captcha-refresh { width: 52px; height: 52px; flex: none; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted, #6B7A90); }
.au-captcha .captcha-refresh:hover { color: var(--brand-primary); border-color: var(--brand-primary); }
.au-captcha .captcha-refresh.spin i { display: inline-block; animation: au-spin .6s linear; }
@keyframes au-spin { to { transform: rotate(360deg); } }
.au-captcha .au-input { flex: 1; min-width: 0; }
.au-captcha .au-input .form-control { text-align: center; letter-spacing: .3em; font-weight: 700; padding-inline-start: 14px; }

/* کد یکبارمصرف: یک input واقعی روی خانه‌های نمایشی (پشتیبانی از autofill و paste) */
.au-otp { position: relative; display: flex; gap: .6rem; justify-content: center; direction: ltr; margin: .4rem 0 .4rem; }
.au-otp .au-box { width: 56px; height: 64px; border-radius: 16px; background: var(--surface-2, #F5F8FB); border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; transition: border-color .15s, box-shadow .15s, transform .15s; }
.au-otp .au-box.filled { border-color: var(--brand-primary); background: var(--surface); }
.au-otp .au-box.cur { border-color: var(--brand-primary); box-shadow: 0 0 0 4px var(--brand-primary-soft); }
.au-otp .au-box.cur:empty::after { content: ""; width: 2px; height: 26px; background: var(--brand-primary); animation: au-caret 1s steps(1) infinite; }
@keyframes au-caret { 50% { opacity: 0; } }
.au-otp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; caret-color: transparent; cursor: text; }
.au-otp.err .au-box { border-color: #E11D48; animation: au-shake .35s; }
@keyframes au-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.au-phone-pill { display: inline-flex; align-items: center; gap: .4rem; direction: ltr; font-weight: 700; padding: .25rem .75rem; border-radius: 999px;
    background: var(--surface-2, #F5F8FB); border: 1px solid var(--border); color: var(--text, inherit); }
.au-resend { display: flex; justify-content: center; align-items: center; gap: .5rem; margin-top: 1.1rem; font-size: .88rem; }
.au-resend .btn-link { font-weight: 700; text-decoration: none; padding: 0; }
.au-resend .btn-link:disabled { color: var(--text-muted, #8A97AA); opacity: 1; }
.au-resend .countdown { font-variant-numeric: tabular-nums; }

/* ---------- تاریک ---------- */
[data-bs-theme="dark"] .au-shell { box-shadow: 0 30px 80px rgba(0,0,0,.5); }
[data-bs-theme="dark"] .au-input .form-control,
[data-bs-theme="dark"] .au-otp .au-box { background: rgba(255,255,255,.04); }
[data-bs-theme="dark"] .au-input .form-control:focus { background: rgba(255,255,255,.06); }
[data-bs-theme="dark"] .au-seg { background: rgba(255,255,255,.04); }
[data-bs-theme="dark"] .au-seg .nav-link.active { background: rgba(255,255,255,.08); color: #6FD3FF; }
[data-bs-theme="dark"] .au-blob { opacity: .25; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 991.98px) {
    .au-shell { grid-template-columns: 1fr; max-width: 520px; }
    .au-side { display: none; }
}
@media (max-width: 575.98px) {
    .au-wrap { padding: 1rem 0 1.5rem; }
    .au-shell { border-radius: 26px; }
    .au-main { padding: 1.8rem 1.15rem 1.2rem; }
    .au-otp { gap: .45rem; }
    .au-otp .au-box { width: 50px; height: 58px; }
    .au-title { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
    .au-shell, .au-card3d, .au-chip { animation: none !important; }
}
[dir="rtl"] .au-switch .bi-arrow-left-short { display: inline-block; transform: scaleX(-1); }
