/* ============================================================
   login-responsive.css
   Override sheet — import AFTER login.css
   رنگ‌ها از theme.css  |  ریسپانسیو برای همه صفحه‌ها
   ============================================================ */

/* ── تم رنگی از theme.css ─────────────────────────────── */
:root {
    --bg: #112127;
    --text-color: #fff;
    --primary-btn: #2E9754;
    --primary-btn-hover: #53b677b2;
    --secondary-btn: #242F33;
    --secondary-btn-hover: #2a363abb;
    --input-bg: #ffffff2c;
}

/* ── پس‌زمینه صفحه ─────────────────────────────────────── */
body {
    background: var(--bg) !important;
    font-family: peyda, sans-serif;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ── رنگ پس‌زمینه تاریک (override متغیر ds) ──────────── */
body[data-ds-dark-theme] {
    --dsr-bg: var(--bg) !important;
}

/* ── کانتینر ریشه ──────────────────────────────────────── */
#root,
#root > .ds-theme,
.c994dda2 {
    width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ── پس‌زمینه انیمیشن‌دار سمت چپ ───────────────────────── */
._47c279e {
    background: linear-gradient(135deg, #0d1e24 0%, #112127 50%, #162e36 100%);
    flex-shrink: 0;
}

/* ── محفظه فرم ──────────────────────────────────────────── */
._99ad066 {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 2rem 1.5rem;
}

/* ── کارت فرم ───────────────────────────────────────────── */
.ds-auth-form-wrapper {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem !important;
    box-sizing: border-box;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
}

/* ── لوگو / عنوان ───────────────────────────────────────── */
.e2394955 {
    color: var(--primary-btn) !important;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

/* ── توضیح فرم ─────────────────────────────────────────── */
.ds-sign-up-form__description {
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 12px;
    text-align: center;
    margin-bottom: 1.25rem;
    line-height: 1.7;
    direction: rtl;
}

/* ── فیلدهای ورودی ──────────────────────────────────────── */
.ds-input {
    background: var(--input-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ds-input:focus-within {
    border-color: var(--primary-btn) !important;
    box-shadow: 0 0 0 3px rgba(46, 151, 84, 0.18) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.ds-input__input {
    color: var(--text-color) !important;
    background: transparent !important;
    font-family: peyda, sans-serif;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.ds-input__input::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}

/* ── آپلود عکس پروفایل — پیش‌نمایش دایره‌ای ────────────── */
.auth-avatar-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    gap: 8px;
}

.auth-avatar-picker {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}

.auth-avatar-picker:focus-visible .auth-avatar-preview {
    box-shadow: 0 0 0 3px var(--primary-btn);
}

.auth-avatar-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    border: 2px dashed rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-avatar-picker:hover .auth-avatar-preview {
    border-color: var(--primary-btn);
    background: rgba(46, 151, 84, 0.08);
}

/* وقتی عکس انتخاب شده حاشیه توپر بشه */
.auth-avatar-preview.has-image {
    border: 2.5px solid var(--primary-btn);
}

.auth-avatar-placeholder-icon {
    width: 38px;
    height: 38px;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.2s ease;
}

.auth-avatar-picker:hover .auth-avatar-placeholder-icon {
    color: rgba(255, 255, 255, 0.55);
}

.auth-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* اورلی دوربین روی هاور */
.auth-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.auth-avatar-overlay svg {
    width: 26px;
    height: 26px;
    color: #fff;
}

.auth-avatar-picker:hover .auth-avatar-overlay {
    opacity: 1;
}

.auth-avatar-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-family: peyda, sans-serif;
    direction: rtl;
}

/* wrapper که picker + دکمه حذف رو کنار هم نگه میداره */
.auth-avatar-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* دکمه سطل زباله روی عکس پروفایل ثبت‌نام */
.auth-avatar-delete {
    position: absolute;
    bottom: -4px;
    left: -4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e53e3e;
    border: 2px solid var(--bg, #112127);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.15s ease;
    z-index: 10;
    opacity: 1;
}

.auth-avatar-delete:hover {
    background: #c53030;
    transform: scale(1.12);
}

.auth-avatar-delete svg {
    width: 14px;
    height: 14px;
    color: #fff;
    flex-shrink: 0;
}

.auth-avatar-delete:disabled {
    display: none !important;
    pointer-events: none;
}

/* ── دکمه ثبت‌نام / ورود ────────────────────────────────── */
#auth-submit {
    background: var(--primary-btn) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600;
    font-family: peyda, sans-serif;
    width: 100% !important;
    padding: 12px 24px !important;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 16px rgba(46, 151, 84, 0.35);
    cursor: pointer;
}

#auth-submit:hover {
    background: var(--primary-btn-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(46, 151, 84, 0.45);
    opacity: 1;
}

#auth-submit:active {
    transform: translateY(0);
}

/* ── لینک تغییر حالت (ورود / ثبت‌نام) ─────────────────── */
#auth-toggle-mode,
.ds-link-button {
    color: var(--primary-btn) !important;
    font-size: 13px;
    opacity: 1 !important;
}

#auth-toggle-mode:hover .ds-link-button__text {
    text-decoration: underline;
}

/* ── فاصله آیتم‌های فرم ─────────────────────────────────── */
.ds-form-item {
    margin-bottom: 12px !important;
}

.ds-sign-up-form__form-footer {
    text-align: center;
    margin-top: 16px;
}

/* ── پیام خطا ───────────────────────────────────────────── */
#auth-feedback {
    border-radius: 8px;
    background: rgba(248, 136, 136, 0.1);
    padding: 8px 12px;
    font-size: 13px;
    text-align: center;
    direction: rtl;
}

.auth-username-status {
    margin: 6px 4px 0;
    min-height: 18px;
    font-size: 12px;
    line-height: 18px;
    direction: rtl;
    text-align: right;
}

.auth-username-status.is-taken,
.auth-username-status.is-invalid {
    color: #ff6b6b;
}

.auth-username-status.is-available {
    color: #4caf50;
}

/* ── مودال هشدار ────────────────────────────────────────── */
.auth-alert-modal__content {
    background: var(--secondary-btn) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px !important;
}

.auth-alert-modal__btn {
    background: var(--primary-btn) !important;
    border-radius: 10px !important;
    transition: background 0.2s ease;
}

.auth-alert-modal__btn:hover {
    background: var(--primary-btn-hover) !important;
    opacity: 1;
}

/* ============================================================
   ریسپانسیو — موبایل کوچک (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    ._99ad066 {
        padding: 1rem 1rem;
        align-items: flex-start;
        padding-top: max(1.5rem, env(safe-area-inset-top));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .ds-auth-form-wrapper {
        padding: 1.5rem 1.25rem !important;
        border-radius: 16px !important;
        border-left: none !important;
        border-right: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .e2394955 {
        font-size: clamp(1.3rem, 7vw, 1.6rem);
        margin-bottom: 1rem;
    }

    .ds-sign-up-form__description {
        font-size: 11px;
    }

    .ds-form-item {
        margin-bottom: 10px !important;
    }

    #auth-submit {
        font-size: 14px !important;
        padding: 11px 16px !important;
    }
}

/* ============================================================
   ریسپانسیو — تبلت (481px – 768px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 768px) {
    ._99ad066 {
        padding: 2rem 2rem;
    }

    .ds-auth-form-wrapper {
        max-width: 400px;
        padding: 2rem 1.75rem !important;
    }
}

/* ============================================================
   ریسپانسیو — تبلت بزرگ (769px – 1024px)
   ============================================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .ds-auth-form-wrapper {
        max-width: 440px;
    }
}

/* ============================================================
   ریسپانسیو — دسکتاپ بزرگ (≥ 1440px)
   ============================================================ */
@media (min-width: 1440px) {
    .ds-auth-form-wrapper {
        max-width: 460px;
        padding: 3rem 2.5rem !important;
    }

    .e2394955 {
        font-size: 2.1rem;
    }
}

/* ============================================================
   ریسپانسیو — صفحه‌های خیلی کوچک (≤ 360px)
   ============================================================ */
@media (max-width: 360px) {
    .ds-auth-form-wrapper {
        padding: 1.25rem 1rem !important;
    }

    .e2394955 {
        font-size: 1.2rem;
    }

    .ds-input--l {
        --ds-input-height-l: 44px !important;
    }
}

/* ============================================================
   حالت landscape موبایل
   ============================================================ */
@media (max-height: 600px) and (orientation: landscape) {
    ._99ad066 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        align-items: flex-start;
    }

    .ds-auth-form-wrapper {
        padding: 1rem 1.5rem !important;
    }

    .e2394955 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }

    .ds-sign-up-form__description {
        margin-bottom: 0.75rem;
    }

    .ds-form-item {
        margin-bottom: 8px !important;
    }
}

/* پیش‌فرض: ورود — فیلدهای ثبت‌نام تا کلیک «ثبت‌نام» مخفی */
.ds-auth-form-wrapper:not(.auth-mode-signup) .auth-signup-only {
    display: none;
}
