﻿/* ============================================
   TehranOne — Auth Modal (OTP + profile)
   لایت/دارک با توکن‌های محلی؛ دکمه‌ها خنثی (بدون پس‌زمینهٔ سبز یا حاشیهٔ قرمز)
   ============================================ */

.to-auth-modal {
    --au-bg: #ffffff;
    --au-text: #0F172A;
    --au-muted: #64748B;
    --au-line: #E2E8F0;
    --au-soft: #F5F7F8;
    --au-accent: #111827;
    --au-accent-text: #ffffff;
    --au-ring: rgba(15, 23, 42, 0.10);
    --au-danger: #B42318;
    --au-danger-bg: #FEF3F2;
    --au-ok: #067647;
    --au-ok-bg: #ECFDF3;
    --au-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.28);
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--to-font);
    color: var(--au-text);
}

html.to-dark .to-auth-modal {
    --au-bg: #10201B;
    --au-text: #E7EFEB;
    --au-muted: #9FB3AC;
    --au-line: #243A35;
    --au-soft: #14251F;
    --au-accent: #F1F5F4;
    --au-accent-text: #0B1F1A;
    --au-ring: rgba(231, 239, 235, 0.14);
    --au-danger: #FFB4B4;
    --au-danger-bg: #2A1518;
    --au-ok: #8FE3CB;
    --au-ok-bg: #163229;
    --au-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
}

.to-auth-modal[hidden] {
    display: none;
}

/* ورودی‌ها width:100% + padding دارند؛ بدون border-box از مودال بیرون می‌زنند. */
.to-auth-modal__dialog,
.to-auth-modal__dialog * {
    box-sizing: border-box;
}

.to-auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ---------- dialog ---------- */

.to-auth-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 430px;
    max-height: min(92vh, 720px);
    max-height: min(92dvh, 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--au-bg);
    color: var(--au-text);
    border: 1px solid var(--au-line);
    border-radius: 24px;
    box-shadow: var(--au-shadow);
    animation: to-auth-in 0.22s ease;
}

@keyframes to-auth-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .to-auth-modal__dialog { animation: none; }
}

.to-auth-modal__close {
    position: absolute;
    inset-inline-end: 12px;
    top: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    color: var(--au-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.to-auth-modal__close:hover {
    background: var(--au-soft);
    color: var(--au-text);
}

/* ---------- brand ---------- */

.to-auth-modal__brand {
    padding: 30px 26px 0;
    text-align: center;
}

.to-auth-modal__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 12px;
    border-radius: 15px;
    background: var(--au-soft);
    border: 1px solid var(--au-line);
    color: var(--au-text);
}

.to-auth-modal__title {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--au-text);
}

.to-auth-modal__sub {
    margin: 0;
    font-size: 13px;
    line-height: 1.9;
    color: var(--au-muted);
}

/* ---------- body / steps ---------- */

.to-auth-modal__body {
    padding: 18px 26px 26px;
}

.to-auth-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 18px;
}

.to-auth-dots[hidden] {
    display: none;
}

.to-auth-dot {
    width: 22px;
    height: 4px;
    border-radius: 999px;
    background: var(--au-line);
    transition: background 0.2s ease;
}

.to-auth-dot.is-active {
    background: var(--au-text);
}

.to-auth-step {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.to-auth-step[hidden] {
    display: none;
}

.to-auth-lead {
    margin: 0;
    font-size: 13.5px;
    line-height: 2;
    text-align: center;
    color: var(--au-muted);
}

.to-auth-lead strong {
    color: var(--au-text);
    font-weight: 700;
    letter-spacing: 0.03em;
}

/* ---------- روش ورود: موبایل / ایمیل ---------- */

.to-auth-methods {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--au-soft);
    border: 1px solid var(--au-line);
    border-radius: 999px;
}

.to-auth-methods[hidden] {
    display: none;
}

.to-auth-method {
    flex: 1;
    padding: 9px 12px;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--au-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.to-auth-method.is-active {
    background: var(--au-bg);
    color: var(--au-text);
    box-shadow: 0 1px 2px var(--au-ring);
}

.to-auth-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.to-auth-panel[hidden] {
    display: none;
}

.to-auth-hint {
    margin: 0;
    font-size: 12px;
    line-height: 1.9;
    color: var(--au-muted);
}

/* ---------- fields ---------- */

.to-auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* فیلدهای مخفی (ناهم‌تراز با display:flex نمی‌شوند) */
.to-auth-field[hidden],
.to-auth-reg-only[hidden] {
    display: none;
}

/* وضعیت زندهٔ نام کاربری/ایمیل در ثبت‌نام */
.to-auth-status {
    display: none;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.8;
}

.to-auth-status.is-ok {
    display: block;
    color: var(--au-ok);
}

.to-auth-status.is-error {
    display: block;
    color: var(--au-danger);
}

.to-auth-field__label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--au-muted);
}

.to-auth-req {
    color: var(--au-danger);
}

.to-auth-field__box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 14px;
    background: var(--au-bg);
    border: 1px solid var(--au-line);
    border-radius: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.to-auth-field__box:focus-within {
    border-color: var(--au-text);
    box-shadow: 0 0 0 4px var(--au-ring);
}

.to-auth-field__flag {
    flex: 0 0 auto;
    display: inline-flex;
    width: 26px;
    height: 17px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.10);
}

.to-auth-field__flag svg {
    display: block;
    width: 100%;
    height: 100%;
}

.to-auth-field__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--au-text);
    direction: ltr;
    text-align: right;
}

.to-auth-field__input::placeholder {
    color: var(--au-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.to-auth-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--au-line);
    border-radius: 14px;
    background: var(--au-bg);
    color: var(--au-text);
    font-family: inherit;
    font-size: 14.5px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.to-auth-input:focus {
    outline: none;
    border-color: var(--au-text);
    box-shadow: 0 0 0 4px var(--au-ring);
}

textarea.to-auth-input {
    resize: vertical;
    min-height: 66px;
    line-height: 1.9;
}

/* ---------- نمایش/پنهان‌کردن رمز (آیکن چشم) ---------- */

.to-auth-pass {
    position: relative;
    display: block;
}

.to-auth-pass .to-auth-input {
    /* دکمهٔ چشم سمت راست فیلد است (مستقل از RTL) */
    padding-right: 46px;
}

.to-auth-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--au-muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.to-auth-eye:hover {
    color: var(--au-text);
    background: var(--au-soft);
}

.to-auth-eye svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* فقط یک آیکن دیده شود: مخفی → چشم باز، نمایان → چشم بسته */
.to-auth-eye .to-auth-eye__hide {
    display: none;
}

.to-auth-eye.is-on .to-auth-eye__show {
    display: none;
}

.to-auth-eye.is-on .to-auth-eye__hide {
    display: block;
}

.to-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---------- OTP ---------- */

.to-auth-otp {
    display: flex;
    gap: 8px;
    direction: ltr;
}

.to-auth-otp input {
    flex: 1;
    min-width: 0;
    height: 56px;
    text-align: center;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    color: var(--au-text);
    background: var(--au-bg);
    border: 1px solid var(--au-line);
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.to-auth-otp input:focus {
    outline: none;
    border-color: var(--au-text);
    box-shadow: 0 0 0 4px var(--au-ring);
}

.to-auth-resend {
    text-align: center;
}

.to-auth-resend__btn {
    padding: 4px 10px;
    background: none;
    border: 0;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--au-text);
    cursor: pointer;
}

.to-auth-resend__btn:disabled {
    color: var(--au-muted);
    cursor: default;
}

.to-auth-resend__timer {
    color: var(--au-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- messages ---------- */

.to-auth-msg {
    display: none;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.8;
}

.to-auth-msg--error {
    display: block;
    background: var(--au-danger-bg);
    color: var(--au-danger);
}

.to-auth-msg--success {
    display: block;
    background: var(--au-ok-bg);
    color: var(--au-ok);
}

/* ---------- buttons — هم‌شکل با دکمه‌های سراسری سایت (‎.to-gp-btn) ---------- */

.to-auth-btn {
    width: 100%;
    padding: 0 20px;
    border: 0;
    border-radius: 7px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.8;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.to-auth-btn--primary {
    background: #0F5446;
    color: #fff;
}

.to-auth-btn--primary:hover {
    background: #0C4539;
    color: #fff;
}

.to-auth-btn--primary:active {
    transform: translateY(1px);
}

.to-auth-btn--primary:focus-visible,
.to-auth-btn--link:focus-visible {
    outline: 2px solid var(--au-text);
    outline-offset: 2px;
}

.to-auth-btn--link {
    padding: 4px;
    background: transparent;
    color: var(--au-muted);
    font-size: 12.5px;
    font-weight: 600;
}

.to-auth-btn--link:hover {
    color: var(--au-text);
}

.to-auth-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

/* ---------- success ---------- */

.to-auth-success {
    text-align: center;
    padding: 22px 8px 10px;
}

.to-auth-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--au-ok-bg);
    color: var(--au-ok);
}

.to-auth-success__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
}

.to-auth-success__desc {
    margin: 0;
    font-size: 13px;
    color: var(--au-muted);
}

/* ---------- responsive ---------- */

@media (max-width: 480px) {
    .to-auth-modal {
        padding: 12px;
    }

    .to-auth-modal__dialog {
        max-height: calc(100dvh - 24px);
        border-radius: 20px;
    }

    .to-auth-modal__brand {
        padding: 26px 18px 0;
    }

    .to-auth-modal__body {
        padding: 16px 18px 20px;
    }

    .to-auth-otp {
        gap: 6px;
    }

    .to-auth-otp input {
        height: 50px;
        font-size: 18px;
    }

    .to-auth-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 560px) {
    .to-auth-modal__brand {
        padding-top: 22px;
    }

    .to-auth-modal__mark {
        display: none;
    }
}

/* دکمه دریافت کد از بله — خنثی، هم‌راستا با بقیهٔ دکمه‌ها */
.to-bale-code-btn {
    display: block !important;
    width: 100% !important;
    margin-top: 8px !important;
    padding: 9px 14px !important;
    background: transparent !important;
    border: 1px solid var(--au-line) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    color: var(--au-text) !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.to-bale-code-btn:hover {
    background: var(--au-soft) !important;
    border-color: var(--au-line) !important;
    color: var(--au-text) !important;
}

/* ============================================
   اولویت بر استایل‌های جهانی (Elementor kit + reset)
   دکمه‌ها هم‌شکل با دکمه‌های سایت: قرمز #F03E58، شعاع ۱۲، فونت ۱۴/۶۰۰
   ============================================ */

#to-auth-modal .to-auth-btn {
    border: 0;
    border-radius: 7px;
    padding: 0 20px;
    background-image: none;
    box-shadow: none;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.8;
    text-transform: none;
}

#to-auth-modal .to-auth-btn--primary {
    background: #0F5446;
    color: #fff;
}

#to-auth-modal .to-auth-btn--primary:hover {
    background: #0C4539;
    color: #fff;
    opacity: 1;
}

#to-auth-modal .to-auth-btn--link {
    background: transparent;
    color: var(--au-muted);
    border-color: transparent;
    padding: 4px;
    font-size: 12.5px;
}

#to-auth-modal .to-auth-btn--link:hover {
    background: transparent;
    color: var(--au-text);
}

#to-auth-modal .to-auth-method {
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--au-muted);
    font-family: inherit;
    font-size: 13px;
}

#to-auth-modal .to-auth-method.is-active {
    background: var(--au-bg);
    color: var(--au-text);
}

#to-auth-modal .to-auth-method:hover {
    background: transparent;
    color: var(--au-text);
}

#to-auth-modal .to-auth-modal__close,
#to-auth-modal .to-auth-resend__btn {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--au-text);
}

#to-auth-modal .to-auth-modal__close:hover {
    background: var(--au-soft);
}

#to-auth-modal .to-auth-input,
#to-auth-modal .to-auth-otp input,
#to-auth-modal .to-auth-field__input {
    font-family: inherit;
    background-image: none;
    box-shadow: none;
}

#to-auth-modal .to-auth-input {
    border: 1px solid var(--au-line);
    border-radius: 14px;
    background-color: var(--au-bg);
    color: var(--au-text);
}

#to-auth-modal .to-auth-otp input {
    border: 1px solid var(--au-line);
    border-radius: 12px;
    background-color: var(--au-bg);
    color: var(--au-text);
}

#to-auth-modal .to-bale-code-btn {
    background: transparent !important;
    border: 1px solid var(--au-line) !important;
    border-radius: 12px !important;
    color: var(--au-text) !important;
}

/* دکمهٔ چشم رمز در برابر استایل سراسری دکمه‌ها */
#to-auth-modal .to-auth-eye {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--au-muted);
}

#to-auth-modal .to-auth-eye:hover {
    background: var(--au-soft);
    color: var(--au-text);
}

