@import url("./../../fonts/yekan-bakh/stylesheet.css");
@import url("./../../fonts/IRANSans/style.css");

:root {
    /* پالت رنگی اصلی (دست‌نخورده) */
    --primary: #2e86c1;
    --primary-light: #84caf9;
    --secondary: #1deb3c;
    --secondary-hover: #15802a;
    --background-light: #f0f8ff;
    --background-footer: #d4ecfd;
    --background-card: #ffffff;
    --text-primary: #000000;
    --text-secondary: #707070;
    --text-discount: #008000;
    --text-original: #ff0000;
    --border-neutral: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.25);
    --gradient-instagram-from: #f92ca7;
    --gradient-instagram-to: #6b1a93;
    --button-mobile: #4f9acd;
    --button-mobile-light: #a2cdeb;
    --support-section: #2e86c1;
    --support-text: #084d7c;

    /* شعاع گوشه‌ها */
    --radius-button: 0.75rem;
    --radius-button-large: 1rem;
    --radius-card: 1.25rem;
    --radius-footer: 2rem;
    --radius-nav: 1.5rem;
    --radius-circle: 9999px;

    /* سایه‌ها و حالات (افزوده شده - تغییری در پالت نمی‌دهد) */
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px -12px rgba(46, 134, 193, 0.2);
    --shadow-focus: 0 0 0 4px rgba(46, 134, 193, 0.14);
    --ink-soft: #475569;
}

/* Reset and Base Styles */
* {
    direction: rtl;
    text-align: right;
    font-family: "Yekan Bakh", sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

body {
    background: linear-gradient(
        135deg,
        var(--background-light) 0%,
        var(--background-footer) 100%
    );
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    padding: 0;
    position: relative;
}

/* پس‌زمینه ثابت برای موبایل */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        var(--background-light) 0%,
        var(--background-footer) 100%
    );
    z-index: -1;
}

.d-none {
    display: none !important;
}

/* Header Panel */
.header-panel {
    background: linear-gradient(
        90deg,
        var(--primary) 0%,
        var(--primary-light) 100%
    );
    color: var(--background-card);
    padding: 1rem;
    text-align: center;
    border-top-left-radius: var(--radius-card);
    border-top-right-radius: var(--radius-card);
    box-shadow: 0 2px 8px rgba(46, 134, 193, 0.2);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

/* ---------- ورودی‌ها ---------- */
.form-control {
    direction: ltr;
    text-align: left;
    font-family: "IRANSans", sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    border: 1.5px solid var(--border-neutral);
    background: var(--background-card);
    padding: 0.6rem 1.1rem;
    height: 48px;
    border-radius: var(--radius-button);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
    outline: none;
}

.form-control::placeholder {
    font-family: "IRANSans", sans-serif;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.5;
}

input::placeholder {
    font-family: "IRANSans", sans-serif;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 400;
    opacity: 0.5;
}

/* ---------- دکمه‌ها ---------- */
button {
    border: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn.custom-gradient {
    background: linear-gradient(
        90deg,
        var(--primary) 0%,
        var(--primary-light) 100%
    );
    color: var(--background-card);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-button);
    box-shadow: 0 4px 14px rgba(46, 134, 193, 0.28);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: all 0.15s ease;
}

.btn.custom-gradient::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.18),
        transparent
    );
    transition: left 0.45s ease;
}

.btn.custom-gradient:hover:not(:disabled)::before {
    left: 100%;
}

.btn.custom-gradient:hover:not(:disabled) {
    filter: brightness(1.03);
    box-shadow: 0 6px 18px rgba(46, 134, 193, 0.36);
    transform: translateY(-1px);
}

.btn.custom-gradient:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(46, 134, 193, 0.24);
}

.btn.custom-gradient:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-danger {
    background: var(--text-original);
    color: var(--background-card);
    border-radius: var(--radius-button);
    padding: 0.7rem 1.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.btn-danger:hover {
    background: #d32f2f;
    box-shadow: 0 6px 18px rgba(211, 47, 47, 0.32);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: var(--radius-button);
    padding: 0.7rem 1.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.15s ease;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--background-card);
    box-shadow: 0 6px 18px rgba(46, 134, 193, 0.32);
    transform: translateY(-1px);
}

/* ---------- کلاس‌های کمکی ---------- */
.custom-shadow {
    box-shadow: none;
}

.custom-rounded {
    border-radius: var(--radius-card);
}

.text-custom-gray {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
}

.h-100vh {
    height: 100vh;
}

.p-7 {
    padding: 1.75rem;
}

/* ---------- ساختار صفحه لاگین ---------- */
.dr-auth-page {
    width: 100%;
}

.dr-auth-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    direction: ltr;
    background: #fff;
    overflow: hidden;
}

.dr-auth-visual {
    background: #e8f7f7;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    background: var(--background-light);
}

.dr-auth-form-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dr-auth-visual-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* بنر موبایل */
.dr-auth-mobile-banner {
    display: none;
}

.dr-auth-mobile-banner-inner {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dr-auth-mobile-logo {
    width: 112px;
    height: auto;
    margin: 0 auto 0.65rem;
    display: block;
}

.dr-auth-mobile-title {
    margin: 0;
    font-size: 1.22rem;
    color: #1f3a4d;
    font-weight: 700;
    text-align: center;
}

.dr-auth-mobile-subtitle {
    margin: 0.2rem 0 0;
    font-size: 1.12rem;
    color: #1f3a4d;
    text-align: center;
    font-weight: 600;
}

/* ---------- کارت لاگین ---------- */
.login-card {
    width: 100%;
    min-width: 320px;
    max-width: 540px;
    background: var(--background-card);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.login-card label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
}

/* لوگو */
.logo-wrapper {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
    padding: 0.25rem 0;
}

.logo-wrapper img {
    height: 60px;
    width: auto;
    transition: opacity 0.15s ease;
}

.logo-wrapper img:hover {
    opacity: 0.85;
}

.logo-hover {
    transition: opacity 0.15s ease;
}

.logo-hover:hover {
    opacity: 0.85;
}

/* هدر مرحله */
.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.step-title {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(46, 134, 193, 0.08);
    border: 1px solid rgba(46, 134, 193, 0.18);
    color: var(--support-text);
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-circle);
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.18);
    flex: 0 0 auto;
}

/* لینک بازگشت */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-button);
    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.back-link:hover {
    color: var(--primary);
    background: rgba(46, 134, 193, 0.08);
}

.back-link img {
    width: 18px;
    max-width: 18px;
}

/* کلید نمایش رمز */
.password-toggle {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 24px;
    height: 24px;
    padding: 0.2rem;
    border-radius: 6px;
    opacity: 0.55;
    transition:
        opacity 0.15s ease,
        background-color 0.15s ease;
}

.password-toggle:hover {
    opacity: 1;
    background: rgba(46, 134, 193, 0.1);
}

/* سوئیچ ورود/ثبت‌نام */
.auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border-neutral);
    border-radius: var(--radius-button);
    padding: 0.25rem;
    background: #f8fafc;
    margin-bottom: 1.5rem;
}

.auth-switch-item {
    border: 0;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
    padding: 0.55rem 0.75rem;
    color: var(--text-secondary);
    border-radius: calc(var(--radius-button) - 2px);
    transition: all 0.15s ease;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.auth-switch-item.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.auth-switch-item:not(.active):hover {
    color: var(--primary);
}

/* ---------- ورودی کد تأیید ---------- */
.otp-group {
    gap: 0.75rem !important;
}

.login-card .otp-input {
    width: 56px !important;
    height: 56px !important;
    min-height: 56px !important;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    font-family: "IRANSans", sans-serif;
    color: var(--text-primary);
    border: 2px solid var(--border-neutral);
    border-radius: var(--radius-button);
    background: var(--background-light);
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;
}

.login-card .otp-input:focus {
    border-color: var(--primary);
    background: var(--background-card);
    box-shadow: var(--shadow-focus);
}

.login-card .otp-input:valid {
    border-color: var(--secondary);
    background: rgba(29, 235, 60, 0.1);
}

/* ---------- پیام خطا ---------- */
.login-card .invalid-feedback {
    color: var(--text-original);
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.45rem;
}

.error-message {
    color: var(--text-original);
    font-size: 0.85rem;
    margin-top: 0.4rem;
}

/* ---------- تایمر و نوار پیشرفت کد ---------- */
#progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-neutral);
    border-radius: var(--radius-circle);
    overflow: hidden;
    direction: ltr;
    margin: 1rem 0;
}

#progress-bar {
    height: 100%;
    border-radius: var(--radius-circle);
    background: linear-gradient(
        90deg,
        var(--secondary) 0%,
        var(--secondary-hover) 100%
    );
    transition:
        width 0.5s ease,
        background-color 0.5s ease;
}

#resend-otp a {
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

#resend-otp a:hover {
    color: var(--support-text);
}

#timer {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---------- نکات تعیین رمز عبور ---------- */
.login-card .alert-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(46, 134, 193, 0.06);
    border: 1px solid rgba(46, 134, 193, 0.16);
    color: var(--support-text);
    border-radius: var(--radius-button);
    font-size: 0.85rem;
    padding: 0.9rem 1rem;
}

.login-card .alert-info ul {
    margin-top: 0.4rem;
    margin-bottom: 0;
    padding-right: 1.1rem;
}

.login-card .alert-info li {
    margin-bottom: 0.25rem;
}

/* ---------- لودر ---------- */
.loader {
    border: 3px solid var(--background-light);
    border-top: 3px solid var(--primary);
    border-radius: var(--radius-circle);
    width: 22px;
    height: 22px;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ---------- مودال ---------- */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.modal-content {
    border: none;
    border-radius: var(--radius-card);
    box-shadow: 0 15px 35px var(--shadow);
    background: var(--background-card);
    padding: 1.5rem;
}

/* ---------- ارتفاع یکسان کنترل‌ها ---------- */
.login-card .form-control,
.login-card .btn.custom-gradient,
.login-card .btn-outline-primary,
.login-card .btn-outline-dark,
.login-card .btn-danger {
    height: 48px !important;
    min-height: 48px !important;
}

.login-card .otp-input {
    width: 60px !important;
    height: 60px !important;
    min-height: 60px !important;
}

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1024px) {
    .login-card {
        max-width: 540px;
        margin: 0 auto;
    }

    .p-7 {
        padding: 1.5rem;
    }

    .logo-wrapper {
        margin-bottom: 1rem;
    }

    .header-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 991.98px) {
    body {
        padding: 0;
    }

    .dr-auth-shell {
        grid-template-columns: 1fr;
        min-height: 100vh;
        width: 100%;
    }

    .dr-auth-visual {
        display: none;
    }

    .login-wrapper {
        padding: 0;
        min-height: 100vh;
        display: flex !important;
        flex-direction: column;
        align-items: stretch !important;
        justify-content: flex-start !important;
        background: #79d0d2;
    }

    .dr-auth-mobile-banner {
        display: flex;
        flex: 0 0 33vh;
        min-height: 33vh;
        align-items: center;
        justify-content: center;
        padding: 1rem;
        background: #79d0d2;
        position: relative;
        overflow: hidden;
    }

    .dr-auth-mobile-banner::before,
    .dr-auth-mobile-banner::after {
        content: "";
        position: absolute;
        width: 140px;
        height: 140px;
        border: 2px solid rgba(255, 255, 255, 0.35);
        border-radius: 50%;
    }

    .dr-auth-mobile-banner::before {
        left: -70px;
        top: 35%;
    }

    .dr-auth-mobile-banner::after {
        right: -70px;
        top: 35%;
    }

    .dr-auth-form-container {
        flex: 0 0 67vh;
        min-height: 67vh;
        align-items: flex-start;
        background: #fff !important;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        overflow-y: auto;
    }

    .login-card {
        min-width: 100%;
        max-width: 100%;
        min-height: auto;
        background: #f3f4f6;
        border-radius: 0;
        margin: 0;
        padding: 0 0.75rem !important;
        border: none;
        box-shadow: none;
    }

    .login-card .logo-wrapper {
        display: none !important;
    }

    .login-card .otp-input {
        width: 48px !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 0 !important;
    }

    .otp-group {
        gap: 0.5rem !important;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .login-card {
        max-width: 450px;
        min-width: 300px;
    }

    .form-control {
        font-size: 0.9rem;
        padding: 0.55rem 1rem;
        height: 46px;
    }

    .otp-input {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .btn.custom-gradient,
    .btn-danger,
    .btn-outline-primary {
        font-size: 0.9rem;
        padding: 0.65rem 1.2rem;
    }
}

@media (max-width: 500px) {
    .login-card {
        min-width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 0 0.75rem !important;
    }

    .p-7 {
        padding: 1.25rem;
    }

    .form-control {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        height: 46px;
    }

    input::placeholder {
        font-size: 0.85rem;
    }

    .login-card .otp-input {
        width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        font-size: 1.2rem;
    }

    .btn.custom-gradient,
    .btn-danger,
    .btn-outline-primary {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .invalid-feedback,
    .error-message {
        font-size: 0.8rem;
    }

    .logo-wrapper {
        margin-bottom: 0.75rem;
    }

    .logo-wrapper img {
        width: 84px;
        height: auto;
    }

    .header-title {
        font-size: 1.25rem;
    }

    .text-custom-gray {
        font-size: 0.9rem;
    }

    .step-title {
        font-size: 0.82rem;
        padding: 0.35rem 0.75rem;
    }

    .back-link {
        font-size: 0.82rem;
        padding: 0.35rem 0.5rem;
    }
}

@media (max-width: 425px) {
    .login-card {
        min-width: 100%;
        max-width: 100%;
        padding: 0 0.75rem;
    }

    .login-card .otp-input {
        width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        font-size: 1.1rem;
    }

    .header-title {
        font-size: 1.15rem;
    }

    .form-control {
        font-size: 0.85rem;
    }

    .btn.custom-gradient,
    .btn-danger,
    .btn-outline-primary {
        font-size: 0.8rem;
        padding: 0.55rem 0.9rem;
    }

    .logo-wrapper img {
        width: 72px;
        height: auto;
    }
}

@media (max-width: 375px) {
    .login-card {
        padding: 0 0.75rem;
    }

    .login-card .otp-input {
        width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        font-size: 1rem;
    }

    .form-control {
        font-size: 0.8rem;
    }

    .btn.custom-gradient,
    .btn-danger,
    .btn-outline-primary {
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
    }

    .logo-wrapper img {
        width: 64px;
        height: auto;
    }
}

@media (max-width: 320px) {
    .login-card {
        min-width: 95vw;
        padding: 0 0.75rem;
    }

    .header-title {
        font-size: 1rem;
    }

    .form-control {
        font-size: 0.75rem;
    }

    .logo-wrapper img {
        width: 56px;
        height: auto;
    }
}

/* مودال - موبایل */
@media (max-width: 576px) {
    .modal-container {
        max-width: 94vw;
        padding: 0.5rem;
    }

    .modal-content {
        padding: 1.25rem;
    }

    .header-title {
        font-size: 1.25rem;
    }
}

/* تبلت */
@media (min-width: 768px) and (max-width: 1024px) {
    .login-card {
        max-width: 550px;
        padding: 0 0.75rem !important;
        border-radius: 0;
    }

    .form-control {
        font-size: 1rem;
        height: 48px;
    }

    .otp-input {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .btn.custom-gradient,
    .btn-danger,
    .btn-outline-primary {
        font-size: 1rem;
        padding: 0.8rem 1.8rem;
    }

    .logo-wrapper img {
        width: 110px;
        height: auto;
    }
}

/* لندسکیپ موبایل */
@media (max-height: 600px) and (orientation: landscape) {
    body {
        padding: 0;
    }

    .login-card {
        padding: 0 0.75rem;
        margin: 0.5rem 0;
    }

    .logo-wrapper {
        margin-bottom: 0.5rem;
    }

    .logo-wrapper img {
        width: 60px;
        height: auto;
    }

    .form-control {
        height: 44px;
        font-size: 0.85rem;
    }

    .login-card .otp-input {
        width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        font-size: 1rem;
    }
}
