/* Beharan ERP login — scoped to this page. Existing installed Persian fonts have priority. */
@font-face {
    font-family: 'BeharanLoginFallback';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/vazirmatn-arabic-wght-normal.woff2') format('woff2');
}

body.beharan-erp-login {
    --beharan-blue: #0c628d;
    --beharan-ink: #153246;
    --beharan-muted: #667887;
    --beharan-border: #d7dfe5;
    --beharan-paper: #f7f7f4;
    margin: 0;
    padding: 0;
    min-width: 280px;
    min-height: 100vh;
    color: var(--beharan-ink);
    background: var(--beharan-paper) !important;
    font-family: 'IRANSans', 'Vazir', 'BeharanLoginFallback', Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    direction: rtl;
    color-scheme: light;
    -webkit-text-size-adjust: 100%;
}
body.beharan-erp-login::before,
body.beharan-erp-login::after { display: none !important; }
.beharan-erp-login *,
.beharan-erp-login *::before,
.beharan-erp-login *::after { box-sizing: border-box; }
.beharan-erp-login [hidden] { display: none !important; }
.beharan-erp-login button,
.beharan-erp-login input { font-family: inherit; }
.beharan-erp-login a { text-decoration: none; }
.beharan-erp-login svg { stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.beharan-login-page {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px clamp(20px, 3.2vw, 60px) 22px;
    font-size: 15px;
}
.beharan-login-frame {
    width: 100%;
    max-width: 1440px;
    display: grid;
    grid-template-columns: minmax(360px, 0.82fr) minmax(0, 1.18fr);
    overflow: hidden;
    border: 1px solid #dce3e7;
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 9px 35px rgba(33, 58, 70, 0.035);
}
.beharan-access {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 28px clamp(26px, 3.1vw, 48px);
    background: #fff;
    position: relative;
    z-index: 1;
}
.beharan-access-inner { width: 100%; max-width: 430px; }
.beharan-brand { text-align: center; padding-bottom: 20px; border-bottom: 1px solid #e1e7eb; }
.beharan-brand-logo { min-height: 80px; display: flex; justify-content: center; align-items: center; }
.beharan-brand-logo .company-logo,
.beharan-brand-logo a { display: block; margin: 0; padding: 0; max-width: 100%; }
.beharan-brand-logo img { display: block; width: auto; height: auto; max-width: 190px; max-height: 92px; margin: 0 auto; object-fit: contain; }
.beharan-brand-caption { font-size: 14px; font-weight: 500; color: var(--beharan-muted); margin: 8px 0 0; line-height: 1.6; }
.beharan-mobile-name { display: none; }
.beharan-form-heading { margin: 20px 0; text-align: center; }
.beharan-form-heading h1 { margin: 0; color: var(--beharan-ink); font-size: 27px; line-height: 1.4; font-weight: 800; }
.beharan-welcome { margin: 4px 0 0; color: var(--beharan-blue); font-size: 17px; line-height: 1.5; font-weight: 600; }
.beharan-form-intro { margin: 4px 0 0; font-size: 13px; color: var(--beharan-muted); line-height: 1.8; }
.beharan-access form { margin: 0; }
.beharan-erp-login .beharan-field { margin: 0 0 18px; }
.beharan-field > label { display: block; margin: 0 0 7px; color: var(--beharan-ink); font-size: 14px; font-weight: 600; line-height: 1.5; text-align: right; }
.beharan-input-wrap { position: relative; }
.beharan-erp-login .beharan-input {
    display: block;
    width: 100%;
    height: 52px;
    padding: 10px 46px 10px 14px;
    margin: 0;
    border: 1px solid var(--beharan-border);
    border-radius: 9px;
    background: #fff;
    color: var(--beharan-ink);
    box-shadow: 0 1px 2px rgba(25, 48, 66, 0.02);
    font-size: 16px;
    line-height: 1.5;
    text-align: right;
    transition: border-color 150ms, box-shadow 150ms;
}
.beharan-erp-login .beharan-input:focus { border-color: var(--beharan-blue); outline: 0; box-shadow: 0 0 0 3px rgba(12, 98, 141, 0.12); }
.beharan-field-icon { position: absolute; top: 15px; right: 14px; color: #738493; pointer-events: none; }
.beharan-password-toggle {
    position: absolute;
    right: 4px;
    top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #738493;
    cursor: pointer;
}
.beharan-password-toggle:hover { color: var(--beharan-blue); background: #f0f6f9; }
.beharan-eye-slash { display: none; }
.beharan-password-toggle[aria-pressed="true"] .beharan-eye-slash { display: block; }
.beharan-form-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 23px; font-size: 12px; }
.beharan-remember { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: var(--beharan-muted); cursor: pointer; margin: 0; min-height: 30px; }
.beharan-erp-login .beharan-remember input { position: static; float: none; flex: 0 0 17px; width: 17px; height: 17px; margin: 0; opacity: 1; accent-color: var(--beharan-blue); cursor: pointer; }
.beharan-forgot { color: var(--beharan-blue); font-size: 12px; font-weight: 600; padding: 4px 0; }
.beharan-forgot:hover { color: #07466a; text-decoration: underline; text-underline-offset: 3px; }
.beharan-erp-login .beharan-submit,
.beharan-erp-login .beharan-submit:active,
.beharan-erp-login .beharan-submit:focus {
    display: block;
    width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 10px 20px;
    background: var(--beharan-blue);
    border: 1px solid var(--beharan-blue);
    border-radius: 9px;
    box-shadow: 0 6px 14px rgba(12, 98, 141, 0.12);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.7;
    cursor: pointer;
    text-align: center;
    white-space: normal;
    transition: background 150ms;
}
.beharan-erp-login .beharan-submit:hover { background: #084e74; border-color: #084e74; color: #fff; }
.beharan-erp-login :is(a, button, input):focus-visible { outline: 3px solid #83b4ce; outline-offset: 3px; }
.beharan-erp-login .beharan-input:focus-visible { outline: 0; }
.beharan-alerts > .row { margin: 0; }
.beharan-alerts #alerts { float: none; width: 100%; padding: 0; }
.beharan-access .alert { padding: 11px 14px; margin: 0 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; text-align: right; }
.beharan-access .alert-danger { color: #a52d32; background: #fff1f1; border-color: #f3d5d7; }
.beharan-access .alert-success { color: #2e6654; background: #eef8f2; border-color: #d0e7dc; }
.beharan-access .alert-warning { color: #856523; background: #fff9e9; border-color: #efe2bd; }
.beharan-access .alert-info { color: #245a75; background: #eef6fa; border-color: #cfe1eb; }
.beharan-captcha { margin: 0 0 18px; min-height: 78px; }
.beharan-erp-login .beharan-captcha .g-recaptcha { display: block; width: 304px; height: 78px; margin: 0 auto; transform: none; transform-origin: right top; }
.beharan-story { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; background: #edf4f7; }
.beharan-story-copy { position: relative; z-index: 1; padding: 35px clamp(28px, 3.4vw, 52px) 18px; }
.beharan-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0; color: #4b6271; font-size: 14px; line-height: 1.5; }
.beharan-eyebrow > span { width: 32px; height: 2px; background: var(--beharan-blue); margin-left: 3px; }
.beharan-story h2 { margin: 15px 0 11px; color: #064b70; font-size: clamp(30px, 3vw, 45px); font-weight: 850; line-height: 1.65; letter-spacing: -0.7px; }
.beharan-story-intro { margin: 0; font-size: clamp(14px, 1.45vw, 19px); line-height: 1.8; color: #4f6471; }
.beharan-features { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 25px 0 0; max-width: 450px; }
.beharan-features li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 0 12px; margin: 0; color: #145b80; font-size: 14px; line-height: 1.5; }
.beharan-features li + li::before { content: ''; position: absolute; right: 0; top: 8px; width: 1px; height: 25px; background: #c5d5dd; }
.beharan-features span { color: #334e60; white-space: nowrap; }
.beharan-art { position: relative; width: 100%; aspect-ratio: 1.75; overflow: hidden; margin-top: auto; }
.beharan-art::before { content: ''; position: absolute; top: 0; right: 0; left: 0; height: 18px; z-index: 1; pointer-events: none; background: linear-gradient(to bottom, #edf4f7, rgba(237, 244, 247, 0)); }
.beharan-art picture { display: block; width: 100%; height: 100%; }
.beharan-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.beharan-footer { font-size: 11px; color: #788792; margin-top: 14px; text-align: center; line-height: 1.7; }

@media (min-width: 900px) and (max-height: 820px) {
    .beharan-login-page { padding-top: 20px; padding-bottom: 16px; }
    .beharan-access { padding-top: 24px; padding-bottom: 24px; }
    .beharan-brand { padding-bottom: 14px; }
    .beharan-brand-logo { min-height: 66px; }
    .beharan-brand-logo img { max-height: 74px; }
    .beharan-form-heading { margin: 16px 0 18px; }
    .beharan-form-heading h1 { font-size: 24px; }
    .beharan-erp-login .beharan-field { margin-bottom: 16px; }
    .beharan-form-options { margin-bottom: 18px; }
    .beharan-story-copy { padding-top: 24px; padding-bottom: 12px; }
    .beharan-story h2 { font-size: clamp(28px, 2.65vw, 38px); line-height: 1.6; margin: 12px 0 8px; }
    .beharan-story-intro { font-size: 16px; }
    .beharan-features { margin-top: 18px; }
    .beharan-features li { gap: 6px; font-size: 13px; }
    .beharan-features svg { width: 26px; height: 26px; }
}
@media (min-width: 900px) and (max-width: 1100px) {
    .beharan-login-frame { grid-template-columns: minmax(348px, .9fr) minmax(0, 1.1fr); }
    .beharan-access { padding-right: 24px; padding-left: 24px; }
    .beharan-story-copy { padding-right: 25px; padding-left: 25px; }
    .beharan-story h2 { font-size: 29px; }
    .beharan-features li { padding: 0 6px; font-size: 12px; }
}
@media (max-width: 899px) {
    .beharan-login-page { padding: 20px 16px 18px; }
    .beharan-login-frame { display: block; max-width: 480px; border-radius: 22px; }
    .beharan-access { padding: 28px 28px 32px; }
    .beharan-story { display: none; }
    .beharan-mobile-name { display: block; margin-top: 4px; font-size: 12px; color: var(--beharan-blue); }
    .beharan-brand-logo img { max-height: 88px; }
    .beharan-form-heading h1 { font-size: 25px; }
    .beharan-form-options { font-size: 12px; }
}
@media (max-width: 379px) {
    .beharan-login-page { padding: 12px 10px; }
    .beharan-access { padding: 22px 18px 26px; }
    .beharan-brand-caption { font-size: 13px; }
    .beharan-form-intro { font-size: 12px; }
    .beharan-form-options { gap: 8px; font-size: 11px; }
    .beharan-remember { gap: 5px; }
    .beharan-forgot { font-size: 11px; }
    .beharan-captcha { min-height: 66px; height: 66px; }
    .beharan-erp-login .beharan-captcha .g-recaptcha { transform: scale(.84); margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .beharan-erp-login *, .beharan-erp-login *::before, .beharan-erp-login *::after { transition: none !important; animation: none !important; }
}
