:root {
    --sidebar-bg: #0f172a;
    --primary: #0ea5e9;
    --primary-soft: #e0f2fe;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #6b7280;
    --border-soft: #e5e7eb;
    --danger: #f97373;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* غیرفعال کردن اسکرول در کل صفحه */
    font-family: "Vazirmatn", sans-serif;
}

body {
    background: radial-gradient(
        circle at top,
        #ffffff 0,
        #f3f4f6 55%,
        #e5edf9 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* کارت اصلی */
.login-card {
    height: 72vh;
    max-height: 800px;
    background: var(--card-bg);
    border-radius: 32px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15);
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
}

/* سمت فرم */
.login-left {
    padding: 20px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%; /* پر کردن ارتفاع کامل */
    overflow: visible; /* تغییر از auto به visible */
}

/* سمت لوگو - دسکتاپ */
.login-right {
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* استایل عکس */
.side-logo {
    width: 260px;
    max-width: 70%;
    display: block;
}

.logo-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
}

.logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========== تایپوگرافی ========== */
.login-title {
    font-size: 18px;
    color: var(--sidebar-bg);
    margin: 0 0 1rem 0;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    text-align: center;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 32px 0;
}

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

.form-group:last-of-type {
    margin-bottom: 0;
}

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

.input {
    width: 100%;
    height: 46px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 0 18px;
    font-size: 14px;
    color: var(--text-main);
    background: #ffffff;
    outline: none;
    transition: border 0.15s ease,
    box-shadow 0.15s ease;
}

.input::placeholder {
    color: #9ca3af;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-soft);
    background: #f9fafb;
}

.error {
    border-color: var(--danger);
}

.error-message {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

/* ========== دکمه ========== */
.btn-primary {
    margin-top: 18px;
    width: 100%;
    height: 50px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.35);
    transition: transform 0.08s ease,
    box-shadow 0.12s ease,
    filter 0.12s ease;
    font-family: "Vazirmatn", sans-serif;
}

.btn-primary:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
    box-shadow: 0 22px 50px rgba(37, 99, 235, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.35);
}

.helper-text {
    margin-top: 20px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

.forgot-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* ========== دسکتاپ کوچک ========== */
@media (max-width: 1200px) {
    .side-logo {
        width: 220px;
    }

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

/* ========== تبلت و موبایل - بدون اسکرول ========== */
@media (max-width: 900px) {
    html,
    body {
        overflow: hidden;
        height: 100%;
        width: 100%;
        position: fixed;
    }

    body {
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-card {
        width: 85% !important;
        max-width: 450px;
        height: auto;
        max-height: 95vh; /* محدود کردن ارتفاع */
        min-height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        border-radius: 32px;
        margin: 0 auto;
    }

    .login-right {
        display: flex !important;
        order: -1;
        background: transparent !important;
        padding: 25px 20px 10px 20px;
        min-height: auto;
        border-radius: 32px 32px 0 0;
    }

    .side-logo {
        width: 120px;
        max-width: 35%;
    }

    .login-left {
        padding: 15px 20px 25px 20px;
        border-radius: 0 0 32px 32px;
        height: auto;
        justify-content: flex-start;
    }

    .login-title {
        font-size: 16px !important;
        text-align: center !important;
        margin: 0 0 15px 0 !important;
        padding: 0;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .input {
        height: 42px;
        font-size: 13px;
        padding: 0 16px;
    }

    .btn-primary {
        height: 44px;
        font-size: 14px;
        margin-top: 15px;
    }

    .helper-text {
        margin-top: 15px;
        font-size: 11px;
    }

    .mt-6 {
        margin-top: 12px !important;
    }
}

/* ========== موبایل‌های کوچک ========== */
@media (max-width: 480px) {
    .login-card {
        width: 92% !important;
        border-radius: 28px;
    }

    .login-right {
        padding: 20px 15px 8px 15px;
    }

    .side-logo {
        width: 100px;
    }

    .login-left {
        padding: 12px 16px 20px 16px;
    }

    .login-title {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .input {
        height: 40px;
        font-size: 12px;
        padding: 0 14px;
    }

    .btn-primary {
        height: 42px;
        font-size: 13px;
        margin-top: 12px;
    }
}

@media (max-width: 380px) {
    .login-right {
        padding: 18px 15px 5px 15px;
    }

    .side-logo {
        width: 90px;
    }

    .login-left {
        padding: 10px 14px 18px 14px;
    }

    .login-title {
        font-size: 15px !important;
        margin-bottom: 10px !important;
    }

    .input {
        height: 38px;
        padding: 0 12px;
    }

    .btn-primary {
        height: 40px;
    }
}

@media (max-width: 320px) {
    .side-logo {
        width: 80px;
    }

    .login-title {
        font-size: 14px !important;
    }

    .input {
        height: 36px;
        font-size: 11px;
    }

    .btn-primary {
        height: 38px;
        font-size: 12px;
    }
}

/* ========== صفحه‌های کوتاه ========== */
@media (max-height: 700px) and (max-width: 900px) {
    .login-card {
        max-height: 98vh;
    }

    .login-right {
        padding: 15px 20px 5px 20px;
    }

    .side-logo {
        width: 90px;
    }

    .login-left {
        padding: 8px 20px 15px 20px;
    }

    .login-title {
        font-size: 16px !important;
        margin-bottom: 8px !important;
    }

    .form-group {
        margin-bottom: 8px;
    }

    .input {
        height: 36px;
    }

    .btn-primary {
        height: 38px;
        margin-top: 10px;
    }

    .helper-text {
        margin-top: 10px;
    }
}

@media (max-height: 600px) and (max-width: 900px) {
    .login-right {
        padding: 10px 20px 5px 20px;
    }

    .side-logo {
        width: 70px;
    }

    .login-left {
        padding: 5px 20px 10px 20px;
    }

    .login-title {
        font-size: 15px !important;
        margin-bottom: 5px !important;
    }

    .form-label {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .input {
        height: 32px;
        font-size: 11px;
    }

    .btn-primary {
        height: 36px;
        font-size: 12px;
        margin-top: 8px;
    }

    .helper-text {
        margin-top: 8px;
        font-size: 10px;
    }
}

/* غیرفعال کردن کامل اسکرول */
@media (max-width: 900px) {
    .login-left,
    .login-right,
    .login-card,
    form {
        overflow: visible;
    }
}
