/* ==========================================================================
   صفحه‌های ورود — «شفق» با انیمیشن
   هم‌خانواده با صفحه‌ی انتخاب پرتال؛ فقط برای همین دو صفحه.
   ========================================================================== */

.authx {
    /* تم محلی: صفحه‌ی ورود همیشه تیره است، مستقل از تم کاربر */
    --accent-fg: #ffffff;
    --text: #f4f8ff;
    --text-soft: #d7e3f7;
    --muted: rgba(214, 228, 248, .68);
    --muted-2: rgba(190, 208, 236, .45);
    --border: rgba(255, 255, 255, .12);
    --border-strong: rgba(255, 255, 255, .22);
    --surface: rgba(255, 255, 255, .06);
    --surface-2: rgba(255, 255, 255, .09);
    --surface-3: rgba(255, 255, 255, .12);
    --danger: #fda4af;
    --danger-soft: rgba(244, 63, 94, .16);
    --success: #6ee7b7;

    position: relative;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 44px) clamp(14px, 3vw, 28px);
    overflow: hidden;
    color: var(--text);
    background-color: #050b16;
    background-image:
        radial-gradient(1100px 780px at 84% -12%, rgba(43, 97, 178, .62), transparent 62%),
        radial-gradient(950px 720px at 4% 6%, rgba(23, 178, 168, .48), transparent 62%),
        radial-gradient(1100px 880px at 50% 118%, rgba(109, 94, 252, .38), transparent 64%),
        linear-gradient(180deg, #071022 0%, #050b16 100%);
}

/* ــــ هاله‌های متحرک پس‌زمینه ــــ */
.authx__aurora {
    position: absolute;
    inset: -18%;
    z-index: 0;
    pointer-events: none;
    filter: blur(72px);
    opacity: .6;
}

.authx__aurora span {
    position: absolute;
    width: 42vmax;
    height: 42vmax;
    border-radius: 50%;
    mix-blend-mode: screen;
    animation: authx-drift 30s cubic-bezier(.45, 0, .55, 1) infinite alternate;
}

.authx__aurora span:nth-child(1) { inset-inline-start: 6%;  inset-block-start: 2%;  background: radial-gradient(circle, rgba(23, 178, 168, .9), transparent 66%); }
.authx__aurora span:nth-child(2) { inset-inline-end: 0%;  inset-block-start: 10%; background: radial-gradient(circle, rgba(43, 97, 178, .95), transparent 66%); animation-delay: -10s; animation-duration: 36s; }
.authx__aurora span:nth-child(3) { inset-inline-start: 30%; inset-block-end: -12%; background: radial-gradient(circle, rgba(109, 94, 252, .8), transparent 66%); animation-delay: -20s; animation-duration: 42s; }

@keyframes authx-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(5%, -7%, 0) scale(1.16); }
}

/* دانه‌ی ریز برای نرم‌شدن گرادیان */
.authx::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ــــ چیدمان ــــ */
.authx__wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.authx__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
}

.authx__logo {
    display: block;
    height: clamp(78px, 10vw, 108px);
    width: auto;
    max-width: 100%;
    filter: drop-shadow(0 16px 30px rgba(3, 8, 18, .7)) drop-shadow(0 0 22px rgba(120, 175, 255, .25));
    animation: authx-logo-in .8s cubic-bezier(.2, .8, .3, 1) both;
}

.authx__title {
    margin: 6px 0 0;
    font-size: clamp(1.05rem, 2vw, 1.22rem);
    font-weight: 800;
    letter-spacing: -.2px;
    background: linear-gradient(180deg, #fff, #c6d9f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: authx-rise .7s cubic-bezier(.2, .8, .3, 1) .1s both;
}

.authx__sub {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    animation: authx-rise .7s cubic-bezier(.2, .8, .3, 1) .18s both;
}

/* ــــ کارت شیشه‌ای ــــ */
.authx__card {
    position: relative;
    width: 100%;
    padding: 26px 24px 18px;
    border-radius: 26px;
    background: linear-gradient(158deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04) 48%, rgba(255, 255, 255, .07));
    border: 1px solid rgba(255, 255, 255, .16);
    box-shadow:
        0 40px 90px -40px rgba(2, 6, 18, .95),
        inset 0 1px 0 rgba(255, 255, 255, .18);
    backdrop-filter: blur(26px) saturate(170%);
    -webkit-backdrop-filter: blur(26px) saturate(170%);
    animation: authx-card-in .75s cubic-bezier(.2, .8, .3, 1) .22s both;
}

.authx__card::before {
    content: '';
    position: absolute;
    inset-block-start: -1px;
    inset-inline: 14%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent);
    opacity: .7;
}

/* ورود پله‌ای فیلدها */
.authx__card form > * {
    animation: authx-rise .6s cubic-bezier(.2, .8, .3, 1) both;
}

.authx__card form > *:nth-child(1) { animation-delay: .30s; }
.authx__card form > *:nth-child(2) { animation-delay: .36s; }
.authx__card form > *:nth-child(3) { animation-delay: .42s; }
.authx__card form > *:nth-child(4) { animation-delay: .48s; }
.authx__card form > *:nth-child(5) { animation-delay: .54s; }
.authx__card form > *:nth-child(6) { animation-delay: .60s; }

/* ــــ فیلدها ــــ */
.authx .field__label {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 12px;
}

.authx .field__label .req { color: #fda4af; }

.authx .input {
    height: 46px;
    padding: 0 14px;
    font-size: 13.5px;
    color: #fff;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.authx .input::placeholder { color: rgba(255, 255, 255, .32); }

.authx .input:hover { border-color: rgba(255, 255, 255, .26); }

.authx .input:focus {
    background: rgba(255, 255, 255, .10);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 26%, transparent);
    outline: none;
}

.authx .field { margin-bottom: 14px; }
.authx .field__hint { color: var(--muted-2); font-size: 11px; }

.authx .check { color: var(--text-soft); font-size: 12px; }
.authx .check input {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, .30);
    background: rgba(255, 255, 255, .07);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.authx .check input:hover { border-color: rgba(255, 255, 255, .55); }
.authx .check input:checked { background: var(--accent); border-color: transparent; }
.authx .check input:checked::after {
    content: "";
    width: 9px;
    height: 5px;
    margin-top: -2px;
    border-inline-start: 2px solid #fff;
    border-block-end: 2px solid #fff;
    transform: rotate(-45deg);
}

.authx .small.muted, .authx .muted { color: var(--muted); }

/* ــــ دکمه با درخشش ــــ */
.authx .btn--primary,
.authx__btn {
    position: relative;
    width: 100%;
    height: 48px;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 16px 34px -16px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .28);
    overflow: hidden;
    isolation: isolate;
}

.authx .btn--primary::after,
.authx__btn::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, .38) 48%, transparent 64%);
    transform: translateX(-120%);
    animation: authx-sheen 4.5s cubic-bezier(.3, 0, .7, 1) 1.2s infinite;
}

.authx .btn--primary:hover,
.authx__btn:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
}

.authx .btn--primary:active,
.authx__btn:active { transform: translateY(0); }

@keyframes authx-sheen {
    0%, 55%   { transform: translateX(-120%); }
    85%, 100% { transform: translateX(120%); }
}

/* ــــ خطا ــــ */
.authx .toast--danger {
    background: var(--danger-soft);
    border: 1px solid rgba(244, 63, 94, .32);
    color: #ffe4e6;
    border-radius: 12px;
    animation: authx-headshake .5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes authx-headshake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60% { transform: translateX(5px); }
}

/* ــــ پانوشت کارت ــــ */
.authx__foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    text-align: center;
    font-size: 11px;
    line-height: 2;
    color: var(--muted-2);
}

.authx__foot a { color: #7dd3fc; font-weight: 600; }
.authx__foot a:hover { color: #bae6fd; }

.authx__themes {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

/* رنگ‌ها برای تم تیره‌ی این صفحه */
.authx .swatch {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}

.authx .swatch.is-active { border-color: #fff; }
.authx .swatch:hover { transform: scale(1.15); }

.authx__below {
    font-size: 11.5px;
    color: var(--muted-2);
    text-align: center;
    animation: authx-rise .7s cubic-bezier(.2, .8, .3, 1) .7s both;
}

.authx__below a { color: var(--muted); }
.authx__below a:hover { color: #fff; }

/* ــــ کلیدواژه‌ها ــــ */
@keyframes authx-logo-in {
    from { opacity: 0; transform: translateY(-14px) scale(.94); }
    to   { opacity: 1; transform: none; }
}

@keyframes authx-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

@keyframes authx-card-in {
    from { opacity: 0; transform: translateY(20px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

/* ــــ دسترس‌پذیری و واکنش‌گرا ــــ */
@media (prefers-reduced-motion: reduce) {
    .authx__aurora span,
    .authx__card form > *,
    .authx__logo,
    .authx__title,
    .authx__sub,
    .authx__card,
    .authx__below,
    .authx .toast--danger { animation: none !important; }

    .authx .btn--primary::after,
    .authx__btn::after { animation: none; opacity: 0; }
}

@media (max-width: 480px) {
    .authx__card { padding: 22px 18px 14px; border-radius: 22px; }
    .authx__aurora { filter: blur(52px); opacity: .45; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .authx__card { background: rgba(13, 22, 40, .96); }
}

@media print {
    .authx { background: #fff; color: #000; }
    .authx__aurora, .authx::after { display: none; }
}
