/* ================================================================
   فونت IRANSansX
   ================================================================ */
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/IRANSansX-Regular.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 500;
    src: url('/fonts/IRANSansX-Medium.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 700;
    src: url('/fonts/IRANSansX-Bold.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 300;
    src: url('/fonts/IRANSansX-Light.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 200;
    src: url('/fonts/IRANSansX-UltraLight.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 600;
    src: url('/fonts/IRANSansX-DemiBold.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 800;
    src: url('/fonts/IRANSansX-ExtraBold.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'IRANSansX';
    font-style: normal;
    font-weight: 900;
    src: url('/fonts/IRANSansX-Black.ttf') format('truetype');
    font-display: swap;
}

/* ================================================================
   متغیرهای مشترک (پیش‌فرض: مشتری - قرمز)
   ================================================================ */
:root {
    --primary: #ef5a6f;
    --primary-light: #fff0f3;
    --primary-dark: #d94a5d;
    --primary-glow: rgba(239, 90, 111, 0.15);
    --bg: #f8f9fb;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #e8ecf1;
    --border-focus: #ef5a6f;
    --success: #27ae60;
    --error: #e74c3c;
}

/* ================================================================
   تم فروشنده (سبز) - با کلاس page-vendor
   ================================================================ */
.page-vendor {
    --primary: #016f59;
    --primary-light: #d8eee1;
    --primary-dark: #015a48;
    --primary-glow: rgba(1, 111, 89, 0.15);
    --bg: #f5faf7;
    --border: #d4e8dc;
    --border-focus: #016f59;
    --text: #1a2e27;
    --text-light: #5a7d6e;
}

/* ================================================================
   ریست و پایه
   ================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'IRANSansX', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
   پس‌زمینه مخصوص فروشنده
   ================================================================ */
.page-vendor body {
    background: linear-gradient(160deg, #f5faf7 0%, #d8eee1 50%, #f5faf7 100%);
}

/* ================================================================
   کانتینر اصلی
   ================================================================ */
.login-wrapper {
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease;
    position: relative;
    z-index: 1;
}

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

/* ================================================================
   کارت ورود
   ================================================================ */
.login-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 36px 32px 32px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.page-vendor .login-card {
    box-shadow: 0 4px 24px rgba(1, 111, 89, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(1, 111, 89, 0.06);
}

/* ================================================================
   هدر
   ================================================================ */
.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-icon-wrapper {
    width: 60px;
    height: 60px;
    background: var(--primary-light);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.page-vendor .login-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #c8e8d5 100%);
    border-radius: 20px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.login-icon-wrapper svg {
    width: 28px;
    height: 28px;
    fill: var(--primary);
}

.page-vendor .login-icon-wrapper svg {
    width: 30px;
    height: 30px;
}

/* ================================================================
   نشان (Badge) مخصوص فروشنده
   ================================================================ */
.login-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

/* ================================================================
   عنوان‌ها
   ================================================================ */
.login-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 400;
}

/* ================================================================
   استپ‌ها
   ================================================================ */
.step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step.active {
    display: block;
}

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

/* ================================================================
   پیام‌ها
   ================================================================ */
.message-box {
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.message-box.success {
    background: #eafaf1;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
    display: block;
}

.page-vendor .message-box.success {
    background: #e6f5ee;
    color: #0d6b4a;
    border: 1px solid #b8dfc8;
}

.message-box.error {
    background: #fdf2f2;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    display: block;
}

.page-vendor .message-box.error {
    background: #fdf2f2;
    color: #b33030;
}

.message-box.info {
    background: #eaf2fd;
    color: #2471a3;
    border: 1px solid #bee5eb;
    display: block;
}

.page-vendor .message-box.info {
    background: #e8f5f1;
    color: #1a5c46;
    border: 1px solid #bee5d5;
}

/* ================================================================
   فرم
   ================================================================ */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    font-family: 'IRANSansX', sans-serif;
    color: var(--text);
    background: #fafbfc;
    transition: all 0.2s ease;
    direction: ltr;
    text-align: left;
    outline: none;
}

.page-vendor .form-input {
    height: 52px;
    border-radius: 14px;
    background: #fafdfb;
}

.form-input:focus {
    border-color: var(--border-focus);
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-input::placeholder {
    color: #b0b8c1;
    font-size: 13px;
}

.page-vendor .form-input::placeholder {
    color: #a8c4b6;
}

/* ================================================================
   دکمه‌ها
   ================================================================ */
.btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'IRANSansX', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.page-vendor .btn {
    height: 52px;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 90, 111, 0.3);
}

.page-vendor .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #018a6e 100%);
    box-shadow: 0 4px 16px rgba(1, 111, 89, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.page-vendor .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #017058 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(1, 111, 89, 0.35);
}

.page-vendor .btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #f5b7c2;
    cursor: not-allowed;
    box-shadow: none;
}

.page-vendor .btn-primary:disabled {
    background: #8cc4b3;
    opacity: 0.7;
    transform: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--border);
    height: 44px;
    font-size: 13px;
}

.btn-sm {
    height: 42px;
    font-size: 13px;
}

/* ================================================================
   کد OTP
   ================================================================ */
.otp-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    direction: ltr;
    margin: 6px 0 18px;
}

.page-vendor .otp-container {
    margin: 8px 0 20px;
}

.otp-box {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: #fff;
    transition: all 0.2s ease;
    font-family: 'IRANSansX', monospace;
    outline: none;
}

.page-vendor .otp-box {
    height: 58px;
}

.otp-box:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.page-vendor .otp-box:focus {
    transform: scale(1.03);
}

.otp-box.filled {
    border-color: var(--border-focus);
    background: #fff8f9;
}

.page-vendor .otp-box.filled {
    background: #f5fcf8;
}

.otp-box.success {
    border-color: var(--success) !important;
    background: #eafaf1 !important;
}

.page-vendor .otp-box.success {
    background: #e6f5ee !important;
}

.otp-box.error {
    border-color: var(--error) !important;
    background: #fdf2f2 !important;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-6px);
    }
    40% {
        transform: translateX(6px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(4px);
    }
}

/* ================================================================
   لینک‌ها
   ================================================================ */
.links-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.link {
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'IRANSansX', sans-serif;
    transition: color 0.2s;
}

.page-vendor .link {
    text-decoration: none;
}

.link:hover {
    color: var(--primary);
}

.link.primary {
    color: var(--primary);
    font-weight: 500;
}

.page-vendor .link.primary:hover {
    color: var(--primary-dark);
}

/* ================================================================
   بازگشت به فروشگاه
   ================================================================ */
.back-to-store {
    text-align: center;
    margin-top: 20px;
}

.back-to-store a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-to-store a:hover {
    color: var(--primary);
}

.back-to-store svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ================================================================
   فوتر (فقط صفحه مشتری)
   ================================================================ */
.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-light);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* ================================================================
   مودال تکمیل اطلاعات (فقط صفحه مشتری)
   ================================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 32px 24px 24px;
    animation: modalIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-icon-wrapper {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.modal-icon-wrapper svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* ================================================================
   اسپینر
   ================================================================ */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

.page-vendor .spinner {
    width: 20px;
    height: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================================================
   ورودی‌های عددی
   ================================================================ */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ================================================================
   ریسپانسیو
   ================================================================ */
@media (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
        padding-top: 32px;
    }

    .page-vendor body {
        padding-top: 40px;
    }

    .login-card {
        padding: 28px 20px 24px;
        border-radius: 20px;
    }

    .login-title {
        font-size: 18px;
    }

    .login-icon-wrapper {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

    .page-vendor .login-icon-wrapper {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

    .page-vendor .login-icon-wrapper svg {
        width: 26px;
        height: 26px;
    }

    .otp-box {
        width: 42px;
        height: 48px;
        font-size: 18px;
        border-radius: 12px;
    }

    .page-vendor .otp-box {
        height: 50px;
    }

    .otp-container {
        gap: 8px;
    }

    .btn {
        height: 48px;
        font-size: 14px;
    }

    .page-vendor .btn {
        height: 48px;
        font-size: 14px;
    }

    .form-input {
        height: 48px;
        font-size: 14px;
    }

    .page-vendor .form-input {
        height: 48px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .otp-box {
        width: 38px;
        height: 44px;
        font-size: 16px;
        border-radius: 10px;
    }

    .page-vendor .otp-box {
        width: 38px;
        height: 44px;
        font-size: 16px;
        border-radius: 10px;
    }

    .otp-container {
        gap: 6px;
    }
}