/* ===========================================================================
   پنجرهٔ ورود — مشترکِ قالب‌ها. دور ۸۱ (`_shared/auth_entry.html`)
   قاب، سایه و پرده مالِ اینجاست؛ درونش خودِ صفحهٔ ورود است (`?embed=1`). رنگ‌ها از نشانه‌های قالب.
   =========================================================================== */
.auth-entry {
    width: min(440px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 0;
    border-radius: var(--theme-radius-lg, 20px);
    background: var(--theme-surface, #fff);
    box-shadow: 0 30px 80px -20px rgb(15 23 42 / .45);
    overflow: hidden;
}
.auth-entry[open] { animation: auth-entry-in .22s cubic-bezier(.2, .7, .2, 1); }
.auth-entry::backdrop { background: rgb(15 23 42 / .55); backdrop-filter: blur(3px); }
@keyframes auth-entry-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.auth-entry__frame { display: block; width: 100%; height: 520px; max-height: calc(100dvh - 24px); border: 0; background: transparent; }

/* دکمهٔ بستن روی سرِ رنگیِ کارت؛ جای دکمهٔ «بازگشت»ِ صفحه */
.auth-entry__close {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    z-index: 2;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgb(255 255 255 / .35);
    border-radius: 50%;
    background: rgb(255 255 255 / .16);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s ease;
}
.auth-entry__close:hover { background: rgb(255 255 255 / .28); }
.auth-entry__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.auth-entry__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.auth-entry__loading { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: var(--theme-surface, #fff); }
.auth-entry__loading[hidden] { display: none; }
.auth-entry__loading span {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--theme-line, #e5e7eb);
    border-top-color: var(--theme-accent, #0d8aff);
    animation: auth-entry-spin .8s linear infinite;
}
@keyframes auth-entry-spin { to { transform: rotate(360deg); } }

/* صفحهٔ پشت پنجره اسکرول نمی‌خورد */
html.auth-entry-open { overflow: hidden; }

/* گوشی: پنجره تمام‌صفحه، مثلِ صفحهٔ ورود */
@media (max-width: 520px) {
    .auth-entry { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
    .auth-entry__frame { height: 100dvh !important; max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-entry[open] { animation: none; }
    .auth-entry__loading span { animation-duration: 2s; }
}
