@font-face {
    font-family: "YekanBakh";
    src: url("/font/YekanBakhFaNum-VF.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --background: #f8f7f3;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-solid: #ffffff;
    --surface-subtle: #f7f7f5;
    --surface-muted: #f1f0ea;
    --foreground: #25312e;
    --heading: #15201d;
    --muted-foreground: #65716c;
    --border: #dce1dd;
    --border-strong: #bfc7c2;
    --primary: #3f7469;
    --primary-hover: #345f56;
    --primary-active: #294c45;
    --primary-foreground: #f7faf8;
    --primary-soft: #e8f0ed;
    --accent: #f5ebd9;
    --accent-foreground: #8a642c;
    --success: #25734f;
    --success-soft: #e8f5ed;
    --danger: #b33d3d;
    --danger-soft: #fceaea;
    --shadow-card: 0 26px 60px -24px rgba(17, 24, 22, 0.28);
    --shadow-soft: 0 10px 28px rgba(17, 24, 22, 0.08);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --background: #13201d;
    --surface: rgba(23, 36, 33, 0.86);
    --surface-solid: #172421;
    --surface-subtle: #1d2c29;
    --surface-muted: #23312e;
    --foreground: #e8f0ed;
    --heading: #f7faf8;
    --muted-foreground: #b1c5bf;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --primary: #88bda4;
    --primary-hover: #b1d3b9;
    --primary-active: #659287;
    --primary-foreground: #13201d;
    --primary-soft: rgba(63, 116, 105, 0.34);
    --accent: rgba(138, 100, 44, 0.28);
    --accent-foreground: #f5ebd9;
    --success: #8ed0ad;
    --success-soft: rgba(37, 115, 79, 0.28);
    --danger: #ef8b8b;
    --danger-soft: rgba(179, 61, 61, 0.24);
    --shadow-card: 0 30px 70px -24px rgba(0, 0, 0, 0.62);
    --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.28);
}

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

html {
    min-width: 320px;
    min-height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    direction: rtl;
    color: var(--foreground);
    background:
        radial-gradient(circle at 8% 8%, rgba(177, 211, 185, 0.3) 0, transparent 31rem),
        radial-gradient(circle at 92% 90%, rgba(245, 235, 217, 0.72) 0, transparent 32rem),
        linear-gradient(135deg, var(--background) 0%, color-mix(in srgb, var(--background) 90%, var(--surface-muted)) 100%);
    font-family: "YekanBakh", Tahoma, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    -webkit-font-smoothing: auto;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] body {
    background:
        radial-gradient(circle at 8% 8%, rgba(101, 146, 135, 0.16) 0, transparent 31rem),
        radial-gradient(circle at 92% 90%, rgba(184, 138, 67, 0.13) 0, transparent 32rem),
        linear-gradient(135deg, #13201d 0%, #172421 100%);
}

button, input {
    font: inherit;
}

button, input, a {
    -webkit-tap-highlight-color: transparent;
}

svg {
    display: block;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.page-glow {
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(76px);
}

.page-glow-top {
    top: -11rem;
    left: -10rem;
    width: 27rem;
    height: 27rem;
    background: rgba(177, 211, 185, 0.3);
}

.page-glow-bottom {
    right: -8rem;
    bottom: -10rem;
    width: 25rem;
    height: 25rem;
    background: rgba(184, 138, 67, 0.12);
}

.site-header {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    left: 0;
}

.header-shell {
    display: flex;
    width: min(100% - 32px, 1152px);
    height: 76px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
}

.brand-pill {
    display: inline-flex;
    min-height: 42px;
    padding: 6px 12px 6px 15px;
    align-items: center;
    gap: 9px;
    border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    box-shadow: 0 3px 12px rgba(17, 24, 22, 0.05);
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(14px);
}

.brand-mark {
    display: inline-flex;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    color: var(--primary-foreground);
    background: var(--primary);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 22%, transparent);
}

.brand-mark svg {
    width: 17px;
    height: 17px;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.system-label {
    color: var(--muted-foreground);
    font-size: 12px;
}

.theme-toggle {
    display: inline-flex;
    width: 38px;
    height: 38px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    color: var(--foreground);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
    backdrop-filter: blur(14px);
}

.theme-toggle:hover {
    border-color: var(--primary);
    background: var(--surface-solid);
    transform: translateY(-1px);
}

.theme-toggle:focus-visible,
.password-toggle:focus-visible,
.btn-submit:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 24%, transparent);
    outline-offset: 2px;
}

.theme-icon {
    width: 18px;
    height: 18px;
}

.theme-icon-dark,
:root[data-theme="dark"] .theme-icon-light {
    display: none;
}

:root[data-theme="dark"] .theme-icon-dark {
    display: block;
}

.auth-shell {
    display: grid;
    width: min(100% - 40px, 1152px);
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: 98px 0 68px;
    align-items: center;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(32px, 4.5vw, 56px);
    direction: ltr;
}

.intro-panel,
.login-card {
    border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(18px);
}

.intro-panel {
    display: flex;
    min-height: 586px;
    padding: 30px;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 24px;
}

.intro-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    min-height: 31px;
    padding: 5px 12px;
    align-items: center;
    gap: 7px;
    border: 1px solid color-mix(in srgb, var(--accent-foreground) 16%, var(--border));
    border-radius: 999px;
    color: var(--accent-foreground);
    background: color-mix(in srgb, var(--accent) 65%, transparent);
    font-size: 12px;
    font-weight: 550;
}

.eyebrow svg {
    width: 15px;
    height: 15px;
}

.identity-visual {
    position: relative;
    display: flex;
    width: 100%;
    height: 170px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px),
        linear-gradient(180deg, var(--surface-solid), var(--surface-subtle));
    background-size: 34px 34px, 34px 34px, auto;
    background-position: center;
}

.identity-visual::after {
    position: absolute;
    inset: 0;
    content: "";
    background: radial-gradient(circle, color-mix(in srgb, var(--surface-solid) 4%, transparent) 0, var(--surface-solid) 68%);
    opacity: 0.74;
}

.visual-orbit {
    position: absolute;
    z-index: 1;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    border-radius: 999px;
    animation: orbit-pulse 3s ease-in-out infinite;
}

.visual-orbit-outer {
    width: 112px;
    height: 112px;
}

.visual-orbit-inner {
    width: 88px;
    height: 88px;
    animation-delay: 800ms;
}

.visual-core {
    position: relative;
    z-index: 2;
    display: flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    color: var(--primary-foreground);
    background: var(--primary);
    box-shadow: 0 0 38px color-mix(in srgb, var(--primary) 44%, transparent);
    animation: core-breathe 2.8s ease-in-out infinite;
}

.visual-core svg {
    width: 31px;
    height: 31px;
}

.visual-bars {
    position: absolute;
    z-index: 3;
    bottom: 17px;
    display: flex;
    height: 25px;
    align-items: end;
    gap: 4px;
}

.visual-bars span {
    width: 4px;
    border-radius: 999px;
    background: var(--primary);
    animation: bars-wave 1.25s ease-in-out infinite;
}

.visual-bars span:nth-child(1), .visual-bars span:nth-child(5) { height: 8px; opacity: .58; }
.visual-bars span:nth-child(2), .visual-bars span:nth-child(4) { height: 15px; opacity: .78; animation-delay: 120ms; }
.visual-bars span:nth-child(3) { height: 24px; animation-delay: 240ms; }

.intro-copy h2 {
    max-width: 520px;
    margin: 0 0 10px;
    color: var(--heading);
    font-size: clamp(22px, 1.95vw, 27px);
    font-weight: 650;
    letter-spacing: -0.015em;
    line-height: 1.45;
}

.intro-copy p {
    max-width: 560px;
    margin: 0;
    color: var(--muted-foreground);
    font-size: 13px;
    line-height: 1.95;
}

.feature-list {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.feature-item {
    display: flex;
    min-height: 58px;
    padding: 10px 12px;
    align-items: center;
    gap: 11px;
    border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface-solid) 68%, transparent);
}

.feature-icon {
    display: inline-flex;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: var(--primary);
    background: var(--primary-soft);
}

.feature-icon svg {
    width: 19px;
    height: 19px;
}

.feature-item div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.feature-item strong {
    color: var(--foreground);
    font-size: 13px;
    font-weight: 600;
}

.feature-item small {
    overflow: hidden;
    color: var(--muted-foreground);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-section {
    width: 100%;
    max-width: 450px;
    justify-self: center;
}

.login-card {
    width: 100%;
    padding: 32px;
    border-radius: 24px;
}

.card-brand {
    display: flex;
    margin-bottom: 27px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--foreground);
    font-size: 13px;
    font-weight: 600;
}

.brand-mark-card {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
}

.login-header {
    margin-bottom: 24px;
    text-align: center;
}

.login-header h1 {
    margin: 0 0 7px;
    color: var(--heading);
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.01em;
    line-height: 1.5;
}

.login-header p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 12px;
    line-height: 1.8;
}

.alert {
    display: flex;
    padding: 11px 12px;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid;
    border-radius: 11px;
    margin-bottom: 18px;
    font-size: 12px;
    line-height: 1.75;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 2px;
}

.alert:has(span:empty) {
    display: none;
}

.alert-error {
    border-color: color-mix(in srgb, var(--danger) 28%, transparent);
    color: var(--danger);
    background: var(--danger-soft);
}

.alert-success {
    border-color: color-mix(in srgb, var(--success) 28%, transparent);
    color: var(--success);
    background: var(--success-soft);
}

form {
    display: grid;
    gap: 17px;
}

.form-group {
    display: grid;
    gap: 7px;
}

.form-group label {
    color: var(--foreground);
    font-size: 12.5px;
    font-weight: 600;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.label-row span {
    color: var(--muted-foreground);
    font-size: 10.5px;
}

.input-shell {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    z-index: 1;
    right: 13px;
    width: 18px;
    height: 18px;
    color: var(--muted-foreground);
    pointer-events: none;
}

.form-group input {
    width: 100%;
    height: 46px;
    padding: 0 42px 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    outline: none;
    color: var(--foreground);
    background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
    font-size: 13px;
    direction: rtl;
    text-align: right;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.form-group input::placeholder {
    color: color-mix(in srgb, var(--muted-foreground) 78%, transparent);
}

.form-group input:hover {
    border-color: color-mix(in srgb, var(--primary) 50%, var(--border-strong));
}

.form-group input:focus {
    border-color: var(--primary);
    background: var(--surface-solid);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.input-shell:focus-within .input-icon {
    color: var(--primary);
}

.password-toggle {
    position: absolute;
    left: 8px;
    display: inline-flex;
    width: 32px;
    height: 32px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    color: var(--muted-foreground);
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
}

.eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
    display: block;
}

.input-shell:has(.password-toggle) input {
    padding-left: 45px;
}

.btn-submit {
    display: flex;
    width: 100%;
    height: 46px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 11px;
    margin-top: 3px;
    color: var(--primary-foreground);
    background: var(--primary);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 23%, transparent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.btn-submit:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 13px 28px color-mix(in srgb, var(--primary) 29%, transparent);
    transform: translateY(-1px);
}

.btn-submit:active:not(:disabled) {
    background: var(--primary-active);
    transform: translateY(0);
}

.btn-submit:disabled {
    cursor: wait;
    opacity: 0.78;
}

.button-arrow {
    width: 17px;
    height: 17px;
    transform: rotate(180deg);
}

.button-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid color-mix(in srgb, var(--primary-foreground) 35%, transparent);
    border-top-color: var(--primary-foreground);
    border-radius: 999px;
    animation: spin 700ms linear infinite;
}

.btn-submit.is-loading .button-spinner {
    display: block;
}

.btn-submit.is-loading .button-arrow {
    display: none;
}

.secure-note {
    display: flex;
    min-height: 38px;
    padding: 9px 11px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
    border-radius: 11px;
    margin-top: 19px;
    color: var(--muted-foreground);
    background: color-mix(in srgb, var(--surface-subtle) 72%, transparent);
    font-size: 10.5px;
}

.secure-note svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: var(--primary);
}

.site-footer {
    position: absolute;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    min-height: 45px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
}

.site-footer p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 10.5px;
    text-align: center;
}

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

@keyframes orbit-pulse {
    0%, 100% { opacity: .3; transform: scale(.96); }
    50% { opacity: .78; transform: scale(1.05); }
}

@keyframes core-breathe {
    0%, 100% { transform: scale(.97); }
    50% { transform: scale(1.04); }
}

@keyframes bars-wave {
    0%, 100% { transform: scaleY(.62); }
    50% { transform: scaleY(1); }
}

@media (max-width: 900px) {
    .auth-shell {
        width: min(100% - 32px, 520px);
        padding-top: 92px;
        grid-template-columns: minmax(0, 1fr);
    }

    .intro-panel {
        display: none;
    }

    .login-section {
        max-width: 460px;
    }
}

@media (max-width: 560px) {
    .header-shell {
        width: min(100% - 24px, 1180px);
        height: 66px;
    }

    .system-label {
        display: none;
    }

    .brand-pill {
        min-height: 38px;
        padding: 4px 9px 4px 12px;
        font-size: 12px;
    }

    .brand-mark {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .auth-shell {
        width: min(100% - 24px, 520px);
        padding: 82px 0 58px;
    }

    .login-card {
        padding: 25px 18px 20px;
        border-radius: 21px;
    }

    .card-brand {
        margin-bottom: 22px;
    }

    .login-header {
        margin-bottom: 21px;
    }

    .login-header h1 {
        font-size: 19px;
    }

    .label-row span {
        display: none;
    }
}

@media (max-height: 720px) and (min-width: 901px) {
    .auth-shell {
        padding-top: 86px;
        padding-bottom: 54px;
    }

    .intro-panel {
        min-height: 510px;
        padding: 24px;
    }

    .identity-visual {
        height: 132px;
    }

    .intro-copy h2 {
        font-size: 23px;
    }

    .login-card {
        padding-top: 26px;
        padding-bottom: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
