/* ─── Login page (matches landing aesthetic) ─── */

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

body.login-body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    background: var(--blue-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

.login-page {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 70% 55% at 18% 12%, rgba(26, 79, 140, 0.38) 0%, transparent 58%),
        radial-gradient(ellipse 55% 45% at 88% 78%, rgba(13, 122, 111, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 40% 35% at 72% 18%, rgba(201, 166, 107, 0.1) 0%, transparent 60%),
        linear-gradient(165deg, #07131f 0%, #0a1a2c 42%, #061018 100%);
}

.login-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(90, 159, 212, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90, 159, 212, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 75% 70% at 50% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 40%, #000 20%, transparent 75%);
    opacity: 0.9;
    pointer-events: none;
}

.login-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 120%, rgba(26, 79, 140, 0.28) 0%, transparent 45%),
        radial-gradient(circle at 1px 1px, rgba(201, 166, 107, 0.07) 1px, transparent 0);
    background-size: auto, 28px 28px;
    pointer-events: none;
}

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 85% 70% at 50% 38%, transparent 0%, rgba(5, 14, 22, 0.45) 70%, rgba(5, 14, 22, 0.82) 100%),
        linear-gradient(180deg, rgba(5, 14, 22, 0.2) 0%, transparent 35%, rgba(5, 14, 22, 0.55) 100%);
}

.login-page .net-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
}

.login-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 3;
}

.login-orb-1 {
    width: 340px;
    height: 340px;
    background: rgba(37, 99, 235, 0.14);
    top: 8%;
    left: -6%;
}

.login-orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(201, 162, 39, 0.1);
    bottom: 4%;
    right: -5%;
}

.login-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 2rem;
    height: var(--nav-height);
    background: rgba(4, 15, 31, 0.22);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-back {
    padding: 10px 20px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #fff;
    border: 0.5px solid var(--btn-o-border);
    white-space: nowrap;
}

.login-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.login-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.25rem;
    position: relative;
    z-index: 5;
}

.login-card {
    width: min(440px, 100%);
    background: rgba(7, 24, 41, 0.72);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 0.5px solid var(--card-border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-card-head {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-ring {
    width: 68px;
    height: 68px;
    margin: 0 auto 1.1rem;
    border-radius: 16px;
    background: rgba(37, 99, 235, 0.14);
    border: 0.5px solid rgba(96, 165, 250, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 28px rgba(37, 99, 235, 0.15);
}

.login-logo-ring img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.login-card h1 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 800;
    color: #fff;
    margin: 0.75rem 0 0.5rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.login-sub {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.85;
    margin: 0;
}

.login-error {
    background: rgba(220, 38, 38, 0.12);
    border: 0.5px solid rgba(220, 38, 38, 0.35);
    color: #fca5a5;
    font-size: 13px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.6;
}

.login-field {
    margin-bottom: 1.2rem;
}

.login-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.login-field-head label {
    margin-bottom: 0;
}

.login-forgot {
    font-family: inherit;
    font-size: 12px;
    color: var(--green-light);
    text-decoration: none;
    white-space: nowrap;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.login-forgot:hover {
    text-decoration: underline;
    color: #fff;
}

/* ─── Forgot-password support modal ─── */

.login-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.login-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.login-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 15, 31, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.login-modal-panel {
    position: relative;
    width: min(380px, 100%);
    padding: 2rem 1.5rem 1.5rem;
    border-radius: var(--radius);
    border: 0.5px solid var(--card-border);
    background: linear-gradient(160deg, rgba(7, 24, 41, 0.98) 0%, rgba(4, 15, 31, 0.98) 100%);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    text-align: center;
    transform: translateY(14px) scale(0.98);
    transition: transform 0.28s ease;
}

.login-modal.open .login-modal-panel {
    transform: translateY(0) scale(1);
}

.login-modal-close {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.login-modal-close:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

.login-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.14);
    border: 0.5px solid rgba(96, 165, 250, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-light);
    font-size: 1.35rem;
}

.login-modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.55rem;
}

.login-modal-text {
    margin: 0 0 1.25rem;
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-muted);
}

.login-modal-contacts {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
}

.login-modal-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    border: 0.5px solid rgba(96, 165, 250, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
}

.login-modal-contact i {
    color: var(--green-light);
    font-size: 13px;
}

.login-modal-contact:hover {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(96, 165, 250, 0.45);
    color: #fff;
}

.login-modal-ok {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.login-modal-ok:hover {
    background: var(--green-light);
    transform: translateY(-1px);
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(240, 244, 248, 0.85);
    margin-bottom: 0.45rem;
}

.login-status {
    background: rgba(16, 185, 129, 0.12);
    border: 0.5px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
    font-size: 13px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.6;
}

.login-help {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-muted);
}

.login-help a {
    color: var(--green-light);
    text-decoration: none;
}

.login-help a:hover {
    text-decoration: underline;
    color: #fff;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i.field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--green-light);
    font-size: 14px;
    opacity: 0.75;
    pointer-events: none;
}

.login-input-wrap input {
    width: 100%;
    padding: 0.78rem 2.75rem 0.78rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 0.5px solid rgba(96, 165, 250, 0.2);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.login-input-wrap input::placeholder {
    color: rgba(240, 244, 248, 0.28);
}

.login-input-wrap input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.25rem 0 1.5rem;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.login-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--green);
    cursor: pointer;
}

.login-submit {
    width: 100%;
    padding: 14px 30px;
    border: none;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.28);
}

.login-submit:hover {
    background: var(--green-light);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

.login-submit:active {
    transform: translateY(0);
}

.login-footer {
    position: relative;
    z-index: 5;
    text-align: center;
    padding: 1.25rem;
    font-size: 11px;
    color: rgba(240, 244, 248, 0.32);
    letter-spacing: 0.14em;
}

.login-footer strong,
.login-footer a {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.motion-pending {
    opacity: 0;
    will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
    .motion-pending {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .login-header {
        padding: 0 1.25rem;
    }

    .login-card {
        padding: 2rem 1.35rem;
    }
}

@media (max-width: 480px) {
    .login-back .login-back-text {
        display: none;
    }

    .login-wrap {
        padding: 1.5rem 1rem;
    }
}

.login-header__tools {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
}

html.light-theme body.login-body {
    background: var(--blue-dark);
    color: var(--text-main);
}

html.light-theme .login-bg {
    background:
        radial-gradient(ellipse 70% 55% at 18% 12%, rgba(26, 79, 140, 0.14) 0%, transparent 58%),
        radial-gradient(ellipse 55% 45% at 88% 78%, rgba(13, 122, 111, 0.1) 0%, transparent 55%),
        linear-gradient(165deg, #eef3f8 0%, #f7fafc 42%, #e8eef4 100%);
}

html.light-theme .login-overlay {
    background:
        radial-gradient(ellipse 85% 70% at 50% 38%, transparent 0%, rgba(232, 238, 244, 0.25) 70%, rgba(232, 238, 244, 0.55) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 35%, rgba(232, 238, 244, 0.4) 100%);
}

html.light-theme .login-header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom-color: rgba(26, 79, 140, 0.1);
    box-shadow: 0 4px 20px rgba(18, 48, 80, 0.06);
}

html.light-theme .login-back,
html.light-theme .login-footer,
html.light-theme .login-sub {
    color: var(--text-muted);
}

html.light-theme .login-footer a:hover {
    color: var(--brand);
}

html.light-theme .login-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(26, 79, 140, 0.12);
    box-shadow:
        0 20px 48px rgba(18, 48, 80, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html.light-theme .login-card h1,
html.light-theme .login-field label,
html.light-theme .login-field-head label {
    color: var(--text-main);
}

html.light-theme .login-input-wrap input {
    background: rgba(26, 79, 140, 0.04);
    border-color: rgba(26, 79, 140, 0.14);
    color: var(--text-main);
}

html.light-theme .login-input-wrap input::placeholder {
    color: rgba(18, 32, 51, 0.42);
}

html.light-theme .login-input-wrap i.field-icon {
    color: var(--brand);
}

html.light-theme .login-input-wrap input:focus {
    background: rgba(26, 79, 140, 0.06);
    border-color: rgba(26, 79, 140, 0.35);
}

html.light-theme .login-bg::before {
    background-image:
        linear-gradient(rgba(26, 79, 140, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 79, 140, 0.06) 1px, transparent 1px);
    opacity: 0.7;
}

html.light-theme .login-bg::after {
    background:
        radial-gradient(circle at 50% 120%, rgba(26, 79, 140, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 1px 1px, rgba(26, 79, 140, 0.05) 1px, transparent 0);
}

html.light-theme .login-orb-1 {
    background: rgba(26, 79, 140, 0.12);
}

html.light-theme .login-orb-2 {
    background: rgba(13, 122, 111, 0.1);
}

html.light-theme .login-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

html.light-theme .login-status {
    color: var(--text-muted);
}

html.light-theme .login-forgot {
    color: var(--brand);
}

html.light-theme .login-forgot:hover {
    color: var(--brand-dark);
}

html.light-theme .login-help,
html.light-theme .login-remember {
    color: var(--text-muted);
}

html.light-theme .login-help a {
    color: var(--brand);
}

html.light-theme .login-help a:hover {
    color: var(--brand-dark);
}

html.light-theme .login-modal-backdrop {
    background: rgba(18, 48, 80, 0.45);
}

html.light-theme .login-modal-panel {
    background: linear-gradient(160deg, #ffffff 0%, #f3f6f9 100%);
    border-color: rgba(26, 79, 140, 0.12);
    box-shadow: 0 24px 64px rgba(18, 48, 80, 0.18);
}

html.light-theme .login-modal-close {
    background: rgba(26, 79, 140, 0.08);
    color: var(--text-main);
}

html.light-theme .login-modal-close:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

html.light-theme .login-modal-title,
html.light-theme .login-modal-text {
    color: var(--text-main);
}

html.light-theme .login-modal-text {
    color: var(--text-muted);
}

html.light-theme .login-modal-contact {
    background: rgba(26, 79, 140, 0.04);
    border-color: rgba(26, 79, 140, 0.12);
    color: var(--text-main);
}

html.light-theme .login-modal-contact:hover {
    background: rgba(26, 79, 140, 0.08);
}

html.light-theme .login-footer strong,
html.light-theme .login-footer a {
    color: var(--text-main);
}
