@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --ink: #f3f6ff;
    --muted: #b2bdd2;
    --gold: #efc98b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
body {
    margin: 0;
    background: #0a1022;
    color: var(--ink);
    font-family: Vazirmatn, Tahoma, sans-serif;
}
.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: #0a1022;
}
.ambient::before {
    content: "";
    position: absolute;
    inset: -10%;
    background: radial-gradient(ellipse 44% 47% at 15% 25%, #274b82 0%, transparent 78%), radial-gradient(ellipse 45% 49% at 84% 15%, #49366f 0%, transparent 77%), radial-gradient(ellipse 55% 55% at 56% 88%, #075f68 0%, transparent 74%), #0a1022;
    animation: ambient-drift 14s ease-in-out infinite alternate;
}
.ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, #ffffff08, transparent 35%, #ffffff07 75%, transparent);
}
.aurora { position: absolute; inset: -15%; filter: blur(26px); will-change: transform; }
.orb { position: absolute; border-radius: 50%; mix-blend-mode: screen; opacity: .82; filter: blur(8px); animation: orb-float 13s ease-in-out infinite alternate; }
.orb.a { width: 43vw; height: 43vw; min-width: 340px; min-height: 340px; top: 4%; left: 3%; background: radial-gradient(circle, #358de9 0%, #316bdc99 35%, transparent 72%); }
.orb.b { width: 38vw; height: 38vw; min-width: 300px; min-height: 300px; right: 1%; top: 12%; background: radial-gradient(circle, #d17bea 0%, #8d54d999 37%, transparent 72%); animation-delay: -6s; }
.orb.c { width: 43vw; height: 32vw; min-width: 350px; min-height: 300px; bottom: -5%; left: 28%; background: radial-gradient(circle, #23d7c2 0%, #159aa999 40%, transparent 72%); animation-delay: -9s; }
.page { position: relative; z-index: 1; }
@keyframes ambient-drift { from { transform: scale(1) rotate(0deg); } to { transform: scale(1.12) rotate(5deg); } }
@keyframes orb-float { from { transform: translate(-4%, 5%) scale(.9); } to { transform: translate(8%, -6%) scale(1.16); } }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
.page { width: min(1100px, calc(100% - 48px)); height: 100%; margin: 0 auto; display: grid; grid-template-rows: clamp(64px, 13dvh, 110px) minmax(0, 1fr) clamp(32px, 7dvh, 64px); }
.page-header { display: flex; align-items: center; justify-content: space-between; min-height: 0; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 25px; font-weight: 800; }
.brand img { object-fit: contain; filter: drop-shadow(0 0 12px #efc98b25); }
.back-link { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; transition: color .2s; }
.back-link:hover { color: var(--gold); }
.auth-card {
    display: grid;
    grid-template-columns: 44% 56%;
    min-height: 0;
    border: 1px solid #c8dfff25;
    border-radius: 30px;
    overflow: hidden;
    background: #111c30cc;
    box-shadow: 0 30px 80px #02061555, inset 0 1px 0 #ffffff0a;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
.visual-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 32px 20px;
    border-left: 1px solid #c8dfff15;
    background: radial-gradient(ellipse at 50% 42%, #8d54d92e, transparent 62%), linear-gradient(145deg, #49366f55, #274b8240 60%, #075f682b);
}
.orbit-scene { position: relative; width: min(100%, 52dvh); aspect-ratio: 1; max-width: 460px; flex-shrink: 0; display: grid; place-items: center; }
.orbit { position: absolute; border: 1px solid #b5b4f12b; border-radius: 50%; }
.orbit-outer { inset: 0; }
.orbit-inner { inset: 11%; }
.orbit-tilted { width: 94%; height: 52%; transform: rotate(-32deg); }
.orbit-cross { width: 94%; height: 52%; transform: rotate(40deg); }
.logo-tile {
    width: 39%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 34px;
    border: 1px solid #d4dcff55;
    background: linear-gradient(140deg, #ffffff1c, #ffffff05);
    box-shadow: 0 25px 55px #02061555, inset 0 1px 0 #ffffff45;
    transform: rotate(-8deg);
    animation: float-logo 7s ease-in-out infinite;
}
.logo-tile img { width: 94%; height: auto; object-fit: contain; transform: rotate(8deg); filter: drop-shadow(0 8px 20px #efc98b25); }
.star { position: absolute; color: var(--gold); line-height: 1; }
.star-one { top: 14%; right: 22%; font-size: 32px; }
.star-two { bottom: 19%; left: 18%; font-size: 38px; color: #b2cfff; }
.orbit-dot { position: absolute; top: 41%; left: 1%; width: 6px; height: 6px; border-radius: 50%; background: #a0c5ed; box-shadow: 0 0 15px #a0c5ed88; }
.visual-caption { text-align: center; margin-top: 10px; }
.caption-line { display: block; width: 32px; height: 2px; margin: 0 auto 18px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.visual-caption h2 { font-size: 15px; font-weight: 600; color: #dce5f7; margin: 0 0 9px; }
.visual-caption p { font-size: 12px; color: #a6b5cf; margin: 0; }
.form-panel { align-self: center; padding: 46px clamp(28px, 5vw, 70px); min-width: 0; }
.eyebrow { color: var(--gold); font-size: 13px; font-weight: 500; margin: 0 0 10px; }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.5; margin: 0 0 9px; font-weight: 800; letter-spacing: -.7px; }
.form-heading { margin-bottom: 30px; }
.field { display: flex; flex-direction: column; gap: 9px; margin-bottom: 20px; min-width: 0; }
label { font-size: 13px; color: #d6e3f5; font-weight: 500; }
input {
    width: 100%;
    min-width: 0;
    height: 53px;
    padding: 0 15px;
    border: 1px solid #b7c9e22e;
    border-radius: 12px;
    outline: none;
    background: #080f204d;
    color: var(--ink);
    font-size: 13px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: #94a5bf; opacity: 1; }
input:focus { border-color: #efc98b99; background: #0a112580; box-shadow: 0 0 0 3px #eabf7414; }
input:user-invalid { border-color: #f1a1a1; }
.password-field { position: relative; }
.password-field input { padding-left: 45px; }
.password-toggle { position: absolute; left: 3px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: #9dafc9; border: 0; border-radius: 9px; background: transparent; }
.password-toggle:hover, .password-toggle[aria-pressed="true"] { color: var(--gold); }
.password-toggle svg { width: 19px; height: 19px; }
.submit-button { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 54px; margin-top: 8px; border: 1px solid #ffe7ae66; border-radius: 13px; background: linear-gradient(115deg, #e7bc75, #c38c4d); color: #142037; font-weight: 800; font-size: 15px; box-shadow: 0 8px 24px #dba95c20; transition: transform .2s, box-shadow .2s; }
.submit-button span { font-size: 21px; font-weight: 400; }
.submit-button:hover { transform: translateY(-2px); box-shadow: 0 10px 30px #dba95c35; }
.submit-button:active { transform: translateY(0); }
.switch-copy { text-align: center; color: var(--muted); font-size: 13px; margin: 24px 0 0; line-height: 1.9; }
.switch-link { color: var(--gold); font-weight: 600; margin-right: 4px; }
.switch-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field-grid .field { margin-bottom: 16px; }
.field-hint { margin: -4px 0 16px; color: #a6b5cf; font-size: 11px; line-height: 1.8; }
.optional { color: #a6b5cf; font-size: 11px; font-weight: 400; }
.form-status { font-size: 12px; line-height: 1.9; padding: 12px 14px; border: 1px solid #efc98b40; border-radius: 12px; background: #efc98b0a; color: #f0d8b2; margin: 20px 0 0; }
footer { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0; color: #94a5bf; font-size: 11px; }
footer span { color: #efc98b88; }
@keyframes float-logo { 50% { transform: translateY(-10px) rotate(-5deg); } }
@media (max-width: 850px) {
    .auth-card { grid-template-columns: 38% 62%; }
    .form-panel { padding: 36px 28px; }
    .visual-panel { padding: 24px 12px; }
    .visual-caption h2 { font-size: 13px; }
    .visual-caption p { font-size: 11px; }
    .logo-tile { border-radius: 24px; }
}
@media (max-width: 650px) {
    .page { width: min(480px, calc(100% - 32px)); }
    .page-header { min-height: 0; }
    .brand { font-size: 21px; gap: 7px; }
    .brand img { width: 48px; height: 48px; }
    .back-link { font-size: 11px; }
    .auth-card { grid-template-columns: 1fr; min-height: 0; border-radius: 24px; }
    .visual-panel { display: none; }
    .form-panel { padding: 34px 24px; }
    .form-heading { margin-bottom: 26px; }
    .field-grid { grid-template-columns: 1fr; }
    footer { padding: 0; }
}
@media (max-height: 850px) {
    .form-panel { padding-top: 22px; padding-bottom: 22px; }
    .form-heading { margin-bottom: 18px; }
    .field { gap: 6px; margin-bottom: 14px; }
    .field-grid .field { margin-bottom: 12px; }
    .switch-copy { margin-top: 16px; }
    .form-status { margin-top: 10px; padding: 8px 12px; }
}
@media (max-width: 650px) and (max-height: 850px) {
    .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
    .form-panel { padding-inline: 18px; }
    .field-grid input { padding-right: 9px; font-size: 12px; }
}
@media (max-height: 680px) {
    .page { grid-template-rows: 56px minmax(0, 1fr) 28px; }
    .brand img { width: 44px; height: 44px; }
    .form-panel { padding: 14px 20px; }
    .form-heading { margin-bottom: 12px; }
    .eyebrow { margin-bottom: 4px; font-size: 12px; }
    h1 { font-size: 25px; margin-bottom: 4px; }
    input { height: 44px; }
    .password-toggle { top: 0; height: 44px; }
    .field, .field-grid .field { margin-bottom: 10px; gap: 4px; }
    .field-hint { margin-bottom: 8px; }
    .submit-button { min-height: 44px; margin-top: 4px; }
    .switch-copy { margin-top: 10px; font-size: 12px; }
    .visual-caption { margin-top: 0; }
}
@media (max-height: 480px) {
    .page { grid-template-rows: 44px minmax(0, 1fr); padding-bottom: 8px; }
    footer, .eyebrow, .visual-caption { display: none; }
    .brand { font-size: 18px; }
    .brand img { width: 36px; height: 36px; }
    .form-panel { padding: 8px 16px; }
    .form-heading { margin-bottom: 6px; }
    h1 { font-size: 21px; }
    .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .field, .field-grid .field { margin-bottom: 5px; gap: 2px; }
    input { height: 34px; font-size: 12px; }
    .password-toggle { height: 34px; }
    label { font-size: 11px; }
    .field-hint { margin: 0 0 4px; font-size: 10px; }
    .submit-button { min-height: 34px; font-size: 13px; }
    .switch-copy { margin-top: 5px; }
    .form-status { margin-top: 5px; padding: 4px 8px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
