/* ============================================================
   ts-auth.css — ظاهر مشترک صفحات ورود / ثبت‌نام / بازیابی رمز
   [T26] سبک سادهٔ گوگلی هم‌هویت با ترانه‌سراها + حرکت اجسام
   ============================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Vazirmatn, IRANSans, Tahoma, sans-serif;
    background: #f0f4f9;
    position: relative;
    overflow-x: hidden;
}
[data-theme="dark"] .auth-page, .dark-mode .auth-page { background: #0a0e17; }

/* ---------- اجسام متحرک پس‌زمینه ---------- */
.auth-fx { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.auth-fx .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    animation: authOrb 22s ease-in-out infinite alternate;
}
.auth-fx .orb.o1 { width: 420px; height: 420px; top: -140px; right: -120px; background: radial-gradient(circle, rgba(0,212,255,.35), transparent 65%); }
.auth-fx .orb.o2 { width: 460px; height: 460px; bottom: -180px; left: -140px; background: radial-gradient(circle, rgba(124,58,237,.30), transparent 65%); animation-delay: -8s; }
.auth-fx .orb.o3 { width: 300px; height: 300px; top: 38%; left: 12%; background: radial-gradient(circle, rgba(255,0,110,.18), transparent 65%); animation-delay: -14s; }
.auth-fx .note {
    position: absolute;
    color: #7c3aed;
    opacity: .14;
    font-size: 26px;
    animation: authNote 16s ease-in-out infinite alternate;
    text-shadow: 0 4px 18px rgba(124, 58, 237, .25);
}
.auth-fx .note:nth-child(4) { top: 16%; right: 12%; animation-delay: -2s; font-size: 34px; color: #0090b8; }
.auth-fx .note:nth-child(5) { top: 64%; right: 22%; animation-delay: -6s; font-size: 22px; color: #ff006e; }
.auth-fx .note:nth-child(6) { top: 30%; left: 8%; animation-delay: -9s; font-size: 30px; }
.auth-fx .note:nth-child(7) { top: 76%; left: 26%; animation-delay: -4s; font-size: 24px; color: #0090b8; }
.auth-fx .note:nth-child(8) { top: 12%; left: 40%; animation-delay: -11s; font-size: 20px; color: #ff006e; }
[data-theme="dark"] .auth-fx .note, .dark-mode .auth-fx .note { opacity: .22; color: #00d4ff; }
[data-theme="dark"] .auth-fx .note:nth-child(5), .dark-mode .auth-fx .note:nth-child(5) { color: #ff4d94; }
[data-theme="dark"] .auth-fx .note:nth-child(7), .dark-mode .auth-fx .note:nth-child(7) { color: #38e0ff; }

@keyframes authOrb {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-30px, 26px, 0) scale(1.08); }
    100% { transform: translate3d(24px, -18px, 0) scale(.96); }
}
@keyframes authNote {
    0%   { transform: translate3d(0, 0, 0) rotate(-10deg); }
    50%  { transform: translate3d(16px, -30px, 0) rotate(8deg); }
    100% { transform: translate3d(-14px, 18px, 0) rotate(-6deg); }
}

/* ---------- کارت ---------- */
.auth-container {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 44px 16px 56px;
    position: relative;
    z-index: 1;
}
.auth-card {
    width: min(460px, 100%);
    background: #ffffff;
    border: 1px solid #e1e5ee;
    border-radius: 26px;
    padding: 38px 36px 30px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 14px 44px rgba(16, 24, 40, .10);
    animation: authCardIn .65s cubic-bezier(.18, .8, .22, 1) both;
}
[data-theme="dark"] .auth-card, .dark-mode .auth-card {
    background: #131927;
    border-color: rgba(255, 255, 255, .09);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 50px rgba(0, 0, 0, .5);
}
@keyframes authCardIn {
    from { opacity: 0; transform: translateY(26px) scale(.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-card.shake { animation: authShake .45s ease; }
@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}

.auth-header { text-align: center; margin-bottom: 22px; }
.auth-logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #7c3aed 55%, #ff006e);
    box-shadow: 0 8px 22px rgba(124, 58, 237, .35);
    margin-bottom: 14px;
    animation: authLogoFloat 5.5s ease-in-out infinite;
}
.auth-logo i, .auth-logo svg { font-size: 24px; color: #fff; width: 24px; height: 24px; }
@keyframes authLogoFloat {
    0%, 100% { transform: translateY(0); box-shadow: 0 8px 22px rgba(124, 58, 237, .35); }
    50% { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(124, 58, 237, .45); }
}
.auth-title {
    font-size: 23px; font-weight: 800; margin: 0 0 6px;
    background: linear-gradient(120deg, #0090b8, #7c3aed 60%, #ff006e);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.auth-subtitle { margin: 0; color: #5f6470; font-size: 14px; }
[data-theme="dark"] .auth-subtitle, .dark-mode .auth-subtitle { color: #9aa3b5; }

/* ---------- پیام‌ها ---------- */
.auth-message {
    padding: 12px 14px; border-radius: 12px;
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13.5px; line-height: 1.9; margin-bottom: 18px;
    animation: authMsgIn .4s ease both;
}
@keyframes authMsgIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.auth-message.error { background: rgba(239, 68, 68, .09); border: 1px solid rgba(239, 68, 68, .28); color: #dc2626; }
.auth-message.success { background: rgba(16, 185, 129, .09); border: 1px solid rgba(16, 185, 129, .28); color: #059669; }
.auth-message.info { background: rgba(59, 130, 246, .09); border: 1px solid rgba(59, 130, 246, .28); color: #2563eb; }
[data-theme="dark"] .auth-message.error, .dark-mode .auth-message.error { color: #fca5a5; }
[data-theme="dark"] .auth-message.success, .dark-mode .auth-message.success { color: #6ee7b7; }
[data-theme="dark"] .auth-message.info, .dark-mode .auth-message.info { color: #93c5fd; }

/* ---------- فیلدها (لیبل شناور سبک گوگل) ---------- */
.ts-field { position: relative; margin-bottom: 16px; }
.ts-field input.ts-in {
    width: 100%;
    height: 56px;
    padding: 22px 16px 8px;
    background: #f8fafc;
    border: 1.5px solid #d6dbe6;
    border-radius: 12px;
    font-size: 15px; font-family: inherit;
    color: #1c2333;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.ts-field input.ts-in:focus {
    outline: none;
    background: #fff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3.5px rgba(124, 58, 237, .13);
}
.ts-field label {
    position: absolute;
    right: 16px; top: 18px;
    font-size: 14.5px; color: #8a90a0;
    pointer-events: none;
    transition: all .18s ease;
    background: transparent;
    padding: 0 4px;
}
.ts-field input.ts-in:focus ~ label,
.ts-field input.ts-in:not(:placeholder-shown) ~ label {
    top: -9px;
    font-size: 11.5px;
    color: #7c3aed;
    background: linear-gradient(180deg, transparent 55%, #fff 55%);
    border-radius: 4px;
}
.ts-field > label.ts-lbl-float {
    top: -9px;
    font-size: 11.5px;
    color: #7c3aed;
    background: linear-gradient(180deg, transparent 55%, #fff 55%);
    border-radius: 4px;
}
[data-theme="dark"] .ts-field > label.ts-lbl-float, .dark-mode .ts-field > label.ts-lbl-float { color: #00d4ff; background: linear-gradient(180deg, transparent 55%, #131927 55%); }
[data-theme="dark"] .ts-field input.ts-in, .dark-mode .ts-field input.ts-in {
    background: #1a2132; border-color: #2e3648; color: #e6eaf4;
}
[data-theme="dark"] .ts-field label, .dark-mode .ts-field label { color: #8891a5; }
[data-theme="dark"] .ts-field input.ts-in:focus, .dark-mode .ts-field input.ts-in:focus { background: #171d2c; border-color: #00d4ff; box-shadow: 0 0 0 3.5px rgba(0, 212, 255, .12); }
[data-theme="dark"] .ts-field input.ts-in:focus ~ label, .dark-mode .ts-field input.ts-in:focus ~ label,
[data-theme="dark"] .ts-field input.ts-in:not(:placeholder-shown) ~ label, .dark-mode .ts-field input.ts-in:not(:placeholder-shown) ~ label { color: #00d4ff; background: linear-gradient(180deg, transparent 55%, #131927 55%); }
.ts-field .hint { font-size: 11.5px; color: #8a90a0; margin: 6px 4px 0; }
[data-theme="dark"] .ts-field .hint, .dark-mode .ts-field .hint { color: #79839a; }
.ts-field .ts-in.dir-ltr { direction: ltr; text-align: left; }

/* رمز عبور */
.input-wrapper { position: relative; }
.input-wrapper .ts-in { padding-inline-end: 48px; }
.password-toggle {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: #9aa0ab; cursor: pointer;
    width: 30px; height: 30px; border-radius: 8px;
    transition: color .2s, background .2s;
}
.password-toggle:hover { color: #7c3aed; background: rgba(124, 58, 237, .08); }

/* ---------- دکمهٔ اصلی ---------- */
.auth-button {
    width: 100%;
    height: 50px;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    background: linear-gradient(135deg, #0090b8, #7c3aed 60%, #a21caf);
    background-size: 160% 160%;
    border: none; border-radius: 999px;
    color: #fff; font-size: 15.5px; font-weight: 700; font-family: inherit;
    cursor: pointer; position: relative;
    transition: transform .18s, box-shadow .25s, filter .25s;
    box-shadow: 0 8px 22px rgba(124, 58, 237, .32);
}
.auth-button:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(124, 58, 237, .42); background-position: 100% 100%; }
.auth-button:active { transform: translateY(0) scale(.985); }
.auth-button:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.auth-button.secondary {
    background: #f1f3f9; color: #3d4353;
    box-shadow: none; border: 1px solid #e1e5ee;
    margin-top: 10px;
}
.auth-button.secondary:hover { background: #e9ecf5; transform: none; box-shadow: none; }
[data-theme="dark"] .auth-button.secondary, .dark-mode .auth-button.secondary { background: #1b2233; color: #c9d2e4; border-color: #2c3446; }
.auth-button.loading { color: transparent !important; pointer-events: none; }
.auth-button.loading > i, .auth-button.loading > span { visibility: hidden; }
.auth-button.loading::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    width: 22px; height: 22px; margin: -11px 0 0 -11px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin .65s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* ---------- متفرقه ---------- */
.auth-divider { text-align: center; margin: 20px 0; position: relative; color: #9298a5; font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 44%; height: 1px; background: #e3e7f0; }
.auth-divider::before { right: 0; } .auth-divider::after { left: 0; }
[data-theme="dark"] .auth-divider::before, .dark-mode .auth-divider::before,
[data-theme="dark"] .auth-divider::after, .dark-mode .auth-divider::after { background: #2c3446; }

.login-prompt { text-align: center; color: #5f6470; font-size: 14px; margin-top: 18px; }
[data-theme="dark"] .login-prompt, .dark-mode .login-prompt { color: #9aa3b5; }
.login-link { color: #7c3aed; text-decoration: none; font-weight: 700; transition: color .2s; }
.login-link:hover { color: #ff006e; }

.remember-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin: 4px 2px 16px; font-size: 13.5px;
}
.remember-row .rm { display: flex; align-items: center; gap: 8px; color: #4b5163; cursor: pointer; }
[data-theme="dark"] .remember-row .rm, .dark-mode .remember-row .rm { color: #b6bfd2; }
.remember-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: #7c3aed; cursor: pointer; }
.remember-row a { color: #7c3aed; text-decoration: none; font-weight: 600; }
.remember-row a:hover { color: #ff006e; }

/* سوییچ روش ورود */
.auth-tabs {
    display: flex; gap: 6px; padding: 5px;
    background: #eef1f8; border-radius: 999px; margin-bottom: 20px;
}
[data-theme="dark"] .auth-tabs, .dark-mode .auth-tabs { background: #1a2132; }
.auth-tab {
    flex: 1; height: 42px;
    background: transparent; border: none; border-radius: 999px;
    color: #6a7180; font-size: 13.5px; font-weight: 600; font-family: inherit;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
    transition: all .3s ease;
}
.auth-tab.active {
    background: #fff; color: #7c3aed;
    box-shadow: 0 2px 10px rgba(16, 24, 40, .12);
}
[data-theme="dark"] .auth-tab.active, .dark-mode .auth-tab.active { background: #263048; color: #00d4ff; }
.method-section { display: none; }
.method-section.active { display: block; animation: authFade .35s ease both; }
@keyframes authFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ورودی کد */
.code-input {
    text-align: center !important;
    font-size: 26px !important;
    letter-spacing: 12px;
    font-family: 'Courier New', monospace;
    direction: ltr;
}

/* تلفن */
.phone-wrap { display: flex; align-items: stretch; }
.phone-wrap .ts-in { border-radius: 0 12px 12px 0; }
.phone-wrap .phone-prefix {
    display: flex; align-items: center;
    padding: 0 14px;
    background: #eef1f8; border: 1.5px solid #d6dbe6; border-right: none;
    border-radius: 12px 0 0 12px;
    color: #4b5163; font-weight: 600; font-size: 13.5px;
}
[data-theme="dark"] .phone-wrap .phone-prefix, .dark-mode .phone-wrap .phone-prefix { background: #1a2132; border-color: #2e3648; color: #b6bfd2; }
[data-theme="dark"] .phone-wrap .ts-in, .dark-mode .phone-wrap .ts-in { border-radius: 0 12px 12px 0; }

/* مراحل (ثبت‌نام) */
.steps { background: #f6f8fc; border: 1px solid #e6eaf3; border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
[data-theme="dark"] .steps, .dark-mode .steps { background: #171d2c; border-color: #262f44; }
.steps .step { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #4b5163; margin-bottom: 9px; }
.steps .step:last-child { margin-bottom: 0; }
[data-theme="dark"] .steps .step, .dark-mode .steps .step { color: #aab3c6; }
.steps .step-num {
    flex: 0 0 auto;
    width: 22px; height: 22px; border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #7c3aed);
    color: #fff; font-size: 12px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.steps code { direction: ltr; display: inline-block; background: rgba(124, 58, 237, .1); padding: 1px 6px; border-radius: 5px; font-size: 12px; color: #7c3aed; }
[data-theme="dark"] .steps code, .dark-mode .steps code { background: rgba(0, 212, 255, .12); color: #00d4ff; }

.code-box { background: #f6f8fc; border: 1.5px dashed #c9d0e2; border-radius: 16px; padding: 16px; text-align: center; margin-bottom: 14px; }
[data-theme="dark"] .code-box, .dark-mode .code-box { background: #171d2c; border-color: #2c3752; }
.code-box .code-display { font-size: 30px; font-weight: 800; letter-spacing: 8px; direction: ltr; color: #7c3aed; margin-top: 6px; }
[data-theme="dark"] .code-box .code-display, .dark-mode .code-box .code-display { color: #00d4ff; }

.bale-link {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 0 0 18px; padding: 13px;
    background: rgba(0, 144, 184, .09); border: 1px solid rgba(0, 144, 184, .25);
    border-radius: 12px; color: #0077a3; text-decoration: none; font-weight: 600; font-size: 13.5px;
    transition: background .2s, transform .2s;
}
.bale-link:hover { background: rgba(0, 144, 184, .16); transform: translateY(-1px); }
[data-theme="dark"] .bale-link, .dark-mode .bale-link { background: rgba(0, 212, 255, .1); border-color: rgba(0, 212, 255, .3); color: #38e0ff; }

/* قدرت رمز */
.password-strength { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #6a7180; margin-top: 8px; }
[data-theme="dark"] .password-strength, .dark-mode .password-strength { color: #9aa3b5; }
.strength-meter { flex: 1; height: 5px; background: #e5e9f2; border-radius: 3px; overflow: hidden; }
[data-theme="dark"] .strength-meter, .dark-mode .strength-meter { background: #262f44; }
.strength-fill { height: 100%; width: 0; border-radius: 3px; background: #ef4444; transition: width .3s ease, background .3s ease; }
.password-requirements { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 8px; font-size: 11.5px; color: #8a90a0; }
[data-theme="dark"] .password-requirements, .dark-mode .password-requirements { color: #79839a; }
.password-requirements .requirement { display: flex; align-items: center; gap: 6px; }
.password-requirements .requirement i { font-size: 7px; color: #c3c9d6; transition: color .2s; }
.password-requirements .requirement.ok { color: #059669; }
.password-requirements .requirement.ok i { color: #10b981; }

/* رمز پیشنهادی */
.suggested-password {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px; padding: 9px 12px;
    background: #f6f8fc; border: 1px dashed #c9d0e2; border-radius: 10px;
}
[data-theme="dark"] .suggested-password, .dark-mode .suggested-password { background: #171d2c; border-color: #2c3752; }
.suggested-password code { flex: 1; direction: ltr; text-align: left; font-size: 13px; color: #7c3aed; background: transparent; word-break: break-all; }
[data-theme="dark"] .suggested-password code, .dark-mode .suggested-password code { color: #00d4ff; }
.suggested-password button {
    background: #fff; border: 1px solid #d6dbe6; color: #4b5163;
    border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all .2s;
}
.suggested-password button:hover { border-color: #7c3aed; color: #7c3aed; }
[data-theme="dark"] .suggested-password button, .dark-mode .suggested-password button { background: #1a2132; border-color: #2e3648; color: #b6bfd2; }

.terms-row { display: flex; align-items: flex-start; gap: 9px; margin: 4px 2px 16px; font-size: 12.5px; color: #4b5163; line-height: 1.9; }
[data-theme="dark"] .terms-row, .dark-mode .terms-row { color: #b6bfd2; }
.terms-row input { width: 17px; height: 17px; accent-color: #7c3aed; margin-top: 4px; cursor: pointer; flex: 0 0 auto; }
.terms-row a { color: #7c3aed; text-decoration: none; font-weight: 600; }

.security-note {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 18px; font-size: 12px; color: #8a90a0;
}
[data-theme="dark"] .security-note, .dark-mode .security-note { color: #79839a; }

#passwordMatch { margin-top: 6px; font-size: 12.5px; color: #059669; display: none; }

@media (max-width: 520px) {
    .auth-card { padding: 28px 20px 22px; border-radius: 20px; }
    .auth-container { padding: 24px 12px 40px; }
    .password-requirements { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-fx .orb, .auth-fx .note, .auth-logo { animation: none !important; }
    .auth-card { animation-duration: .01s; }
}


/* ═══ [T36] لوگوی واقعی برند در کارت احراز هویت ═══ */
.auth-logo.auth-logo-brand {
    background: none;
    box-shadow: none;
    border-radius: 0;
    width: auto;
    height: auto;
    animation: none;
    margin-bottom: 12px;
}
.auth-logo.auth-logo-brand img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 8px 18px rgba(22, 101, 52, .16));
}
[data-theme="dark"] .auth-logo.auth-logo-brand img, .dark-mode .auth-logo.auth-logo-brand img {
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .5));
}

/* ==================== [T40] استاندارد موبایل احراز هویت ==================== */
@media (max-width: 640px) {
  .auth-button { min-height: 46px; font-size: 0.95rem; }
  .auth-tab { min-height: 44px; font-size: 0.9rem; }
  .input-wrapper input, .code-input { font-size: 16px; min-height: 46px; }
  .auth-message { font-size: 0.88rem; }
  .login-link, .login-prompt { font-size: 0.88rem; }
}
/* پایان [T40] احراز هویت */
