/* ═══════════════════════════════════════════════
   Login Netobin — Minimal RTL Login/Register
   ═══════════════════════════════════════════════ */

/* ── PeydaWeb Font ────────────────────────────── */
@font-face {
    font-family: 'PeydaWeb';
    src: url('../fonts/PeydaWeb-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ── CSS Variables ────────────────────────────── */
:root {
    --ln-accent:   #6366f1;
    --ln-form-bg:  #ffffff;
    --ln-text:     #1e1e2e;
    --ln-btn-bg:   #6366f1;
    --ln-btn-text: #ffffff;
    --ln-radius:   20px;
    --ln-padding:  40px;
    --ln-shadow:   0 30px 60px rgba(0,0,0,.12);
    --ln-g1:       #6366f1;
    --ln-g2:       #8b5cf6;
    --ln-border:   #e5e7eb;
    --ln-muted:    #9ca3af;
    --ln-error:    #ef4444;
    --ln-success:  #22c55e;
}

/* ── Outer Wrap ───────────────────────────────── */
/*
 * direction:ltr → grid flows left→right
 *   column 1 (45fr) = LEFT  → پنل
 *   column 2 (55fr) = RIGHT → فرم
 * محتوای هر ستون direction:rtl دارد
 */
.ln-wrap {
    display: grid;
    grid-template-columns: 45fr 55fr;
    height: 100dvh;
    overflow: hidden;
    direction: ltr;
    color: var(--ln-text);
    font-family: 'PeydaWeb', -apple-system, BlinkMacSystemFont,
                 'Segoe UI', Tahoma, system-ui, sans-serif;
}

/* ════════════════════════════════════
   LEFT PANEL
   ════════════════════════════════════ */
.ln-panel {
    direction: rtl;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 48px 44px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ln-g1), var(--ln-g2));
}

/* ── Decorative circles ── */
.ln-panel::before {
    content: '';
    position: absolute;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    top: -100px; right: -80px;
    pointer-events: none;
}
.ln-panel::after {
    content: '';
    position: absolute;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    bottom: -70px; left: -50px;
    pointer-events: none;
}

/* ── Static background image (full cover, z-index 0) ── */
.ln-panel-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ── Slider wrap (full cover, behind content) ── */
.ln-slider-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.ln-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.ln-slide.active { opacity: 1; }

/* ── Color overlay on image only (NOT slider) ── */
.ln-panel-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(160deg, rgba(0,0,0,.38), rgba(0,0,0,.54));
}
.ln-panel[data-type="image"] .ln-panel-overlay { display: block; }

/* ── Slider dots ── */
.ln-slider-dots {
    position: absolute;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 4;
}
.ln-dot {
    width: 8px; height: 8px;
    border-radius: 99px;
    background: rgba(255,255,255,.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: width .3s, background .3s;
}
.ln-dot.active { width: 24px; background: #fff; }

/* ── Panel content (above overlay) ── */
.ln-panel-content {
    position: relative;
    z-index: 2;
    text-align: right;
}

/* ── Logo in panel ── */
.ln-logo {
    position: relative;
    z-index: 2;
    margin-bottom: 28px;
    max-width: 140px;
}
.ln-logo a    { display: block; line-height: 0; }
.ln-logo-text {
    display: inline-block;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .02em;
}
.ln-logo img,
.ln-logo .custom-logo {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 140px !important;
    max-height: 46px !important;
}

.ln-panel-title {
    font-size: clamp(1.5rem, 2.6vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.35;
    font-family: inherit;
}
.ln-panel-desc {
    font-size: .95rem;
    color: rgba(255,255,255,.80);
    margin: 0;
    line-height: 1.75;
    max-width: 300px;
    font-family: inherit;
}

/* ════════════════════════════════════
   RIGHT PANEL — Form Wrap
   ════════════════════════════════════ */
.ln-form-wrap {
    direction: rtl;
    background: #f4f5f9;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* inner uses margin:auto to center */
    align-items: center;
    padding: 36px var(--ln-padding);
    box-shadow: var(--ln-shadow);
    overflow-x: hidden;
    overflow-y: auto;
}

/* ── Inner container — vertically centered with scroll fallback ── */
/*
 * margin-top/bottom: auto → consumes free space equally → vertical center.
 * When content > container, margins collapse to 0 and overflow-y:auto scrolls.
 */
.ln-form-inner {
    width: 100%;
    max-width: 400px;
    margin-top: auto;
    margin-bottom: auto;
}

/* ── Form Header: logo + site name ── */
.ln-form-header {
    text-align: center;
    margin-bottom: 24px;
}
.ln-form-logo-wrap { display: flex; justify-content: center; margin-bottom: 10px; }
.ln-form-logo-wrap a { display: inline-block; line-height: 0; }
.ln-form-logo-wrap img,
.ln-form-logo-wrap .custom-logo {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 120px !important;
    max-height: 44px !important;
}
.ln-form-logo-wrap--text span {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ln-text);
    font-family: inherit;
}
.ln-form-site-name {
    font-size: .8rem;
    color: var(--ln-muted);
    margin: 0;
    font-family: inherit;
}

/* ── Tabs ── */
.ln-tabs {
    display: flex;
    position: relative;
    background: #f3f4f6;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 22px;
    gap: 4px;
}
.ln-tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: .875rem;
    font-weight: 600;
    color: var(--ln-muted);
    border-radius: 9px;
    position: relative;
    z-index: 1;
    transition: color .25s;
    text-align: center;
}
.ln-tab.active { color: var(--ln-accent); }

.ln-tab-ink {
    position: absolute;
    top: 4px; bottom: 4px; right: 4px;
    width: calc(50% - 4px);
    background: #ffffff;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: transform .3s var(--ln-ease, ease-in-out);
    pointer-events: none;
}
.ln-tabs[data-active="register"] .ln-tab-ink {
    transform: translateX(-100%);
}

/* ── Form Container Slide (fallback / shortcode outside stack) ── */
.ln-form-container {
    display: none;
    opacity: 0;
    transform: translateX(16px);
    transition: opacity .28s var(--ln-ease, ease-in-out),
                transform .28s var(--ln-ease, ease-in-out);
}
.ln-form-container.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}
.ln-form-container.slide-out {
    display: block;
    opacity: 0;
    transform: translateX(-16px);
}

/* ── Forms Stack: grid overlay — no height jump on tab switch ── */
/*
 * Both form containers sit in the same grid cell (row 1 / col 1).
 * The grid height = tallest form, and never changes.
 * Visibility + opacity replace display:none so the DOM height is stable.
 */
.ln-forms-stack {
    display: grid;
}
.ln-forms-stack > .ln-form-container {
    grid-row: 1;
    grid-column: 1;
    display: block;                    /* always rendered — no reflow */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(16px);
    transition: opacity    .28s var(--ln-ease, ease-in-out),
                transform  .28s var(--ln-ease, ease-in-out),
                visibility   0s  linear .28s;  /* hide after fade-out */
}
.ln-forms-stack > .ln-form-container.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition: opacity    .28s var(--ln-ease, ease-in-out),
                transform  .28s var(--ln-ease, ease-in-out),
                visibility   0s;               /* show immediately */
}
.ln-forms-stack > .ln-form-container.slide-out {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-16px);
    transition: opacity    .28s var(--ln-ease, ease-in-out),
                transform  .28s var(--ln-ease, ease-in-out),
                visibility   0s  linear .28s;
}

/* ── Field ── */
.ln-field {
    position: relative;
    margin-bottom: 14px;
}

.ln-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 40px 12px 40px;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    background: #ffffff;
    color: var(--ln-text);
    font: inherit;
    font-size: .875rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
    text-align: right;
    direction: rtl;
}
.ln-input:focus {
    border-color: var(--ln-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ln-accent) 14%, transparent);
}
.ln-input.error {
    border-color: var(--ln-error);
    box-shadow: 0 0 0 3px rgba(239,68,68,.13);
}

/* Floating Label */
.ln-label {
    position: absolute;
    right: 40px;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .83rem;
    color: var(--ln-muted);
    pointer-events: none;
    transition: top .18s, font-size .18s, color .18s, right .18s, left .18s;
    background: #ffffff;
    padding: 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    font-family: inherit;
}
.ln-input:focus + .ln-label,
.ln-input:not(:placeholder-shown) + .ln-label {
    top: 0;
    font-size: .7rem;
    color: var(--ln-accent);
    right: 10px;
    left: auto;
}
.ln-input.error + .ln-label { color: var(--ln-error); }

/* Field Icon (right = start in RTL) */
.ln-field-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--ln-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}
.ln-field-icon svg { width: 100%; height: 100%; }

/* Eye button (left = end in RTL) */
.ln-eye {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; padding: 0;
    color: var(--ln-muted);
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: color .2s;
}
.ln-eye svg { width: 100%; height: 100%; }
.ln-eye:hover { color: var(--ln-accent); }

/* ── Checkbox Row ── */
.ln-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 6px;
    direction: rtl;
}
.ln-checkbox {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: .8rem;
    color: var(--ln-text);
    user-select: none;
    direction: rtl;
    font-family: inherit;
}
.ln-checkbox input[type="checkbox"] { display: none; }
.ln-checkmark {
    width: 16px; height: 16px;
    border: 1.5px solid var(--ln-border);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, background .2s;
}
.ln-checkbox input:checked + .ln-checkmark {
    background: var(--ln-accent);
    border-color: var(--ln-accent);
}
.ln-checkbox input:checked + .ln-checkmark::after {
    content: '';
    width: 5px; height: 9px;
    border: 2px solid #fff;
    border-top: none; border-left: none;
    transform: rotate(45deg) translate(-1px, -2px);
    display: block;
}
.ln-forgot {
    font-size: .75rem;
    color: var(--ln-accent);
    text-decoration: none;
    transition: opacity .2s;
    white-space: nowrap;
    font-family: inherit;
}
.ln-forgot:hover { opacity: .7; }

/* ── Strength Bar ── */
.ln-strength-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: -8px;
    margin-bottom: 12px;
    direction: rtl;
}
.ln-strength-bar {
    flex: 1; height: 3px;
    background: var(--ln-border);
    border-radius: 99px;
    overflow: hidden;
}
.ln-strength-fill {
    display: block; height: 100%; width: 0;
    border-radius: 99px;
    transition: width .3s, background .3s;
    background: var(--ln-error);
}
.ln-strength-label {
    font-size: .7rem;
    color: var(--ln-muted);
    min-width: 44px;
    text-align: right;
    font-family: inherit;
}

/* ── Notice ── */
.ln-notice {
    padding: 0;
    border-radius: 8px;
    font-size: .82rem;
    overflow: hidden;
    max-height: 0;
    transition: max-height .3s, padding .3s, margin .3s;
    margin-bottom: 0;
    direction: rtl;
    text-align: right;
    font-family: inherit;
}
.ln-notice.visible { padding: 10px 14px; max-height: 100px; margin-bottom: 14px; }
.ln-notice.error   { background: rgba(239,68,68,.1); color: var(--ln-error); }
.ln-notice.success { background: rgba(34,197,94,.1);  color: var(--ln-success); }

/* ── Button ── */
.ln-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ln-btn-bg),
                color-mix(in srgb, var(--ln-btn-bg) 78%, #fff));
    color: var(--ln-btn-text);
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform .15s, box-shadow .15s, opacity .2s;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--ln-btn-bg) 38%, transparent);
    direction: rtl;
}
.ln-btn:hover  { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--ln-btn-bg) 48%, transparent); }
.ln-btn:active { transform: translateY(0); }
.ln-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* Ripple */
.ln-btn .ripple {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,.32);
    transform: scale(0);
    animation: ln-ripple .52s linear;
    pointer-events: none;
}
@keyframes ln-ripple { to { transform: scale(4); opacity: 0; } }

/* Spinner */
.ln-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.32);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: ln-spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes ln-spin { to { transform: rotate(360deg); } }
.ln-btn.loading .ln-spinner { display: block; }
.ln-btn.loading .ln-btn-text { opacity: .7; }

/* ════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════ */

/* Laptop 769–1024 */
@media (max-width: 1024px) {
    .ln-wrap      { grid-template-columns: 40fr 60fr; }
    .ln-panel     { padding: 36px 28px; }
    .ln-form-wrap { padding: 28px 28px; }
}

/* Tablet 481–768 → پنل بالا، فرم پایین */
@media (max-width: 768px) {
    .ln-wrap {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }
    .ln-panel {
        direction: rtl;
        padding: 28px 24px;
        min-height: 160px;
        justify-content: flex-end;
        align-items: flex-start;
    }
    .ln-panel-title  { font-size: 1.3rem; }
    .ln-panel-desc   { font-size: .85rem; }
    .ln-form-wrap    { padding: 32px 20px; justify-content: flex-start; overflow-y: visible; }
    .ln-form-inner   { max-width: 100%; margin-top: 0; margin-bottom: 0; }
}

/* ── Forgot Password Panel ── */
.ln-forgot-panel {
    display: none;
}
.ln-forgot-panel.active {
    display: block;
    animation: ln-fadein .25s ease-out;
}
@keyframes ln-fadein {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}

.ln-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ln-muted);
    font: inherit;
    font-size: .82rem;
    padding: 0;
    margin-bottom: 22px;
    transition: color .2s;
    direction: rtl;
    font-family: inherit;
}
.ln-back-btn:hover { color: var(--ln-accent); }
.ln-back-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ln-forgot-header {
    margin-bottom: 20px;
    text-align: right;
    direction: rtl;
}
.ln-forgot-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ln-text);
    margin: 0 0 8px;
    font-family: inherit;
}
.ln-forgot-desc {
    font-size: .82rem;
    color: var(--ln-muted);
    margin: 0;
    line-height: 1.65;
    font-family: inherit;
}

.ln-reset-back-link {
    text-align: center;
    margin-top: 16px;
    font-family: inherit;
    direction: rtl;
}

/* ── Math CAPTCHA ── */
.ln-captcha { margin-bottom: 14px; direction: rtl; }
.ln-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    transition: border-color .2s, box-shadow .2s;
    direction: rtl;
}
.ln-captcha-row:focus-within {
    border-color: var(--ln-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ln-accent) 14%, transparent);
}
.ln-captcha.error .ln-captcha-row {
    border-color: var(--ln-error);
    box-shadow: 0 0 0 3px rgba(239,68,68,.13);
}
.ln-captcha-refresh {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ln-muted);
    padding: 2px;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 5px;
    transition: color .2s, background .2s;
    flex-shrink: 0;
}
.ln-captcha-refresh:hover { color: var(--ln-accent); background: color-mix(in srgb, var(--ln-accent) 8%, transparent); }
.ln-captcha-refresh svg { width: 13px; height: 13px; }
.ln-captcha-refresh.spinning svg { animation: ln-spin .5s linear 1; }
.ln-captcha-expr {
    font-weight: 700;
    font-size: .9rem;
    color: var(--ln-accent);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: .04em;
    font-family: inherit;
}
.ln-captcha-answer {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: .875rem;
    color: var(--ln-text);
    text-align: left;
    direction: ltr;
    min-width: 0;
    padding: 0;
    -moz-appearance: textfield;
}
.ln-captcha-answer::-webkit-outer-spin-button,
.ln-captcha-answer::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ln-captcha-answer::placeholder {
    color: var(--ln-muted);
    direction: rtl;
    text-align: right;
    font-size: .78rem;
}

/* Mobile ≤ 480 → پنل مخفی، فرم وسط صفحه */
@media (max-width: 480px) {
    .ln-panel { display: none; }
    .ln-wrap  { grid-template-rows: 1fr; height: 100dvh; overflow: hidden; }
    .ln-form-wrap {
        padding: 40px 20px;
        justify-content: flex-start;
        align-items: center;
        overflow-y: auto;
    }
    .ln-form-inner {
        width: 100%;
        max-width: 360px;
        margin-top: 0;
        margin-bottom: 0;
    }
    .ln-input { padding: 11px 38px; font-size: .85rem; }
    .ln-btn   { padding: 11px 18px; font-size: .875rem; }
}

/* ════════════════════════════════════
   LARGE SCREEN SCALING
   بزرگ‌تر شدن فرم برای مانیتورهای بزرگ
   ════════════════════════════════════ */

/* 1401 – 1600 */
@media (min-width: 1401px) {
    .ln-form-inner { max-width: 460px; }
    .ln-tab        { font-size: .9rem; }
}

/* 1601 – 1920 */
@media (min-width: 1601px) {
    .ln-form-inner { max-width: 520px; }
    .ln-input      { font-size: .93rem; }
    .ln-btn        { font-size: .94rem; padding: 13px 20px; }
    .ln-tab        { font-size: .92rem; padding: 10px 14px; }
    .ln-form-logo-wrap--text span { font-size: 1.25rem; }
    .ln-form-site-name            { font-size: .82rem; }
    .ln-field      { margin-bottom: 16px; }
    .ln-tabs       { margin-bottom: 24px; }
    .ln-panel-desc { font-size: 1rem; max-width: 340px; }
}

/* 1921px+ */
@media (min-width: 1921px) {
    .ln-form-inner { max-width: 600px; }
    .ln-input      { font-size: .96rem; }
    .ln-label      { font-size: .86rem; }
    .ln-btn        { font-size: .97rem; padding: 14px 20px; }
    .ln-field      { margin-bottom: 18px; }
    .ln-form-header { margin-bottom: 28px; }
    .ln-form-logo-wrap--text span { font-size: 1.35rem; }
    .ln-form-site-name            { font-size: .85rem; }
    .ln-panel      { padding: 60px 52px; }
    .ln-panel-desc { font-size: 1.05rem; max-width: 380px; }
}
