/* =========================================================
   استایل اختصاصی صفحه ورود / ثبت‌نام MoonGPT
   نسخه ریسپانسیو بدون تغییر در دیزاین اصلی
   ========================================================= */

/* ------------------------------
   ریست و تنظیمات عمومی
------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* یکپارچه‌سازی فونت تمام المان‌های فرم */
button,
input,
textarea,
select {
    font-family: inherit !important;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

/* ------------------------------
   بدنه اصلی صفحه
------------------------------ */
.login-body {
    min-height: 100vh;
    background-color: var(--bg-dark-portal, #0b0c10);
    font-family: 'Vazirmatn', sans-serif !important;
    position: relative;
    overflow-x: hidden;
    color: #ffffff;
}

/* لایه مرکزی برای قرار گرفتن کارت در وسط */
.login-page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* افکت نورانی پشت کارت */
.login-body::before {
    content: '';
    position: fixed;
    width: min(70vw, 420px);
    height: min(70vw, 420px);
    background: radial-gradient(circle, rgba(138, 43, 226, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}

/* ------------------------------
   کارت اصلی
------------------------------ */
.login-card-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 32px;
    background-color: var(--card-bg, rgba(22, 22, 37, 0.7));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 20px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(138, 43, 226, 0.1);
    transition: all 0.3s ease;
}

/* ------------------------------
   لوگو
------------------------------ */
.brand-logo-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    box-shadow: inset 0 0 15px rgba(0, 255, 255, 0.1);
}

/* ------------------------------
   متن‌ها
------------------------------ */
.brand-title {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.8;
    letter-spacing: -0.3px;
    margin-bottom: 0.5rem;
}

.brand-subtitle {
    color: #d1d5db;
    font-size: 0.96rem;
    margin-bottom: 0.25rem;
    line-height: 1.8;
}

.brand-features {
    display: block;
    margin-bottom: 1.5rem;
    font-size: 0.84rem;
    line-height: 1.8;
}

.text-muted-custom {
    color: var(--text-muted-custom, #8b98ad) !important;
}

/* ------------------------------
   فرم مرحله‌ای
------------------------------ */
.auth-step {
    animation: fadeIn 0.4s ease-in-out;
}

.active-step {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ------------------------------
   ورودی شماره موبایل
------------------------------ */
.input-icon-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted-custom, #8b98ad);
    font-size: 1.05rem;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 2;
}

.custom-auth-input {
    width: 100%;
    min-height: 50px;
    background-color: rgba(15, 16, 24, 0.8) !important;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1)) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 12px 48px 12px 16px !important;
    font-size: 1rem;
    transition: all 0.3s ease !important;
}

.custom-auth-input::placeholder {
    color: #8b98ad !important;
    opacity: 1;
}

.custom-auth-input:focus {
    border-color: var(--secondary-glow, #00ffff) !important;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2) !important;
    outline: none;
    background-color: rgba(15, 16, 24, 0.9) !important;
}

.input-icon-wrapper:focus-within .input-icon {
    color: var(--secondary-glow, #00ffff);
}

/* ------------------------------
   دکمه اصلی
------------------------------ */
.btn-auth-submit {
    min-height: 50px;
    background-color: #f3f4f6;
    color: #0b0c10;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    padding: 12px 16px;
    margin-bottom: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-auth-submit:hover {
    background-color: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.25);
}

.btn-auth-submit:active {
    transform: translateY(0);
}

.btn-auth-submit:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.12);
}

/* ------------------------------
   بخش OTP
------------------------------ */
.otp-notice {
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.9;
    margin-bottom: 1rem;
}

.dir-ltr {
    direction: ltr;
}

.otp-inputs-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 1rem;
}

.otp-box {
    width: 50px;
    height: 55px;
    flex: 0 0 auto;
    background-color: rgba(15, 16, 24, 0.8) !important;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1)) !important;
    color: var(--secondary-glow, #00ffff) !important;
    font-size: 1.35rem !important;
    font-weight: 700;
    border-radius: 10px !important;
    transition: all 0.2s ease;
    padding: 0 !important;
    text-align: center;
}

.otp-box:focus {
    border-color: var(--primary-glow, #8a2be2) !important;
    box-shadow: 0 0 12px rgba(138, 43, 226, 0.4) !important;
    outline: none;
}

/* ------------------------------
   لینک‌ها و فوتر
------------------------------ */
.edit-phone-link {
    color: var(--text-muted-custom, #8b98ad);
    font-size: 0.85rem;
    transition: color 0.2s ease;
    margin-bottom: 1.25rem;
}

.edit-phone-link:hover {
    color: #ffffff;
}

.auth-card-footer {
    margin-top: 0.5rem;
}

.terms-text {
    font-size: 0.82rem;
    line-height: 1.9;
    margin-bottom: 0.3rem;
}

.auth-link {
    color: #d1d5db;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--secondary-glow, #00ffff);
}

/* ------------------------------
   ریسپانسیو - تبلت
------------------------------ */
@media (max-width: 768px) {
    .login-page-wrapper {
        padding: 18px;
    }

    .login-card-container {
        max-width: 430px;
        padding: 28px 24px;
    }

    .brand-title {
        font-size: 1.3rem;
    }

    .brand-subtitle {
        font-size: 0.93rem;
    }
}

/* ------------------------------
   ریسپانسیو - موبایل
------------------------------ */
@media (max-width: 576px) {
    .login-page-wrapper {
        padding: 14px;
    }

    .login-card-container {
        max-width: 100%;
        border-radius: 18px;
        padding: 24px 18px;
    }

    .brand-logo-wrapper {
        width: 72px;
        height: 72px;
        margin-bottom: 1rem !important;
    }

    .brand-title {
        font-size: 1.15rem;
        line-height: 1.9;
        margin-bottom: 0.4rem;
    }

    .brand-subtitle {
        font-size: 0.88rem;
        line-height: 1.9;
    }

    .brand-features {
        font-size: 0.79rem;
        margin-bottom: 1.25rem;
    }

    .custom-auth-input {
        min-height: 48px;
        padding: 11px 44px 11px 14px !important;
        font-size: 0.95rem;
    }

    .input-icon-wrapper .input-icon {
        right: 14px;
        font-size: 1rem;
    }

    .btn-auth-submit {
        min-height: 48px;
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .otp-notice {
        font-size: 0.82rem;
        margin-bottom: 0.9rem;
    }

    .otp-inputs-wrapper {
        gap: 8px;
        margin-bottom: 0.9rem;
    }

    .otp-box {
        width: clamp(42px, 18vw, 48px);
        height: clamp(48px, 18vw, 52px);
        font-size: 1.2rem !important;
    }

    .edit-phone-link {
        font-size: 0.82rem;
        margin-bottom: 1rem;
    }

    .terms-text,
    .auth-link {
        font-size: 0.78rem;
    }
}

/* ------------------------------
   ریسپانسیو - موبایل خیلی کوچک
------------------------------ */
@media (max-width: 400px) {
    .login-page-wrapper {
        padding: 10px;
    }

    .login-card-container {
        padding: 20px 14px;
        border-radius: 16px;
    }

    .brand-logo-wrapper {
        width: 66px;
        height: 66px;
    }

    .brand-title {
        font-size: 1.02rem;
    }

    .brand-subtitle {
        font-size: 0.82rem;
    }

    .brand-features {
        font-size: 0.75rem;
    }

    .custom-auth-input {
        font-size: 0.9rem;
        min-height: 46px;
    }

    .btn-auth-submit {
        min-height: 46px;
        font-size: 0.92rem;
    }

    .otp-inputs-wrapper {
        gap: 6px;
    }

    .otp-box {
        width: 40px;
        height: 46px;
        font-size: 1.05rem !important;
    }
}

/* ------------------------------
   ریسپانسیو - خیلی خیلی کوچک
------------------------------ */
@media (max-width: 340px) {
    .login-card-container {
        padding: 18px 12px;
    }

    .otp-inputs-wrapper {
        gap: 5px;
    }

    .otp-box {
        width: 36px;
        height: 42px;
        font-size: 0.98rem !important;
    }

    .brand-title {
        font-size: 0.95rem;
    }

    .brand-subtitle {
        font-size: 0.78rem;
    }
}
