﻿/* auth/pages.css v2 — ورود / ثبت‌نام */

html:has(body.au) {
    height: 100%;
    margin: 0;
    padding: 0;
}

.au {
    --au-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --au-cyan: #06b6d4;
    --au-cyan-dark: #0891b2;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    color: #f8fafc;
    background: #020617;
    font-family: 'Mikhak-R', 'Blabeloo', Tahoma, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.au-wrap {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(0.6rem, 1.5vh, 1.25rem) 1rem;
    overflow: hidden;
}

/* Background */
.au-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(145deg, #020617 0%, #0c4a6e 38%, #1e1b4b 72%, #0f172a 100%);
    overflow: hidden;
}

.au-scene-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.au-scene-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
}

.au-scene-orb--1 { width: 340px; height: 340px; background: #06b6d4; top: -6%; right: 8%; }
.au-scene-orb--2 { width: 280px; height: 280px; background: #6366f1; bottom: 5%; left: 6%; opacity: 0.35; }

/* Top */
.au-top {
    width: 100%;
    max-width: 66rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(0.5rem, 1.2vh, 1rem);
}

.au-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #f8fafc;
    font-weight: 800;
    font-size: 1.05rem;
}

.au-logo-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    font-size: 0.9rem;
}

.au-top-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.75);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s;
}

.au-top-link:hover { color: #67e8f9; }

/* Steps */
.au-steps {
    width: 100%;
    max-width: 26rem;
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.au-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.55);
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.au-step i { font-size: 0.68rem; }

.au-step.is-active {
    color: #ecfeff;
    background: rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.45);
}

.au-step.is-done {
    color: #a5f3fc;
    border-color: rgba(6, 182, 212, 0.25);
}

/* Card */
.au-card {
    width: 100%;
    max-width: 26rem;
    padding: 1.65rem 1.5rem 1.5rem;
    border-radius: 1.15rem;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(16px);
}

.au-card-head {
    text-align: center;
    margin-bottom: 1.35rem;
}

.au-card-head h1,
.au-card-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-family: 'Blabeloo', 'Mikhak-R', Tahoma, sans-serif;
}

.au-card-title--stack .au-card-title__line {
    display: inline;
}

.au-card-title--stack .au-card-title__line + .au-card-title__line::before {
    content: '\00a0';
}

/* باکس شیشه‌ای عنوان فقط روی موبایل دیده می‌شود */
.au-title-glass {
    display: contents;
}

.au-card-head p,
.au-card-sub {
    margin: 0.45rem 0 0;
    font-size: 0.86rem;
    line-height: 1.7;
    color: rgba(226, 232, 240, 0.72);
}

.au-card-foot {
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    text-align: center;
    font-size: 0.84rem;
    color: rgba(226, 232, 240, 0.65);
}

.au-card-foot a {
    color: #67e8f9;
    font-weight: 700;
    text-decoration: none;
}

.au-card-foot a:hover { text-decoration: underline; }

/* Alerts */
.au-alert {
    padding: 0.7rem 0.85rem;
    border-radius: 0.65rem;
    font-size: 0.82rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.au-alert--ok {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #6ee7b7;
}

.au-alert--err {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

.au-alert ul { margin: 0; padding-right: 1rem; }

/* Phone badge (verify page) */
.au-phone-badge {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 1.25rem;
    border-radius: 0.75rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.28);
}

.au-phone-badge-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
    flex-shrink: 0;
}

.au-phone-badge-text {
    font-size: 0.8rem;
    line-height: 1.55;
    color: rgba(226, 232, 240, 0.85);
}

.au-phone-badge-text strong {
    display: block;
    font-size: 1rem;
    color: #f0fdfa;
    margin-top: 0.15rem;
    letter-spacing: 0.04em;
}

/* Form */
.au-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.au-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.au-field {
    position: relative;
}

.au-field label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 0.32rem;
    letter-spacing: 0.01em;
    color: rgba(186, 230, 253, 0.78);
}

.au-control {
    position: relative;
}

.au-control > i {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(148, 163, 184, 0.7);
    font-size: 0.84rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.au-control:focus-within > i {
    color: #22d3ee;
}

.au-input {
    width: 100%;
    padding: 0.72rem 2.45rem 0.72rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0.85rem;
    font-size: 0.92rem;
    font-family: inherit;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.72));
    color: #f8fafc;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 1px 0 rgba(2, 6, 23, 0.25);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.au-input::placeholder { color: rgba(148, 163, 184, 0.48); }

.au-input:hover {
    border-color: rgba(103, 232, 249, 0.28);
}

.au-input:focus {
    outline: none;
    border-color: rgba(34, 211, 238, 0.55);
    background: linear-gradient(180deg, rgba(30, 58, 78, 0.65), rgba(15, 23, 42, 0.85));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 3px rgba(6, 182, 212, 0.16),
        0 8px 22px rgba(6, 182, 212, 0.12);
}

.au-input.is-err {
    border-color: rgba(248, 113, 113, 0.7);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
}

.au-input--ltr {
    direction: ltr;
    text-align: left;
    padding-right: 0.85rem;
    padding-left: 2.45rem;
}

.au-control:has(.au-input--ltr) > i {
    right: auto;
    left: 0.85rem;
}

.au-err {
    margin-top: 0.3rem;
    font-size: 0.76rem;
    color: #fca5a5;
}

.au-hint {
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.78rem;
    line-height: 1.6;
    color: rgba(226, 232, 240, 0.8);
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.au-pass-toggle {
    position: absolute;
    left: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.05rem;
    height: 2.05rem;
    border: none;
    background: rgba(148, 163, 184, 0.08);
    color: rgba(148, 163, 184, 0.9);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.au-pass-toggle:hover {
    color: #67e8f9;
    background: rgba(6, 182, 212, 0.14);
}

.au-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
}

.au-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: rgba(226, 232, 240, 0.78);
    line-height: 1.45;
    user-select: none;
}

.au-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    flex: 0 0 auto;
    border-radius: 0.32rem;
    border: 1.5px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.65);
    display: grid;
    place-content: center;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.au-check input::before {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    transform: scale(0);
    transition: transform 0.12s ease;
    box-shadow: inset 1em 1em #ecfeff;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}

.au-check input:checked {
    border-color: rgba(34, 211, 238, 0.75);
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.16);
}

.au-check input:checked::before {
    transform: scale(1);
}

.au-check a {
    color: #67e8f9;
    text-decoration: none;
    font-weight: 700;
}

.au-check a:hover { text-decoration: underline; }

.au-link {
    color: #67e8f9;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
}

.au-link:hover { text-decoration: underline; }

.au-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.88rem 1rem;
    border: none;
    border-radius: 0.9rem;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    color: #042f2e;
    background: linear-gradient(135deg, #67e8f9 0%, #22d3ee 42%, #06b6d4 100%);
    box-shadow:
        0 10px 28px rgba(6, 182, 212, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.2s var(--au-ease), box-shadow 0.2s, filter 0.2s;
}

.au-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow:
        0 14px 32px rgba(6, 182, 212, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.au-btn:active {
    transform: translateY(0);
}

.au-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

/* OTP boxes */
.au-otp-label {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.75);
    margin-bottom: 0.65rem;
}

.au-otp {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    direction: ltr;
    margin-bottom: 0.35rem;
}

.au-otp-digit {
    width: 2.65rem;
    height: 3rem;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.6rem;
    background: rgba(2, 6, 23, 0.65);
    color: #f8fafc;
    caret-color: #06b6d4;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.au-otp-digit:focus {
    outline: none;
    border-color: rgba(6, 182, 212, 0.65);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
}

.au-otp-digit.is-filled {
    border-color: rgba(6, 182, 212, 0.45);
    background: rgba(6, 182, 212, 0.08);
}

.au-meta {
    text-align: center;
    font-size: 0.74rem;
    color: rgba(148, 163, 184, 0.9);
    margin: 0.5rem 0 0;
}

.au-resend {
    text-align: center;
    margin-top: 0.85rem;
}

.au-resend-btn {
    background: none;
    border: none;
    color: #67e8f9;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    padding: 0.35rem;
}

.au-resend-btn:disabled {
    color: rgba(148, 163, 184, 0.65);
    cursor: not-allowed;
}

/* Light theme override */
[data-theme="light"] .au {
    color: #0f172a;
    background: #f1f5f9;
}

[data-theme="light"] .au-scene {
    background: linear-gradient(145deg, #e0f2fe 0%, #f8fafc 45%, #eef2ff 100%);
}

[data-theme="light"] .au-scene-orb { opacity: 0.2; }

[data-theme="light"] .au-logo,
[data-theme="light"] .au-top-link { color: #0f172a; }

[data-theme="light"] .au-top-link { color: #64748b; }

[data-theme="light"] .au-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: #e2e8f0;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

[data-theme="light"] .au-card-head p,
[data-theme="light"] .au-card-foot,
[data-theme="light"] .au-field label,
[data-theme="light"] .au-check { color: #64748b; }

[data-theme="light"] .au-input,
[data-theme="light"] .au-otp-digit {
    background: #fff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .au-step {
    background: #fff;
    border-color: #e2e8f0;
    color: #64748b;
}

/* Login method tabs */
.au-login-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.3rem;
    margin-bottom: 0.95rem;
    border-radius: 1rem;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.au-login-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 0.5rem;
    border: none;
    border-radius: 0.75rem;
    background: transparent;
    color: rgba(226, 232, 240, 0.58);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s var(--au-ease), color 0.2s var(--au-ease), box-shadow 0.2s var(--au-ease);
}

.au-login-tab.is-active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(20, 184, 166, 0.16));
    color: #ecfeff;
    box-shadow:
        inset 0 0 0 1px rgba(34, 211, 238, 0.4),
        0 6px 16px rgba(6, 182, 212, 0.12);
}

[data-theme="light"] .au-login-tabs {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

[data-theme="light"] .au-login-tab { color: #64748b; }

[data-theme="light"] .au-login-tab.is-active {
    background: #fff;
    color: #0891b2;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.12), inset 0 0 0 1px rgba(6, 182, 212, 0.2);
}

@media (max-width: 480px) {
    .au-row { grid-template-columns: 1fr; }
    .au-otp-digit { width: 2.35rem; height: 2.75rem; font-size: 1.15rem; }
    .au-card { padding: 1.35rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .au-btn:hover { transform: none; }
}

/* ═══════════ باکس کشویی ورود/ثبت‌نام + کاراکترها ═══════════ */
.au-box {
    position: relative;
    width: 100%;
    max-width: 66rem;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 46rem;
    border-radius: 1.6rem;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(18px);
    /* حس سه‌بعدی: سایه لایه‌ای + هایلایت داخلی */
    box-shadow:
        0 40px 80px rgba(2, 6, 23, 0.65),
        0 14px 30px rgba(2, 6, 23, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(2, 6, 23, 0.5);
}

/* ── پنل‌های فرم ── */
.au-pane {
    position: absolute;
    top: 0;
    height: 100%;
    width: 60%;
    display: flex;
    align-items: center;
    transition: transform 1s var(--au-ease), opacity 0.55s ease;
}

.au-pane-inner {
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(1.25rem, 3vh, 2.25rem) clamp(1.25rem, 4vw, 3rem);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.au-pane--login { right: 0; }

.au-pane--register {
    left: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6%);
}

.au-box.s--signup .au-pane--login {
    opacity: 0;
    pointer-events: none;
    transform: translateX(6%);
}

.au-box.s--signup .au-pane--register {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.au-link-btn {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: #67e8f9;
    cursor: pointer;
}

.au-link-btn:hover { text-decoration: underline; }

/* ── پنل کاراکترها (کشویی) ── */
.au-cast-panel {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    width: 40%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(0.5rem, 1.5vh, 1rem);
    padding: clamp(1rem, 2.5vh, 2rem) 1.25rem clamp(1.1rem, 2.5vh, 2rem);
    background:
        radial-gradient(ellipse 90% 55% at 50% 112%, rgba(6, 182, 212, 0.22), transparent 65%),
        linear-gradient(160deg, #0b1226 0%, #101b3a 55%, #0a0f24 100%);
    border-inline-end: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: inset 0 0 60px rgba(2, 6, 23, 0.5), 8px 0 30px rgba(2, 6, 23, 0.35);
    transition: transform 1s cubic-bezier(0.65, 0, 0.35, 1);
}

.au-box.s--signup .au-cast-panel {
    transform: translateX(150%);
    border-inline-end: none;
    border-inline-start: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: inset 0 0 60px rgba(2, 6, 23, 0.5), -8px 0 30px rgba(2, 6, 23, 0.35);
}

/* پیام‌های پنل */
.au-cast-msgs {
    position: relative;
    width: 100%;
    min-height: 4.25rem;
    flex-shrink: 0;
    text-align: center;
}

.au-cast-msg {
    position: absolute;
    inset: 0;
    margin: 0;
    font-size: clamp(0.9rem, 1.6vh, 1.05rem);
    font-weight: 800;
    line-height: 1.8;
    color: #e2e8f0;
    transition: opacity 0.5s ease, transform 0.6s var(--au-ease);
}

.au-cast-msg--to-signup { opacity: 1; transform: none; }
.au-cast-msg--to-login { opacity: 0; transform: translateY(10px); }

.au-box.s--signup .au-cast-msg--to-signup { opacity: 0; transform: translateY(-10px); }
.au-box.s--signup .au-cast-msg--to-login { opacity: 1; transform: none; }

/* ── گروه کاراکترها ── */
.au-cast {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    user-select: none;
    min-height: 0;
    /* جا برای حباب گفتگو بالای سرها */
    padding-top: 5.5rem;
}

.au-cast-inner {
    display: flex;
    align-items: flex-end;
}

/* هر کاراکتر: transform برای step/lean؛ شناور بودن روی svg است تا تداخل نکند */
.au-cast-char {
    position: relative;
    width: clamp(7.25rem, 18%, 10.5rem);
    /* فاصله واقعی: نزدیک و دوستانه ولی بدون تو هم رفتن */
    margin-inline: 0.12rem;
    transition: transform 0.4s var(--au-ease);
    will-change: transform;
}

.au-cast-char--1 { z-index: 1; }
.au-cast-char--2 { width: clamp(8.75rem, 22%, 12.5rem); z-index: 2; }
.au-cast-char--3 { width: clamp(6.75rem, 16%, 9.5rem); margin-bottom: 0.8rem; z-index: 1; }

.au-cast-svg {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 16px 26px rgba(2, 6, 23, 0.55));
    animation: auCastFloat 5s ease-in-out infinite;
}

.au-cast-char--2 .au-cast-svg { animation-delay: 0.8s; }
.au-cast-char--3 .au-cast-svg { animation-delay: 1.6s; }

@keyframes auCastFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* بدن و اجزا */
.au-cast-body--1 { fill: #2dd4bf; }
.au-cast-body--2 { fill: #8b9cf8; }
.au-cast-body--3 { fill: #fbbf24; }

.au-cast-line {
    fill: none;
    stroke: #2dd4bf;
    stroke-width: 3;
    stroke-linecap: round;
}

.au-cast-antenna { fill: #99f6e4; }
.au-cast-ear--2 { fill: #6d7ff0; }

.au-cast-scarf { fill: #0f766e; }
.au-cast-scarf--tail { fill: #115e59; }

.au-cast-arm {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
}

.au-cast-arm--1 { stroke: #14b8a6; }
.au-cast-arm--2 { stroke: #6d7ff0; }
.au-cast-arm--3 { stroke: #f59e0b; }

.au-brow {
    fill: none;
    stroke: rgba(15, 23, 42, 0.85);
    stroke-width: 3.2;
    stroke-linecap: round;
    transition: transform 0.25s ease;
    transform-box: fill-box;
    transform-origin: center;
}

.au-eye-white {
    fill: #ffffff;
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.25s ease;
}

.au-pupil {
    fill: #0f172a;
    transition: transform 0.09s linear;
}

.au-eye-closed {
    fill: none;
    stroke: #0f172a;
    stroke-width: 3;
    stroke-linecap: round;
    opacity: 0;
}

.au-cheek {
    fill: #fb7185;
    opacity: 0.32;
}

.au-mouth-idle {
    fill: none;
    stroke: rgba(15, 23, 42, 0.8);
    stroke-width: 3.5;
    stroke-linecap: round;
}

.au-mouth-talk {
    fill: #0f172a;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

/* ── حالت‌ها ── */

/* پلک / خجالتی */
.au-cast-char.is-blink .au-eye-white,
.au-cast-char.is-blink .au-pupil,
.au-cast-char.is-shy .au-eye-white,
.au-cast-char.is-shy .au-pupil { opacity: 0; }

.au-cast-char.is-blink .au-eye-closed,
.au-cast-char.is-shy .au-eye-closed { opacity: 1; }

.au-cast-char.is-shy .au-brow { transform: translateY(2px); }

/* زیرچشمی: یک چشم بسته، یک چشم نیمه‌باز یواشکی */
.au-cast-char.is-peek .au-eye .au-eye-white,
.au-cast-char.is-peek .au-eye .au-pupil { opacity: 0; }
.au-cast-char.is-peek .au-eye .au-eye-closed { opacity: 1; }
.au-cast-char.is-peek .au-brow { transform: translateY(2.5px); }
.au-cast-char.is-peek .au-cheek { opacity: 0.5; }

.au-cast-char.is-peek .au-eye--sly .au-eye-closed { opacity: 0; }
.au-cast-char.is-peek .au-eye--sly .au-eye-white {
    opacity: 1;
    transform: scaleY(0.28);
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.2s ease;
}
.au-cast-char.is-peek .au-eye--sly .au-pupil { opacity: 1; }

/* حرف زدن: جلو آمدن + دهان باز متحرک */
.au-cast-char.is-talking {
    transform: translate(var(--step, 0px), -7px) scale(1.06);
    z-index: 4;
}

.au-cast-char.is-talking .au-cast-svg { animation-play-state: paused; }
.au-cast-char.is-talking .au-mouth-idle { opacity: 0; }

.au-cast-char.is-talking .au-mouth-talk {
    opacity: 1;
    animation: auMouthChatter 0.34s ease-in-out infinite;
}

@keyframes auMouthChatter {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.45); }
}

.au-cast-char.is-talking .au-brow { transform: translateY(-2px); }

/* گوش دادن: تمایل ملایم به سمت گوینده */
.au-cast-char.is-listening {
    transform: rotate(var(--lean, 0deg)) translateY(2px);
}

/* ── جابه‌جایی: یکی دو می‌دود، یکی پرش بلند از روی کله ── */
.au-cast-char.is-walking,
.au-cast-char.is-leaping { will-change: transform; }

.au-cast-char.is-walking .au-cast-svg,
.au-cast-char.is-leaping .au-cast-svg { animation-play-state: paused; }

/* حرکت سریع (dash) */
.au-cast-char.is-walking {
    animation: auCastDash 0.42s cubic-bezier(0.15, 0.85, 0.25, 1) both;
    z-index: 3;
}

/* پرش بلند */
.au-cast-char.is-leaping {
    animation: auCastLeap 0.95s cubic-bezier(0.33, 0.1, 0.25, 1) both;
    z-index: 8;
}

@keyframes auCastDash {
    0% {
        transform: translateX(var(--from-x, 0px)) rotate(0deg) skewX(0deg) scaleX(1);
        filter: brightness(1);
    }
    35% {
        transform: translateX(calc(var(--from-x, 0px) * 0.35))
            translateY(-6px)
            rotate(calc(var(--dir, 1) * 12deg))
            skewX(calc(var(--dir, 1) * -14deg))
            scaleX(1.18);
        filter: brightness(1.08);
    }
    75% {
        transform: translateX(calc(var(--from-x, 0px) * -0.04))
            rotate(calc(var(--dir, 1) * -4deg))
            skewX(calc(var(--dir, 1) * 4deg))
            scaleX(0.94);
    }
    100% {
        transform: translateX(0) rotate(0deg) skewX(0deg) scaleX(1);
        filter: brightness(1);
    }
}

@keyframes auCastLeap {
    0% { transform: translate(var(--from-x, 0px), 0) scaleY(1) scaleX(1) rotate(0deg); }
    10% { transform: translate(var(--from-x, 0px), 10px) scaleY(0.62) scaleX(1.22) rotate(0deg); }
    42% {
        transform: translate(calc(var(--from-x, 0px) * 0.55), -210px)
            scaleY(1.2) scaleX(0.82)
            rotate(calc(var(--dir, 1) * 18deg));
    }
    68% {
        transform: translate(calc(var(--from-x, 0px) * 0.12), -40px)
            scaleY(1.05) scaleX(0.95)
            rotate(calc(var(--dir, 1) * -6deg));
    }
    84% { transform: translate(0, 8px) scaleY(0.78) scaleX(1.14) rotate(0deg); }
    100% { transform: translate(0, 0) scaleY(1) scaleX(1) rotate(0deg); }
}

/* ── حباب گفتگو: بزرگ و خوانا ── */
.au-bubble {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    right: 50%;
    transform: translateX(50%) translateY(8px) scale(0.9);
    min-width: 11rem;
    max-width: 16.5rem;
    padding: 0.85rem 1.1rem;
    border-radius: 1.1rem;
    background: #ffffff;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.75;
    text-align: center;
    box-shadow: 0 14px 36px rgba(2, 6, 23, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s var(--au-ease), transform 0.22s var(--au-ease), visibility 0.22s;
    z-index: 6;
}

.au-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 50%;
    transform: translateX(50%);
    border: 8px solid transparent;
    border-top-color: #ffffff;
}

/* حباب کاراکترهای کناری به سمت داخل پنل شیفت شود تا قطع نشود
   (RTL: char--1 راست‌ترین، char--3 چپ‌ترین) */
.au-cast-char--1 .au-bubble { right: 68%; }
.au-cast-char--1 .au-bubble::after { right: 25%; }
.au-cast-char--3 .au-bubble { right: 32%; }
.au-cast-char--3 .au-bubble::after { right: 75%; }

.au-cast-char.is-talking .au-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(0) scale(1);
}

/* ── پرش هنگام سوییچ ── */
.au-box.is-jumping .au-cast-char .au-cast-svg { animation-play-state: paused; }

.au-box.is-jumping .au-cast-char {
    animation: auCastJump 0.95s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.au-box.is-jumping .au-cast-char--2 { animation-delay: 0.08s; }
.au-box.is-jumping .au-cast-char--3 { animation-delay: 0.16s; }

@keyframes auCastJump {
    0% { transform: translate(0, 0) scaleY(1); }
    16% { transform: translate(0, 7px) scaleY(0.8) scaleX(1.08); }
    45% { transform: translate(calc(var(--jumpdir, 1) * 14px), -52px) scaleY(1.1) scaleX(0.94) rotate(calc(var(--jumpdir, 1) * 7deg)); }
    72% { transform: translate(calc(var(--jumpdir, 1) * 4px), 5px) scaleY(0.88) scaleX(1.05); }
    100% { transform: translate(0, 0) scaleY(1); }
}

.au-box.s--signup { --jumpdir: 1; }
.au-box:not(.s--signup) { --jumpdir: -1; }

/* جشن تأیید */
.au-cast.is-party .au-cast-char {
    animation: auCastParty 0.55s ease-in-out infinite;
}

.au-cast.is-party .au-cast-char--2 { animation-delay: 0.12s; }
.au-cast.is-party .au-cast-char--3 { animation-delay: 0.24s; }

.au-cast.is-party .au-brow { transform: translateY(-3px); }

@keyframes auCastParty {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    30% { transform: translateY(-16px) rotate(-4deg); }
    60% { transform: translateY(-4px) rotate(3deg); }
}

/* ── دکمه سوییچ ── */
.au-toggle {
    position: relative;
    overflow: hidden;
    width: 11rem;
    height: 3rem;
    border: 2px solid rgba(226, 232, 240, 0.85);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.25);
    color: #f8fafc;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.25s, border-color 0.25s, transform 0.2s var(--au-ease);
}

.au-toggle:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: #67e8f9;
    transform: translateY(-2px);
}

.au-toggle-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: transform 0.6s var(--au-ease);
}

.au-toggle-label--login { transform: translateY(-120%); }

.au-box.s--signup .au-toggle-label--signup { transform: translateY(120%); }
.au-box.s--signup .au-toggle-label--login { transform: translateY(0); }

/* ── حالت قفل (تأیید کد) ── */
.au-box.is-locked .au-cast-panel,
.au-box.is-locked .au-pane { transition: none; }

/* ── لایت تم ── */
[data-theme="light"] .au-box {
    background: rgba(255, 255, 255, 0.95);
    border-color: #e2e8f0;
    box-shadow:
        0 40px 80px rgba(15, 23, 42, 0.16),
        0 14px 30px rgba(15, 23, 42, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

[data-theme="light"] .au-cast-panel {
    background:
        radial-gradient(ellipse 90% 55% at 50% 112%, rgba(6, 182, 212, 0.18), transparent 65%),
        linear-gradient(160deg, #0f172a 0%, #1c2a4a 55%, #101a33 100%);
}

[data-theme="light"] .au-cast-svg {
    filter: drop-shadow(0 16px 26px rgba(2, 6, 23, 0.4));
}

[data-theme="light"] .au-link-btn { color: #0891b2; }

/* ═══════════ ریسپانسیو ═══════════ */

/* تبلت: اسلایدر حفظ می‌شود، پنل کاراکترها کمی باریک‌تر */
@media (min-width: 768px) and (max-width: 991px) {
    .au-pane { width: 62%; }

    .au-cast-panel { width: 38%; padding-inline: 0.85rem; }

    .au-box.s--signup .au-cast-panel {
        transform: translateX(calc(100% * 62 / 38));
    }

    .au-cast-char { margin-inline: 0.05rem; }

    .au-bubble {
        min-width: 9.5rem;
        max-width: 13.5rem;
        font-size: 0.95rem;
        padding: 0.65rem 0.85rem;
    }

    .au-cast-msg { font-size: 0.85rem; }

    .au-toggle { width: 9.5rem; height: 2.8rem; font-size: 0.88rem; }
}

/* موبایل: کل صفحه فیکس در ارتفاع ویوپورت — بدون اسکرول صفحه */
@media (max-width: 767px) {
    html:has(body.au) {
        height: 100%;
        max-height: 100dvh;
        overflow: hidden;
    }

    .au {
        --au-hang-h: clamp(3.75rem, 11dvh, 5rem);
        --au-title-w: clamp(4.6rem, 22vw, 5.35rem);
        --au-char-w: clamp(3.35rem, 9.5vw, 4.15rem);
        --au-char-w-mid: clamp(3.85rem, 11vw, 4.75rem);
        --au-bubble-fs: clamp(0.74rem, 2.1vw, 0.84rem);
        --au-grip-lift: clamp(0.55rem, 1.6dvh, 0.95rem);
        --au-gap: clamp(0.28rem, 0.9dvh, 0.55rem);
        --au-ctrl-h: clamp(2.15rem, 5.4dvh, 2.7rem);
        height: 100dvh;
        max-height: 100dvh;
        min-height: 0;
        overflow: hidden;
        overscroll-behavior: none;
    }

    .au-wrap {
        height: 100%;
        max-height: 100dvh;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        box-sizing: border-box;
        /* بالا: جا برای حباب؛ پایین فشرده */
        padding: clamp(2.1rem, 5.5dvh, 2.75rem) 0.75rem 0.55rem;
    }

    .au-top {
        flex: 0 0 auto;
        margin-bottom: clamp(0.25rem, 0.8dvh, 0.55rem);
    }

    .au-box {
        width: 100%;
        max-width: 26.5rem;
        margin-inline: auto;
        /* به محتوای فرم بچسبد — فضای خالی پایین نسازد */
        flex: 0 1 auto;
        min-height: 0;
        max-height: 100%;
        display: flex;
        flex-direction: column;
        position: relative;
        border-radius: 1.15rem;
        overflow: visible;
        padding-top: 0;
    }

    .au-pane-inner {
        /* static تا عنوان شیشه‌ای نسبت به .au-box جای بگیرد */
        position: static;
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 0;
        padding: 0.3rem 0.85rem 0.55rem;
        overflow: visible;
    }

    .au-pane {
        position: static;
        width: 100%;
        height: auto;
        min-height: 0;
        transform: none !important;
        transition: none;
        order: 1;
        flex: 0 1 auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }

    .au-box:not(.s--signup) .au-pane--register { display: none; }
    .au-box.s--signup .au-pane--login { display: none; }

    .au-pane--register,
    .au-box.s--signup .au-pane--login {
        opacity: 1;
        pointer-events: auto;
    }

    /* کرکترها بالای باکس — بدون sticky چون صفحه اسکرول ندارد */
    .au-cast-panel,
    .au-box.s--signup .au-cast-panel,
    .au-box:not(.s--signup) .au-cast-panel {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        width: 100% !important;
        height: var(--au-hang-h) !important;
        min-height: var(--au-hang-h);
        max-height: var(--au-hang-h);
        order: -1;
        transform: none !important;
        gap: 0;
        padding-block: 0;
        padding-inline-end: 0.35rem;
        padding-inline-start: calc(var(--au-title-w) + 0.5rem);
        margin: 0;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible;
        justify-content: flex-start;
        align-items: flex-start;
        z-index: 12;
        pointer-events: none;
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        flex: 0 0 var(--au-hang-h);
    }

    .au-cast {
        flex: none;
        padding-top: 0;
        min-height: 0;
        width: 100%;
        height: auto;
        display: flex;
        align-items: flex-start;
        justify-content: center;
    }

    .au-cast-inner {
        justify-content: center;
        width: 100%;
        align-items: flex-start;
        gap: 0.2rem;
        /* دست گیره روی خط بالای باکس */
        margin-top: var(--au-grip-lift);
    }

    .au-cast-char {
        width: var(--au-char-w);
        margin-inline: 0.25rem;
        margin-bottom: 0 !important;
        --leap-h: -70px;
        filter: drop-shadow(0 10px 14px rgba(2, 6, 23, 0.38));
        /* تاب از نقطهٔ گیره (بالای SVG) */
        transform-origin: 82% 2%;
    }
    .au-cast-char--2 { width: var(--au-char-w-mid); transform-origin: 80% 1%; }
    .au-cast-char--3 { width: clamp(3.1rem, 8.8vw, 3.85rem); transform-origin: 84% 2%; }

    .au-box:not(.is-mobile-party) .au-cast-char--1 {
        animation: auHangSwing 3.4s ease-in-out infinite;
    }
    .au-box:not(.is-mobile-party) .au-cast-char--2 {
        animation: auHangSwing 3.8s ease-in-out infinite 0.4s;
    }
    .au-box:not(.is-mobile-party) .au-cast-char--3 {
        animation: auHangSwing 3.1s ease-in-out infinite 0.75s;
    }

    .au-box:not(.is-mobile-party) .au-cast-char .au-cast-svg {
        animation: none;
    }

    @keyframes auHangSwing {
        0%, 100% { transform: rotate(-4deg); }
        50% { transform: rotate(5deg); }
    }

    .au-cast-grip,
    .au-cast-grip-hand {
        display: block;
    }

    .au-cast-arm--free {
        display: none !important;
    }

    .au-cast-svg {
        overflow: visible;
    }

    .au-cast-msgs { display: none; }

    .au-bubble {
        bottom: calc(100% + 0.3rem);
        min-width: 0;
        width: max-content;
        max-width: min(11.5rem, 62vw);
        font-size: var(--au-bubble-fs);
        font-weight: 800;
        padding: 0.48rem 0.62rem;
        line-height: 1.45;
        border-radius: 0.85rem;
        pointer-events: none;
        z-index: 16;
    }

    .au-cast-char--1 .au-bubble { right: 55%; }
    .au-cast-char--1 .au-bubble::after { right: 40%; }
    .au-cast-char--2 .au-bubble { right: 50%; }
    .au-cast-char--2 .au-bubble::after { right: 50%; }
    .au-cast-char--3 .au-bubble { right: 45%; }
    .au-cast-char--3 .au-bubble::after { right: 55%; }

    .au-toggle { display: none; }

    .au-otp {
        position: relative;
        z-index: 1;
        margin-top: 0.35rem;
    }

    .au-box:not(.is-locked) .au-form {
        padding-top: 0;
    }

    .au-card-head {
        margin-bottom: 0.65rem;
        text-align: center;
    }

    /* ردیف‌ها روی موبایل auth دو ستونه بمانند */
    .au-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .au-row .au-input {
        font-size: 0.92rem;
        padding-top: 0.78rem;
        padding-bottom: 0.78rem;
        min-height: 2.75rem;
    }

    .au-row .au-field label {
        font-size: 0.78rem;
    }

    /* عنوان گوشه‌ای ورود + ثبت‌نام (OTP جداست) */
    .au-pane--login .au-card-head,
    .au-box:not(.is-locked) .au-pane--register .au-card-head {
        margin-bottom: 0;
        min-height: 0;
        height: 0;
        overflow: visible;
        position: static;
    }

    .au-pane--login .au-title-glass,
    .au-box:not(.is-locked) .au-pane--register .au-title-glass {
        display: flex !important;
        align-items: stretch;
        justify-content: center;
        position: absolute;
        /* نسبت به .au-box — گوشه باند hang */
        top: 0.3rem;
        inset-inline-start: 0.4rem;
        z-index: 22;
        width: var(--au-title-w);
        height: calc(var(--au-hang-h) - 0.55rem);
        max-height: 4.1rem;
        padding: 0.22rem 0.28rem;
        border-radius: 0.85rem;
        pointer-events: none;
        background: rgba(15, 23, 42, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.1),
            0 8px 18px rgba(2, 6, 23, 0.2);
        backdrop-filter: blur(12px) saturate(1.12);
        -webkit-backdrop-filter: blur(12px) saturate(1.12);
    }

    .au-pane--login .au-card-title--stack,
    .au-box:not(.is-locked) .au-pane--register .au-card-title--stack {
        position: static;
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        align-items: center;
        width: 100%;
        height: 100%;
        margin: 0;
        max-width: none;
        font-size: clamp(0.95rem, 3.8vw, 1.12rem);
        line-height: 1;
        letter-spacing: -0.01em;
        text-align: center;
        text-shadow: 0 1px 8px rgba(2, 6, 23, 0.7);
        pointer-events: none;
    }

    .au-pane--login .au-card-title--stack .au-card-title__line,
    .au-box:not(.is-locked) .au-pane--register .au-card-title--stack .au-card-title__line {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 0;
        width: 100%;
    }

    .au-pane--login .au-card-title--stack .au-card-title__line + .au-card-title__line::before,
    .au-box:not(.is-locked) .au-pane--register .au-card-title--stack .au-card-title__line + .au-card-title__line::before {
        content: none;
    }

    .au-pane--login .au-card-sub,
    .au-box:not(.is-locked) .au-pane--register .au-card-sub {
        display: none;
    }

    .au-card-head h1 { font-size: clamp(0.95rem, 3.6vw, 1.08rem); }
    .au-card-head p { font-size: 0.8rem; margin-top: 0; }

    /* فرم فشرده تا در ارتفاع فیکس جا شود */
    .au-form {
        gap: var(--au-gap);
        flex: 0 0 auto;
        min-height: 0;
        justify-content: flex-start;
    }

    .au-field label {
        font-size: clamp(0.7rem, 2.1vw, 0.8rem);
        margin-bottom: 0.18rem;
    }

    .au-input {
        padding-top: 0;
        padding-bottom: 0;
        padding-inline: 0.75rem 2.2rem;
        font-size: clamp(0.86rem, 2.6vw, 0.95rem);
        min-height: var(--au-ctrl-h);
        height: var(--au-ctrl-h);
        border-radius: 0.75rem;
    }

    .au-input--ltr {
        padding-inline: 2.2rem 0.75rem;
    }

    .au-btn {
        padding: 0;
        font-size: clamp(0.9rem, 2.8vw, 1rem);
        min-height: var(--au-ctrl-h);
        height: var(--au-ctrl-h);
        margin-top: 0.2rem;
        border-radius: 0.8rem;
        color: #042f2e;
    }

    .au-control > i {
        font-size: 0.78rem;
        right: 0.7rem;
    }

    .au-control:has(.au-input--ltr) > i {
        left: 0.7rem;
        right: auto;
    }

    .au-pass-toggle {
        width: 1.75rem;
        height: 1.75rem;
        left: 0.3rem;
    }

    .au-login-tabs { gap: 0.3rem; }
    .au-login-tab {
        padding: 0;
        min-height: calc(var(--au-ctrl-h) - 0.15rem);
        height: calc(var(--au-ctrl-h) - 0.15rem);
        font-size: clamp(0.8rem, 2.4vw, 0.9rem);
    }

    .au-check {
        font-size: clamp(0.72rem, 2.2vw, 0.82rem);
        margin: 0.1rem 0;
    }

    .au-card-foot {
        margin-top: 0.45rem;
        padding-top: 0.45rem;
        font-size: clamp(0.75rem, 2.3vw, 0.85rem);
        flex: 0 0 auto;
    }

    .au-row {
        gap: 0.4rem;
    }

    .au-row .au-input {
        font-size: clamp(0.82rem, 2.4vw, 0.9rem);
        min-height: var(--au-ctrl-h);
        height: var(--au-ctrl-h);
        padding-top: 0;
        padding-bottom: 0;
    }

    .au-row .au-field label {
        font-size: clamp(0.68rem, 2vw, 0.76rem);
    }

    .au-box.is-hang-drop .au-cast-char,
    .au-box.is-hang-catch .au-cast-char {
        animation-play-state: running !important;
        will-change: transform, opacity;
    }

    .au-box.is-hang-drop .au-cast-char {
        animation: auHangDrop 0.58s cubic-bezier(0.45, 0, 0.85, 0.35) both !important;
        z-index: 20;
    }
    .au-box.is-hang-drop .au-cast-char--2 { animation-delay: 0.07s !important; }
    .au-box.is-hang-drop .au-cast-char--3 { animation-delay: 0.14s !important; }

    .au-box.is-hang-drop .au-cast-grip,
    .au-box.is-hang-drop .au-cast-grip-hand {
        opacity: 0.15;
        transition: opacity 0.12s ease;
    }

    .au-box.is-hang-catch .au-cast-char {
        animation: auHangCatch 0.9s cubic-bezier(0.22, 1.2, 0.36, 1) both !important;
        z-index: 20;
    }
    .au-box.is-hang-catch .au-cast-char--2 { animation-delay: 0.08s !important; }
    .au-box.is-hang-catch .au-cast-char--3 { animation-delay: 0.16s !important; }

    @keyframes auHangDrop {
        0% { transform: rotate(-5deg) translateY(0); opacity: 1; }
        12% { transform: rotate(10deg) translateY(10px); opacity: 1; }
        100% { transform: rotate(28deg) translateY(110vh); opacity: 0.15; }
    }

    @keyframes auHangCatch {
        0% { transform: translateY(-130%) rotate(-16deg); opacity: 0; }
        55% { transform: translateY(14px) rotate(8deg); opacity: 1; }
        72% { transform: translateY(-5px) rotate(-6deg); }
        100% { transform: rotate(-4deg) translateY(0); opacity: 1; }
    }

    .au-box:not(.is-mobile-party) .au-cast-char.is-talking {
        animation-play-state: paused;
        transform: rotate(0deg) translateX(var(--step, 0));
    }
    .au-box:not(.is-mobile-party) .au-cast-char.is-listening {
        animation-play-state: paused;
        transform: rotate(var(--lean, 0deg));
    }

    .au-cast-web {
        position: absolute;
        height: 2px;
        margin-top: -1px;
        border-radius: 2px;
        background: linear-gradient(
            90deg,
            rgba(241, 245, 249, 0.95) 0%,
            rgba(148, 163, 184, 0.75) 70%,
            rgba(148, 163, 184, 0.25) 100%
        );
        box-shadow: 0 0 5px rgba(226, 232, 240, 0.45);
        transform-origin: 0 50%;
        pointer-events: none;
        z-index: 30;
        opacity: 0.9;
        transition:
            width 0.2s cubic-bezier(0.15, 0.85, 0.25, 1),
            opacity 0.28s ease;
    }

    .au-cast-web.is-fade { opacity: 0; }

    .au-box:not(.is-mobile-party) .au-cast-char.is-web-release,
    .au-box:not(.is-mobile-party) .au-cast-char.is-web-swing,
    .au-box:not(.is-mobile-party) .au-cast-char.is-web-shuffle,
    .au-box:not(.is-mobile-party) .au-cast-char.is-web-land {
        animation-play-state: running;
        will-change: transform;
    }

    .au-box:not(.is-mobile-party) .au-cast-char.is-web-release {
        animation: auWebRelease 0.18s ease-out both;
        z-index: 9;
    }
    .au-box:not(.is-mobile-party) .au-cast-char.is-web-swing {
        animation: auWebSwing 0.8s cubic-bezier(0.33, 0.08, 0.2, 1) both;
        z-index: 12;
    }
    .au-box:not(.is-mobile-party) .au-cast-char.is-web-shuffle {
        animation: auWebShuffle 0.8s cubic-bezier(0.35, 0.1, 0.25, 1) both;
        z-index: 8;
    }
    .au-box:not(.is-mobile-party) .au-cast-char.is-web-land {
        animation: auWebLand 0.3s ease-out both;
        z-index: 11;
    }

    .au-cast-char.is-web-release .au-cast-grip,
    .au-cast-char.is-web-release .au-cast-grip-hand,
    .au-cast-char.is-web-swing .au-cast-grip,
    .au-cast-char.is-web-swing .au-cast-grip-hand {
        opacity: 0.22;
        transition: opacity 0.15s ease;
    }

    .au-cast-char.is-web-release .au-cast-arm--free,
    .au-cast-char.is-web-swing .au-cast-arm--free,
    .au-cast-char.is-web-land .au-cast-arm--free {
        display: block !important;
    }

    .au-cast-char.is-web-land .au-cast-grip,
    .au-cast-char.is-web-land .au-cast-grip-hand {
        opacity: 1;
        transition: opacity 0.2s ease;
    }

    @keyframes auWebRelease {
        0% { transform: translateX(var(--from-x, 0px)) rotate(-5deg) translateY(0); }
        100% {
            transform:
                translateX(var(--from-x, 0px))
                rotate(calc(var(--swing-dir, 1) * 14deg))
                translateY(5px);
        }
    }

    @keyframes auWebSwing {
        0% {
            transform:
                translateX(var(--from-x, 0px))
                rotate(calc(var(--swing-dir, 1) * 12deg))
                translateY(4px);
        }
        28% {
            transform:
                translateX(calc(var(--from-x, 0px) * 0.72))
                rotate(calc(var(--swing-dir, 1) * -22deg))
                translateY(22px);
        }
        58% {
            transform:
                translateX(calc(var(--from-x, 0px) * 0.28))
                rotate(calc(var(--swing-dir, 1) * 26deg))
                translateY(14px);
        }
        100% { transform: translateX(0) rotate(calc(var(--swing-dir, 1) * -5deg)) translateY(0); }
    }

    @keyframes auWebShuffle {
        0% { transform: translateX(var(--from-x, 0px)) rotate(-6deg); }
        45% {
            transform:
                translateX(calc(var(--from-x, 0px) * 0.35))
                rotate(8deg)
                translateY(3px);
        }
        100% { transform: translateX(0) rotate(-3deg); }
    }

    @keyframes auWebLand {
        0% { transform: translateX(0) rotate(calc(var(--swing-dir, 1) * -8deg)) translateY(3px); }
        55% { transform: translateX(0) rotate(calc(var(--swing-dir, 1) * 6deg)) translateY(-2px); }
        100% { transform: translateX(0) rotate(-4deg) translateY(0); }
    }

    /* ── جشن تمام‌صفحه موبایل ── */
    .au-box.is-mobile-party {
        position: fixed;
        inset: 0;
        z-index: 70;
        max-width: none;
        width: 100%;
        min-height: 100dvh;
        height: 100dvh;
        margin: 0;
        padding: 0;
        border-radius: 0;
        border: none;
        overflow: hidden;
        background: linear-gradient(165deg, #0b1226 0%, #101b3a 50%, #060b18 100%);
    }

    .au-box.is-mobile-party .au-pane {
        display: none !important;
    }

    .au-box.is-mobile-party .au-cast-panel,
    .au-box.is-mobile-party.s--signup .au-cast-panel {
        position: absolute !important;
        inset: 0 !important;
        top: 0 !important;
        height: 100% !important;
        min-height: 100% !important;
        order: unset;
        transform: none !important;
        padding: 1rem 0.75rem 1.5rem;
        background:
            radial-gradient(ellipse 90% 55% at 50% 112%, rgba(6, 182, 212, 0.28), transparent 65%),
            linear-gradient(160deg, #0b1226 0%, #101b3a 55%, #0a0f24 100%) !important;
        justify-content: flex-end;
        z-index: 2;
        pointer-events: none;
    }

    .au-box.is-mobile-party .au-cast {
        flex: 1 1 auto;
        height: 100%;
        padding-top: 5.5rem;
        align-items: flex-end;
    }

    .au-box.is-mobile-party .au-cast-char {
        width: 5.6rem;
        margin-inline: 0.2rem;
        animation: none !important;
        transform: none;
        filter: drop-shadow(0 16px 22px rgba(2, 6, 23, 0.5));
    }
    .au-box.is-mobile-party .au-cast-char--2 { width: 6.6rem; }
    .au-box.is-mobile-party .au-cast-char--3 { width: 5.2rem; }

    .au-box.is-mobile-party .au-cast-grip,
    .au-box.is-mobile-party .au-cast-grip-hand {
        display: none; /* روی زمین جشن دیگر گیره لازم نیست */
    }
    .au-box.is-mobile-party .au-cast-arm--free {
        display: block !important; /* جشن: هر دو دست کوچک برگردند */
        opacity: 1;
    }

    .au-box.is-mobile-party .au-bubble {
        max-width: min(14rem, 70vw);
        font-size: 0.95rem;
    }

    body.au-mobile-party-lock {
        overflow: hidden;
        touch-action: none;
    }
}

/* دست گیره فقط زیر ۷۶۸px دیده می‌شود — در media موبایل display:block شده */
@media (min-width: 768px) {
    .au-cast-grip,
    .au-cast-grip-hand {
        display: none !important;
    }
}

.au-cast-grip {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
}

/* موبایل خیلی کوچک (<۳۶۰) */
@media (max-width: 380px) {
    .au {
        --au-title-w: 4.5rem;
        --au-ctrl-h: clamp(2.05rem, 5.2dvh, 2.45rem);
        --au-gap: clamp(0.22rem, 0.75dvh, 0.42rem);
    }

    .au-wrap {
        padding-inline: 0.6rem;
    }

    .au-pane--login .au-card-title--stack,
    .au-box:not(.is-locked) .au-pane--register .au-card-title--stack {
        font-size: 0.95rem;
    }

    .au-box.is-mobile-party .au-cast-char { width: 4.8rem; }
    .au-box.is-mobile-party .au-cast-char--2 { width: 5.6rem; }
    .au-box.is-mobile-party .au-cast-char--3 { width: 4.5rem; }
}

/* ارتفاع کم دسکتاپ (لپ‌تاپ کوچک): همه‌چیز فشرده‌تر */
@media (min-width: 768px) and (max-height: 720px) {
    .au-cast { padding-top: 4.75rem; }
    .au-cast-char { width: clamp(6rem, 15%, 8.5rem); }
    .au-cast-char--2 { width: clamp(7.25rem, 18.5%, 10.25rem); }
    .au-cast-char--3 { width: clamp(5.5rem, 14%, 8rem); }
    .au-cast-msgs { min-height: 3rem; }
    .au-cast-msg { font-size: 0.85rem; line-height: 1.6; }
    .au-toggle { height: 2.6rem; }
    .au-bubble { bottom: calc(100% + 0.6rem); font-size: 0.92rem; min-width: 9.5rem; max-width: 13.5rem; }
    .au-card-head h1 { font-size: 1.15rem; }
    .au-form { gap: 0.7rem; }
}

/* ═══════════ سکانس جشن تأیید کد: فشفشه + دوست‌ها ═══════════ */

.au-cast-panel.is-celebrating {
    overflow: hidden;
}

/* فشفشه: پشت کرکترها، جلوی بک‌گراند — ذرات درخشان‌تر دیده شوند */
.au-celebrate-fireworks {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.au-cast {
    z-index: 1;
}

.au-cast-inner {
    position: relative;
    z-index: 1;
}

/* لایه دوست‌ها روی کل #au-cast (از بالای پدینگ حباب تا کف) */
.au-celebrate-friends {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
    direction: ltr;
}

/* موقع حرف زدن: کل گروه کرکتر بالای پشته تا حباب خوانا بماند */
.au-cast.is-crowded:has(.au-cast-char.is-talking) .au-cast-inner {
    z-index: 4;
}

.au-cast-char.is-talking { z-index: 5; }

.au-friend {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

.au-friend svg {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 10px 18px rgba(2, 6, 23, 0.5));
}

.au-cast.is-crowded {
    overflow: hidden;
}

.au-cast.is-crowded .au-cast-svg {
    animation: none;
    transform-origin: 50% 100%;
    transition: transform 0.35s var(--au-ease);
}

.au-cast.is-crowded .au-cast-char.is-held .au-cast-svg {
    transform: scaleY(0.94) scaleX(1.03);
}

.au-friend.is-gentle {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.au-friend.is-gentle.is-in { opacity: 1; }

/* ── پاپ‌آپ خوش‌آمدگویی پایان جشن ── */
.au-welcome {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s;
    pointer-events: none;
}

.au-welcome.is-in {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.au-welcome-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(8px);
}

.au-welcome-card {
    position: relative;
    z-index: 1;
    width: min(100%, 24rem);
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 1.35rem;
    text-align: center;
    color: #f8fafc;
    background:
        linear-gradient(165deg, rgba(15, 23, 42, 0.96) 0%, rgba(12, 28, 52, 0.98) 55%, rgba(8, 18, 38, 0.98) 100%);
    border: 1px solid rgba(103, 232, 249, 0.28);
    box-shadow:
        0 28px 60px rgba(2, 6, 23, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 40px rgba(6, 182, 212, 0.12);
    transform: translateY(18px) scale(0.94);
    transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.au-welcome.is-in .au-welcome-card {
    transform: none;
}

.au-welcome-glow {
    position: absolute;
    top: -40%;
    left: 50%;
    width: 70%;
    height: 70%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(6, 182, 212, 0.28), transparent 68%);
    pointer-events: none;
}

.au-welcome-kicker {
    position: relative;
    margin: 0 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #67e8f9;
}

.au-welcome-title {
    position: relative;
    margin: 0 0 0.85rem;
    font-size: clamp(1.25rem, 4.5vw, 1.55rem);
    font-weight: 900;
    line-height: 1.55;
    color: #f8fafc;
}

.au-welcome-text {
    position: relative;
    margin: 0 0 1.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.85;
    color: rgba(226, 232, 240, 0.88);
}

.au-welcome-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.95rem 1.1rem;
    border: none;
    border-radius: 0.95rem;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 55%, #0e7490 100%);
    color: #042f2e;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(6, 182, 212, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.au-welcome-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 16px 32px rgba(6, 182, 212, 0.42);
}

.au-welcome-btn:active {
    transform: translateY(0);
}

[data-theme="light"] .au-welcome-card {
    background: linear-gradient(165deg, #ffffff 0%, #f0f9ff 55%, #e0f2fe 100%);
    border-color: rgba(8, 145, 178, 0.25);
    color: #0f172a;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .au-welcome-title { color: #0f172a; }
[data-theme="light"] .au-welcome-text { color: #334155; }
[data-theme="light"] .au-welcome-kicker { color: #0891b2; }
[data-theme="light"] .au-welcome-btn { color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .au-welcome,
    .au-welcome-card { transition: none; }
    .au-welcome-card { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .au-cast-svg,
    .au-box.is-jumping .au-cast-char,
    .au-cast.is-party .au-cast-char,
    .au-cast-char.is-walking,
    .au-cast-char.is-leaping,
    .au-cast-char.is-web-release,
    .au-cast-char.is-web-swing,
    .au-cast-char.is-web-shuffle,
    .au-cast-char.is-web-land,
    .au-box.is-hang-drop .au-cast-char,
    .au-box.is-hang-catch .au-cast-char,
    .au-mouth-talk { animation: none !important; }

    .au-cast-web { display: none !important; }

    .au-pupil { transition: none; }

    .au-cast-char,
    .au-pane,
    .au-cast-panel { transition: none; }

    .au-cast-char.is-talking { transform: none; }
    .au-cast-char.is-listening { transform: none; }

    .au-cast.is-crowded .au-cast-char.is-held .au-cast-svg {
        transform: none;
        transition: none;
    }
}

