@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; /* 12px - دکمه‌های کوچک */
    --radius-button-large: 1rem; /* 16px - دکمه‌های بزرگ */
    --radius-card: 1.25rem; /* 20px - کارت‌ها */
    --radius-footer: 2rem; /* 32px - فوتر */
    --radius-nav: 1.5rem; /* 24px - نوار ناوبری */
    --radius-circle: 9999px; /* دایره کامل */
}

/* 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: 1rem;
    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;
}

/* 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);
    animation: slideIn 0.5s ease-out;
}

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

/* @keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
} */

/* Form Control - بهبود برای موبایل */
.form-control {
    direction: ltr;
    text-align: left;
    font-family: "IRANSans", sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid var(--border-neutral);
    background: var(--background-card);
    padding: 0.6rem 1.2rem;
    height: 40px;
    border-radius: var(--radius-button);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(46, 134, 193, 0.25);
    outline: none;
    transform: scale(1.02);
}

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

/* Button Styles - بهبود برای موبایل */
button {
    border: none;
    transition: all 0.3s 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 12px rgba(46, 134, 193, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.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.2),
        transparent
    );
    transition: left 0.5s ease;
}

.btn.custom-gradient:hover::before {
    left: 100%;
}

.btn.custom-gradient:hover {
    background: linear-gradient(
        90deg,
        var(--primary-light) 0%,
        var(--primary) 100%
    );
    box-shadow: 0 6px 20px rgba(46, 134, 193, 0.35);
    transform: translateY(-2px);
}

.btn.custom-gradient:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(46, 134, 193, 0.2);
}

/* Custom Classes */
.custom-shadow {
    box-shadow: 0 8px 25px var(--shadow);
}

.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;
}

/* Login Card - بهبود برای موبایل */
.login-card {
    width: 100%;
    min-width: 320px;
    max-width: 480px;
    background: var(--background-card);
    border-radius: var(--radius-card);
    position: relative;
    overflow: hidden;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* @keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
} */

/* Logo Wrapper - بهبود برای موبایل */
.logo-wrapper {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
    padding: 0.5rem;
}

.logo-wrapper img {
    transition: transform 0.3s ease, filter 0.3s ease;
    max-width: 100%;
    height: auto;
}

.logo-wrapper img:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* OTP Inputs - بهبود برای موبایل */
.otp-input {
    width: 55px;
    height: 55px;
    font-size: 1.4rem;
    text-align: center;
    border: 2px solid var(--border-neutral);
    border-radius: var(--radius-button);
    background: var(--background-light);
    padding: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-primary);
}

.otp-input:focus {
    border-color: var(--primary);
    background: var(--background-card);
    box-shadow: 0 0 15px rgba(46, 134, 193, 0.3);
    transform: scale(1.05);
}

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

/* Back Link - بهبود برای موبایل */
.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: var(--radius-button);
}

.back-link:hover {
    color: var(--primary-light);
    transform: translateX(-4px);
    background: rgba(46, 134, 193, 0.1);
}

.back-link img {
    transition: transform 0.3s ease;
}

.back-link:hover img {
    transform: translateX(-2px);
}

/* Password Toggle - بهبود برای موبایل */
.password-toggle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 0.25rem;
    border-radius: 50%;
}

.password-toggle:hover {
    opacity: 0.85;
    transform: translateY(-50%) scale(1.15);
    background: rgba(0, 0, 0, 0.05);
}

/* Invalid Feedback - بهبود برای موبایل */
.invalid-feedback {
    color: var(--text-original);
    font-size: 0.85rem;
    margin-top: 0.4rem;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

/* @keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
} */

/* Loader Animation - بهبود */
.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);
    }
}

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

/* Modal Styles - بهبود */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    animation: fadeIn 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    animation: slideInUp 0.5s ease-out;
}

/* @keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
} */

.modal-content {
    border: none;
    border-radius: var(--radius-card);
    box-shadow: 0 15px 35px var(--shadow);
    animation: popIn 0.5s ease-out;
    background: var(--background-card);
}

/* @keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
} */

.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.3s ease;
    position: relative;
    overflow: hidden;
}

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

.btn-danger:hover::before {
    left: 100%;
}

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

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    border-radius: var(--radius-button);
    padding: 0.7rem 1.8rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-outline-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-outline-primary:hover::before {
    left: 0;
}

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

/* Progress Bar - بهبود */
#progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-neutral);
    border-radius: var(--radius-button);
    overflow: hidden;
    direction: ltr;
    margin: 1rem 0;
}

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

/* Responsive Design - بهبود کامل */
@media (max-width: 1024px) {
    .login-card {
        max-width: 500px;
        margin: 0 auto;
    }

    .p-7 {
        padding: 1.5rem;
    }

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

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

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

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

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

    .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) {
    body {
        padding: 0.5rem;
    }

    .login-card {
        min-width: 95vw;
        max-width: 95vw;
        margin: 0;
        border-radius: 1rem;
    }

    .p-7 {
        padding: 1.25rem;
    }

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

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

    .otp-input {
        width: 48px;
        height: 48px;
        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;
    }

    .modal-container {
        max-width: 95vw;
        padding: 0.5rem;
    }

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

    .logo-wrapper img {
        width: 80px;
    }

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

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

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

    .otp-input {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

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

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

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

    .logo-wrapper img {
        width: 70px;
    }
}

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

    .otp-input {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

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

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

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

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

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

    .otp-input {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

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

    .btn.custom-gradient,
    .btn-danger,
    .btn-outline-primary {
        font-size: 0.7rem;
        padding: 0.45rem 0.7rem;
    }

    .logo-wrapper img {
        width: 50px;
    }
}

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

/* Modal-Specific Styles - بهبود */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.modal-content {
    padding: 1.5rem;
}

.logo-hover {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo-hover:hover {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.btn-danger {
    background-color: var(--text-original);
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.3);
}

.btn-outline-primary.btn-hover {
    transition: all 0.3s ease;
}

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

/* Responsive Modal - بهبود */
@media (max-width: 576px) {
    .modal-container {
        max-width: 90%;
        padding: 0.5rem;
    }

    .modal-content {
        padding: 1.25rem;
    }

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

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

/* بهبود برای تبلت */
@media (min-width: 768px) and (max-width: 1024px) {
    .login-card {
        max-width: 550px;
        padding: 2rem;
    }

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

    .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: 120px;
    }
}

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

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

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

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

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

    .otp-input {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* بهبود انیمیشن‌ها */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.btn.custom-gradient:focus {
    animation: pulse 0.3s ease;
}

/* بهبود برای دکمه‌های غیرفعال */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}
