@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/vazirmatn/v33/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/vazirmatn/v33/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --page-bg: #06101d;
    --page-bg-soft: #0b192a;
    --panel-bg: rgba(11, 25, 42, 0.88);
    --panel-solid: #0d1d30;
    --panel-muted: rgba(255, 255, 255, 0.045);
    --input-bg: rgba(3, 12, 23, 0.55);
    --text-main: #f7fbff;
    --text-secondary: #c9d6e5;
    --text-muted: #8fa4ba;
    --text-subtle: #71869d;
    --border: rgba(148, 163, 184, 0.19);
    --border-strong: rgba(148, 163, 184, 0.34);
    --primary: #5eead4;
    --primary-hover: #78f3df;
    --primary-deep: #073b38;
    --primary-soft: rgba(94, 234, 212, 0.12);
    --purple: #c068df;
    --green: #73e44c;
    --danger: #ff8d9d;
    --danger-bg: rgba(251, 113, 133, 0.1);
    --danger-border: rgba(251, 113, 133, 0.28);
    --warning: #fbbf24;
    --shadow-xl: 0 42px 100px rgba(0, 0, 0, 0.48);
    --shadow-lg: 0 24px 58px rgba(0, 0, 0, 0.34);
    --shadow-focus: 0 0 0 4px rgba(94, 234, 212, 0.12);
}

html[data-theme='light'] {
    color-scheme: light;
    --page-bg: #edf3f8;
    --page-bg-soft: #f8fbfd;
    --panel-bg: rgba(255, 255, 255, 0.88);
    --panel-solid: #ffffff;
    --panel-muted: rgba(15, 23, 42, 0.038);
    --input-bg: #ffffff;
    --text-main: #142033;
    --text-secondary: #33465b;
    --text-muted: #5d7187;
    --text-subtle: #7b8da1;
    --border: rgba(51, 65, 85, 0.15);
    --border-strong: rgba(51, 65, 85, 0.28);
    --primary: #0f766e;
    --primary-hover: #0c655f;
    --primary-deep: #ffffff;
    --primary-soft: rgba(15, 118, 110, 0.09);
    --purple: #8f35b1;
    --green: #42a927;
    --danger: #b42318;
    --danger-bg: rgba(180, 35, 24, 0.07);
    --danger-border: rgba(180, 35, 24, 0.18);
    --warning: #8a5700;
    --shadow-xl: 0 34px 82px rgba(15, 23, 42, 0.16);
    --shadow-lg: 0 20px 46px rgba(15, 23, 42, 0.1);
    --shadow-focus: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

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

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--page-bg);
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--text-main);
    background: var(--page-bg);
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

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

button {
    color: inherit;
}

svg {
    display: block;
}

[hidden] {
    display: none !important;
}

.auth-page {
    position: relative;
    display: grid;
    place-items: center;
    padding: clamp(16px, 3vw, 42px);
}

.auth-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 8% 2%, rgba(94, 234, 212, 0.11), transparent 31%),
        radial-gradient(circle at 92% 90%, rgba(192, 104, 223, 0.1), transparent 29%),
        linear-gradient(135deg, var(--page-bg), var(--page-bg-soft));
}

.auth-grid {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 24%, #000 76%, transparent);
}

.auth-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(8px);
    opacity: 0.48;
    animation: auth-float 18s ease-in-out infinite;
}

.auth-glow--one {
    width: min(620px, 70vw);
    height: min(620px, 70vw);
    top: -34%;
    left: -17%;
    background: radial-gradient(circle, rgba(94, 234, 212, 0.24), transparent 67%);
}

.auth-glow--two {
    width: min(540px, 62vw);
    height: min(540px, 62vw);
    right: -15%;
    bottom: -33%;
    animation-delay: -8s;
    background: radial-gradient(circle, rgba(192, 104, 223, 0.2), transparent 68%);
}

@keyframes auth-float {
    50% {
        transform: translate3d(24px, -18px, 0) scale(1.06);
    }
}

.theme-toggle {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    inset-inline-end: max(18px, env(safe-area-inset-left), env(safe-area-inset-right));
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--panel-bg);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.3s ease;
}

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

.theme-toggle__icon {
    position: relative;
    width: 20px;
    height: 20px;
}

.theme-icon {
    position: absolute;
    inset: 0;
    width: 20px;
    height: 20px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-icon--sun {
    opacity: 0;
    transform: rotate(-35deg) scale(0.72);
}

html[data-theme='light'] .theme-icon--moon {
    opacity: 0;
    transform: rotate(35deg) scale(0.72);
}

html[data-theme='light'] .theme-icon--sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.theme-toggle__label {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(400px, 0.92fr);
    width: min(1180px, 100%);
    min-height: min(760px, calc(100dvh - 64px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 32px;
    background: var(--panel-bg);
    box-shadow: var(--shadow-xl);
    -webkit-backdrop-filter: blur(26px);
    backdrop-filter: blur(26px);
}

.auth-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: clamp(36px, 5vw, 66px);
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(94, 234, 212, 0.08), transparent 42%),
        linear-gradient(320deg, rgba(192, 104, 223, 0.08), transparent 40%),
        rgba(4, 13, 25, 0.48);
    border-inline-end: 1px solid var(--border);
}

html[data-theme='light'] .auth-showcase {
    background:
        linear-gradient(145deg, rgba(15, 118, 110, 0.07), transparent 42%),
        linear-gradient(320deg, rgba(143, 53, 177, 0.06), transparent 40%),
        rgba(243, 248, 251, 0.82);
}

.auth-showcase::before,
.auth-showcase::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth-showcase::before {
    width: 360px;
    height: 360px;
    top: -190px;
    inset-inline-start: -160px;
    border: 1px solid rgba(94, 234, 212, 0.15);
    box-shadow: 0 0 0 48px rgba(94, 234, 212, 0.025), 0 0 0 96px rgba(94, 234, 212, 0.018);
}

.auth-showcase::after {
    width: 280px;
    height: 280px;
    inset-inline-end: -150px;
    bottom: 130px;
    border: 1px solid rgba(192, 104, 223, 0.14);
    box-shadow: 0 0 0 42px rgba(192, 104, 223, 0.025), 0 0 0 84px rgba(192, 104, 223, 0.018);
}

.auth-showcase__content,
.developer-card {
    position: relative;
    z-index: 1;
}

.system-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.system-brand__mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border: 1px solid rgba(94, 234, 212, 0.3);
    border-radius: 16px;
    color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.12);
}

.system-brand__mark svg {
    width: 32px;
    height: 32px;
}

.system-brand__name {
    display: block;
    color: var(--text-main);
    font-family: Arial, sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
}

.system-brand__name span {
    color: var(--primary);
}

.system-brand__caption {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.showcase-copy {
    max-width: 580px;
    margin-top: clamp(48px, 7vh, 82px);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 12px;
    border: 1px solid rgba(94, 234, 212, 0.2);
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 0.75rem;
    font-weight: 800;
}

.eyebrow__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(94, 234, 212, 0.09);
}

.showcase-copy h1 {
    margin: 22px 0 14px;
    color: var(--text-main);
    font-size: clamp(2rem, 3.5vw, 3.25rem);
    font-weight: 900;
    line-height: 1.4;
    letter-spacing: -0.04em;
}

.showcase-copy p {
    max-width: 540px;
    margin: 0;
    color: var(--text-muted);
    font-size: clamp(0.92rem, 1.2vw, 1.02rem);
    line-height: 2;
}

.showcase-visual {
    position: absolute;
    top: 50%;
    left: -24px;
    width: 285px;
    height: 285px;
    transform: translateY(-44%);
    opacity: 0.88;
    pointer-events: none;
}

.network-orbit {
    position: absolute;
    border: 1px solid rgba(94, 234, 212, 0.22);
    border-radius: 50%;
}

.network-orbit::before {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    top: 50%;
    left: -4px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 18px rgba(94, 234, 212, 0.8);
}

.network-orbit--outer {
    inset: 0;
    animation: orbit-spin 18s linear infinite;
}

.network-orbit--inner {
    inset: 47px;
    border-color: rgba(192, 104, 223, 0.24);
    animation: orbit-spin 12s linear infinite reverse;
}

.network-orbit--inner::before {
    background: var(--purple);
    box-shadow: 0 0 18px rgba(192, 104, 223, 0.72);
}

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

.network-core {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border: 1px solid rgba(94, 234, 212, 0.3);
    border-radius: 26px;
    color: var(--primary);
    background: rgba(8, 24, 39, 0.88);
    box-shadow: 0 24px 58px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translate(-50%, -50%) rotate(6deg);
}

html[data-theme='light'] .network-core {
    background: rgba(255, 255, 255, 0.9);
}

.network-core svg {
    width: 48px;
    height: 48px;
    transform: rotate(-6deg);
}

.network-node {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 3px solid var(--panel-solid);
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 20px rgba(115, 228, 76, 0.68);
}

.network-node--one {
    top: 35px;
    right: 58px;
}

.network-node--two {
    right: 21px;
    bottom: 75px;
    background: var(--purple);
    box-shadow: 0 0 20px rgba(192, 104, 223, 0.68);
}

.network-node--three {
    bottom: 28px;
    left: 80px;
}

.network-node--four {
    top: 75px;
    left: 28px;
    background: var(--primary);
    box-shadow: 0 0 20px rgba(94, 234, 212, 0.68);
}

.capability-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 560px;
    margin-top: clamp(48px, 8vh, 86px);
}

.capability-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-muted);
}

.capability-item__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    color: var(--primary);
    background: var(--primary-soft);
}

.capability-item__icon svg {
    width: 20px;
    height: 20px;
}

.capability-item span:last-child {
    min-width: 0;
}

.capability-item strong,
.capability-item small {
    display: block;
}

.capability-item strong {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
}

.capability-item small {
    margin-top: 2px;
    color: var(--text-subtle);
    font-size: 0.67rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.developer-card {
    display: grid;
    grid-template-columns: auto minmax(110px, 180px) auto;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
    padding: 12px 14px 12px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: inherit;
    background: var(--panel-muted);
    text-decoration: none;
    transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.developer-card:hover {
    border-color: rgba(115, 228, 76, 0.42);
    background: rgba(115, 228, 76, 0.045);
    transform: translateY(-2px);
}

.developer-card__label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.developer-card__logo-wrap {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.developer-card__logo-wrap img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 34px;
    object-fit: contain;
}

.developer-card__link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    color: var(--primary);
    font-family: Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.developer-card__link svg {
    width: 16px;
    height: 16px;
}

.auth-form-panel {
    position: relative;
    display: grid;
    place-items: center;
    padding: clamp(34px, 5vw, 66px);
    background: var(--panel-bg);
}

.auth-form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.38;
    pointer-events: none;
    background: radial-gradient(circle at 52% 12%, rgba(94, 234, 212, 0.08), transparent 34%);
}

.auth-form-panel__inner {
    position: relative;
    z-index: 1;
    width: min(100%, 410px);
}

.login-header__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid rgba(94, 234, 212, 0.2);
    border-radius: 999px;
    color: var(--primary);
    background: var(--primary-soft);
    font-size: 0.72rem;
    font-weight: 800;
}

.login-header__badge svg {
    width: 16px;
    height: 16px;
}

.login-header h2 {
    margin: 18px 0 7px;
    color: var(--text-main);
    font-size: clamp(1.65rem, 3vw, 2.12rem);
    font-weight: 900;
    letter-spacing: -0.035em;
}

.login-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.9;
}

.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 22px;
    padding: 13px 14px;
    border: 1px solid var(--danger-border);
    border-radius: 15px;
    color: var(--danger);
    background: var(--danger-bg);
    animation: alert-in 0.35s ease both;
}

@keyframes alert-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
}

.form-alert__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: var(--danger-bg);
}

.form-alert__icon svg {
    width: 19px;
    height: 19px;
}

.form-alert strong,
.form-alert small {
    display: block;
}

.form-alert strong {
    color: currentColor;
    font-size: 0.79rem;
}

.form-alert small {
    margin-top: 2px;
    color: currentColor;
    font-size: 0.72rem;
    line-height: 1.8;
}

.login-form {
    margin-top: 28px;
}

.form-field + .form-field {
    margin-top: 18px;
}

.form-field label,
.field-label-row label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
}

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

.caps-lock {
    margin-bottom: 8px;
    color: var(--warning);
    font-size: 0.67rem;
    font-weight: 700;
}

.field-control {
    position: relative;
}

.field-control__icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 15px;
    z-index: 1;
    color: var(--text-subtle);
    transform: translateY(-50%);
    pointer-events: none;
    transition: color 0.2s ease;
}

.field-control__icon svg {
    width: 20px;
    height: 20px;
}

.form-input {
    width: 100%;
    min-height: 54px;
    padding-block: 12px;
    padding-inline: 48px 14px;
    border: 1px solid var(--border);
    border-radius: 15px;
    outline: none;
    color: var(--text-main);
    background: var(--input-bg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease;
}

.form-input--password {
    padding-inline-end: 50px;
}

.form-input::placeholder {
    color: var(--text-subtle);
    opacity: 0.8;
}

.form-input:hover {
    border-color: var(--border-strong);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

.field-control:focus-within .field-control__icon {
    color: var(--primary);
}

.form-input[aria-invalid='true'] {
    border-color: var(--danger-border);
}

.password-toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: 9px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 11px;
    color: var(--text-subtle);
    background: transparent;
    transform: translateY(-50%);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

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

.password-icon {
    width: 20px;
    height: 20px;
}

.password-icon--hide {
    display: none;
}

.password-toggle[aria-pressed='true'] .password-icon--show {
    display: none;
}

.password-toggle[aria-pressed='true'] .password-icon--hide {
    display: block;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 16px 0 22px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.remember-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.remember-option__box {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--primary-deep);
    background: var(--input-bg);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.remember-option__box svg {
    width: 13px;
    height: 13px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.remember-option input:checked + .remember-option__box {
    border-color: var(--primary);
    background: var(--primary);
}

.remember-option input:checked + .remember-option__box svg {
    opacity: 1;
    transform: scale(1);
}

.remember-option input:focus-visible + .remember-option__box {
    box-shadow: var(--shadow-focus);
}

.support-note {
    color: var(--text-subtle);
    font-size: 0.69rem;
    white-space: nowrap;
}

.submit-button,
.guest-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 54px;
    padding: 12px 20px;
    overflow: hidden;
    border-radius: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.submit-button {
    border: 1px solid var(--primary);
    color: var(--primary-deep);
    background: var(--primary);
    box-shadow: 0 14px 32px rgba(94, 234, 212, 0.18);
}

html[data-theme='light'] .submit-button {
    box-shadow: 0 14px 30px rgba(15, 118, 110, 0.18);
}

.submit-button::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: translateX(100%);
    transition: opacity 0.2s ease;
}

.submit-button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(94, 234, 212, 0.24);
}

.submit-button:hover:not(:disabled)::before {
    opacity: 1;
    animation: button-shine 0.85s ease;
}

@keyframes button-shine {
    to {
        transform: translateX(-100%);
    }
}

.submit-button__content,
.guest-button__content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.submit-button__content svg,
.guest-button__content svg {
    width: 20px;
    height: 20px;
}

.submit-button__spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner-rotate 0.75s linear infinite;
}

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

.submit-button.is-loading .submit-button__content,
.guest-button.is-loading .guest-button__content {
    display: none;
}

.submit-button.is-loading .submit-button__spinner,
.guest-button.is-loading .submit-button__spinner {
    display: block;
}

.submit-button:disabled,
.guest-button:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 18px;
    color: var(--text-subtle);
    font-size: 0.68rem;
    font-weight: 700;
}

.form-divider::before,
.form-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--border);
}

.guest-button {
    border: 1px solid var(--border);
    color: var(--text-secondary);
    background: var(--panel-muted);
}

.guest-button:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-footer__developer {
    color: var(--text-subtle);
    font-size: 0.67rem;
}

.login-footer__developer a {
    color: var(--primary);
    font-weight: 900;
    text-decoration: none;
}

.login-footer__developer a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.app-version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--panel-muted);
    font-size: 0.62rem;
    white-space: nowrap;
}

.app-version-icon {
    width: 15px;
    height: 15px;
    color: var(--primary);
}

.app-version-number {
    color: var(--primary);
    font-size: 0.66rem;
}

.noscript-message {
    position: fixed;
    inset-inline-start: 18px;
    bottom: 18px;
    z-index: 20;
    max-width: calc(100% - 36px);
    padding: 11px 14px;
    border: 1px solid var(--danger-border);
    border-radius: 12px;
    color: var(--danger);
    background: var(--panel-solid);
    box-shadow: var(--shadow-lg);
    font-size: 0.75rem;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

@media (max-width: 1040px) {
    .auth-shell {
        grid-template-columns: minmax(0, 0.9fr) minmax(380px, 1.1fr);
    }

    .auth-showcase {
        padding: 38px;
    }

    .showcase-visual {
        width: 230px;
        height: 230px;
        inset-inline-end: -80px;
    }

    .capability-list {
        grid-template-columns: 1fr;
        width: min(100%, 340px);
    }

    .developer-card {
        grid-template-columns: 1fr auto;
    }

    .developer-card__label {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .auth-page {
        display: block;
        padding: 74px 14px 18px;
    }

    .auth-shell {
        display: flex;
        flex-direction: column;
        min-height: auto;
        border-radius: 24px;
    }

    .auth-showcase {
        order: 2;
        padding: 30px;
        border-top: 1px solid var(--border);
        border-inline-end: 0;
    }

    .auth-form-panel {
        order: 1;
        padding: 42px 30px;
    }

    .showcase-copy {
        margin-top: 32px;
    }

    .showcase-copy h1 {
        font-size: clamp(1.7rem, 6vw, 2.35rem);
    }

    .showcase-visual {
        top: 110px;
        inset-inline-end: -80px;
        width: 210px;
        height: 210px;
        transform: none;
        opacity: 0.45;
    }

    .capability-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        max-width: none;
        margin-top: 36px;
    }
}

@media (max-width: 560px) {
    .theme-toggle {
        top: max(12px, env(safe-area-inset-top));
        inset-inline-end: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
        min-height: 40px;
        padding: 7px 10px;
    }

    .auth-page {
        padding-inline: 10px;
    }

    .auth-shell {
        border-radius: 20px;
    }

    .auth-form-panel,
    .auth-showcase {
        padding: 28px 20px;
    }

    .login-header h2 {
        font-size: 1.55rem;
    }

    .form-options,
    .login-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .support-note {
        padding-inline-start: 28px;
    }

    .capability-list {
        grid-template-columns: 1fr;
    }

    .developer-card {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .developer-card__logo-wrap {
        width: min(100%, 190px);
    }

    .developer-card__link {
        justify-content: flex-start;
    }

    .showcase-visual {
        display: none;
    }

    .theme-toggle__label {
        display: none;
    }
}

@media (max-height: 760px) and (min-width: 821px) {
    .auth-page {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .auth-shell {
        min-height: 680px;
    }

    .showcase-copy {
        margin-top: 42px;
    }

    .capability-list {
        margin-top: 42px;
    }
}

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

/* ========================================================================== 
   Enterprise Access UI v2 — compact, viewport-safe and organization focused
   ========================================================================== */

@media (min-width: 821px) {
    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .auth-page {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        padding: clamp(12px, 2vh, 22px) clamp(16px, 2.2vw, 34px);
        overflow: hidden;
    }

    .auth-shell {
        width: min(1240px, 100%);
        height: min(748px, calc(100dvh - clamp(24px, 4vh, 44px)));
        min-height: 0;
        max-height: calc(100dvh - clamp(24px, 4vh, 44px));
        grid-template-columns: minmax(0, 1.14fr) minmax(390px, 0.86fr);
        border-radius: 26px;
        box-shadow: 0 30px 86px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    }

    .auth-showcase,
    .auth-form-panel {
        min-height: 0;
    }

    .auth-showcase {
        padding: clamp(28px, 4vh, 46px) clamp(34px, 3.8vw, 58px);
    }

    .auth-showcase__content {
        display: flex;
        min-height: 0;
        flex: 1;
        flex-direction: column;
    }

    .auth-form-panel {
        padding: clamp(28px, 4vh, 48px) clamp(34px, 3.7vw, 56px);
    }

    .auth-form-panel__inner {
        width: min(100%, 398px);
    }
}

.auth-shell {
    isolation: isolate;
}

.auth-shell::before {
    content: '';
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;
    left: 0;
    height: 1px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(94, 234, 212, 0.54), rgba(192, 104, 223, 0.34), transparent);
}

.auth-showcase {
    background:
        linear-gradient(155deg, rgba(94, 234, 212, 0.075), transparent 34%),
        linear-gradient(325deg, rgba(192, 104, 223, 0.07), transparent 42%),
        rgba(4, 13, 25, 0.58);
}

html[data-theme='light'] .auth-showcase {
    background:
        linear-gradient(155deg, rgba(15, 118, 110, 0.06), transparent 34%),
        linear-gradient(325deg, rgba(143, 53, 177, 0.045), transparent 42%),
        rgba(246, 249, 252, 0.9);
}

.system-brand {
    gap: 12px;
}

.system-brand__mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 13px;
}

.system-brand__mark svg {
    width: 28px;
    height: 28px;
}

.system-brand__name {
    font-size: 1.34rem;
}

.showcase-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: clamp(22px, 3.5vh, 34px);
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.showcase-context__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
}

.showcase-context__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 5px var(--primary-soft), 0 0 14px rgba(94, 234, 212, 0.46);
}

.showcase-context__code {
    color: var(--text-subtle);
    font-family: Arial, sans-serif;
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    white-space: nowrap;
}

.showcase-copy {
    position: relative;
    z-index: 2;
    max-width: 560px;
    margin-top: clamp(30px, 5.5vh, 54px);
}

.showcase-copy h1 {
    max-width: 570px;
    margin: 17px 0 12px;
    font-size: clamp(1.9rem, 2.75vw, 2.82rem);
    line-height: 1.42;
    letter-spacing: -0.045em;
}

.showcase-copy h1 span {
    display: inline-block;
    color: var(--primary);
    font-family: Arial, sans-serif;
    font-size: 0.9em;
    letter-spacing: -0.04em;
}

.showcase-copy p {
    max-width: 500px;
    font-size: 0.88rem;
    line-height: 1.95;
}

.eyebrow {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.69rem;
}

.eyebrow__dot {
    width: 6px;
    height: 6px;
}

.showcase-visual {
    top: auto;
    bottom: 124px;
    inset-inline-end: -40px;
    width: clamp(190px, 18vw, 255px);
    height: clamp(190px, 18vw, 255px);
    transform: none;
    opacity: 0.63;
}

.network-core {
    width: 80px;
    height: 80px;
    border-radius: 22px;
}

.network-core svg {
    width: 42px;
    height: 42px;
}

.capability-list {
    position: relative;
    z-index: 2;
    gap: 10px;
    max-width: 530px;
    margin-top: auto;
    padding-top: clamp(24px, 4vh, 38px);
}

.capability-item {
    min-height: 62px;
    padding: 11px 12px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
}

html[data-theme='light'] .capability-item {
    background: rgba(15, 23, 42, 0.025);
}

.capability-item__icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
}

.capability-item__icon svg {
    width: 18px;
    height: 18px;
}

.capability-item strong {
    font-size: 0.73rem;
}

.capability-item small {
    font-size: 0.62rem;
}

.developer-card {
    grid-template-columns: auto minmax(120px, 168px) auto;
    gap: 13px;
    min-height: 66px;
    margin-top: 15px;
    padding: 9px 12px 9px 15px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

html[data-theme='light'] .developer-card {
    background: rgba(15, 23, 42, 0.025);
}

.developer-card__label {
    font-size: 0.68rem;
}

.developer-card__logo-wrap {
    min-height: 42px;
    padding: 6px 10px;
    border-radius: 10px;
}

.developer-card__logo-wrap img {
    max-height: 28px;
}

.developer-card__link {
    font-size: 0.7rem;
}

.auth-form-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 24%),
        var(--panel-bg);
}

.auth-form-panel::after {
    content: 'IDENTITY & ACCESS';
    position: absolute;
    top: 22px;
    inset-inline-start: 24px;
    color: var(--text-subtle);
    font-family: Arial, sans-serif;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    opacity: 0.56;
}

.login-header__badge {
    border-radius: 8px;
}

.login-header h2 {
    margin-top: 14px;
    font-size: clamp(1.62rem, 2.4vw, 1.95rem);
}

.login-header p {
    font-size: 0.8rem;
}

.login-form {
    margin-top: 23px;
}

.form-field + .form-field {
    margin-top: 15px;
}

.form-field label,
.field-label-row label {
    margin-bottom: 7px;
    font-size: 0.73rem;
}

.form-input {
    min-height: 50px;
    border-radius: 12px;
    font-size: 0.79rem;
}

.form-options {
    margin: 13px 0 18px;
}

.submit-button,
.guest-button {
    min-height: 50px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.form-divider {
    margin: 19px 0 15px;
}

.login-footer {
    margin-top: 22px;
    padding-top: 16px;
}

.theme-toggle {
    top: max(12px, env(safe-area-inset-top));
    inset-inline-end: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 10px;
}

@media (max-width: 1040px) and (min-width: 821px) {
    .auth-shell {
        grid-template-columns: minmax(0, 0.95fr) minmax(370px, 1.05fr);
    }

    .showcase-copy h1 {
        font-size: clamp(1.72rem, 3.1vw, 2.3rem);
    }

    .showcase-visual {
        inset-inline-end: -92px;
        opacity: 0.42;
    }

    .developer-card {
        grid-template-columns: 1fr auto;
    }

    .developer-card__label {
        grid-column: 1 / -1;
    }
}

@media (max-height: 760px) and (min-width: 821px) {
    .auth-shell {
        height: calc(100dvh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .auth-page {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .auth-showcase {
        padding-top: 25px;
        padding-bottom: 25px;
    }

    .auth-form-panel {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .showcase-context {
        margin-top: 18px;
        padding: 8px 0;
    }

    .showcase-copy {
        margin-top: 24px;
    }

    .showcase-copy h1 {
        margin-top: 13px;
        font-size: clamp(1.65rem, 2.55vw, 2.2rem);
    }

    .capability-list {
        padding-top: 18px;
    }

    .developer-card {
        min-height: 58px;
        margin-top: 10px;
    }

    .login-form {
        margin-top: 18px;
    }

    .form-field + .form-field {
        margin-top: 12px;
    }

    .form-options {
        margin: 10px 0 14px;
    }

    .form-divider {
        margin: 15px 0 12px;
    }

    .login-footer {
        margin-top: 16px;
        padding-top: 13px;
    }
}

@media (max-height: 650px) and (min-width: 821px) {
    .auth-form-panel::after,
    .showcase-visual,
    .showcase-copy p,
    .capability-item small,
    .login-header p {
        display: none;
    }

    .showcase-context {
        margin-top: 12px;
    }

    .showcase-copy {
        margin-top: 16px;
    }

    .showcase-copy h1 {
        font-size: 1.72rem;
    }

    .capability-list {
        padding-top: 12px;
    }

    .capability-item {
        min-height: 48px;
    }

    .developer-card {
        min-height: 52px;
    }

    .login-header h2 {
        margin: 10px 0 0;
    }
}

@media (max-width: 820px) {
    html,
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .auth-page {
        min-height: 100dvh;
    }

    .showcase-context {
        margin-top: 24px;
    }

    .showcase-copy {
        margin-top: 28px;
    }

    .auth-form-panel::after {
        display: none;
    }
}

@media (max-width: 560px) {
    .showcase-context__code {
        display: none;
    }
}


/* v3 refinement */
.showcase-visual,
.network-orbit,
.network-core,
.network-node {
    display: none !important;
}

.auth-page {
    min-height: 100dvh;
}

.auth-showcase__content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.showcase-copy {
    max-width: 580px;
    margin-top: 24px;
}

.showcase-copy h1 {
    margin: 18px 0 12px;
    font-size: clamp(2rem, 3vw, 3.05rem);
    line-height: 1.55;
}

.showcase-copy p {
    max-width: 560px;
    line-height: 1.95;
}

.capability-list {
    margin-top: 20px;
}

.capability-item {
    min-height: 84px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)), var(--panel-muted);
}

html[data-theme='light'] .capability-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.55)), var(--panel-muted);
}

.capability-item strong {
    font-size: 0.82rem;
}

.capability-item small {
    margin-top: 4px;
    white-space: normal;
    line-height: 1.8;
}

.login-header h2 {
    margin-top: 16px;
    margin-bottom: 8px;
}

.login-form {
    margin-top: 24px;
}

@media (min-width: 821px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .auth-shell {
        min-height: min(720px, calc(100dvh - 52px));
    }
}

@media (max-width: 1040px) {
    .showcase-copy {
        margin-top: 20px;
    }
}

@media (max-width: 820px) {
    html,
    body {
        overflow-x: hidden;
    }
}
