@font-face {
  font-family: Vazirmatn;
  src: url('/static/fonts/Vazirmatn[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #19172f;
  --muted: #625f72;
  --faint: #8a8798;
  --line: #e3e2e9;
  --line-strong: #cfccd9;
  --surface: #ffffff;
  --surface-alt: #f4f3f8;
  --canvas: #faf9fc;
  --brand: #5b4fe9;
  --brand-strong: #4338ca;
  --brand-soft: #eeedff;
  --danger: #ae3932;
  --danger-soft: #fae6e3;
  --success: #137c69;
  --success-soft: #e3f5f1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  min-width: 320px;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(91, 79, 233, .07), transparent 28%),
    radial-gradient(circle at 88% 92%, rgba(19, 124, 105, .05), transparent 25%),
    var(--canvas);
  font-family: Vazirmatn, Tahoma, sans-serif;
  line-height: 1.75;
  letter-spacing: 0;
}

button,
input { font: inherit; letter-spacing: 0; }
button,
a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #9d94ff; outline-offset: 3px; }
.emoji { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }

.auth-layout {
  width: min(100%, 1030px);
  min-height: min(680px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(320px, .82fr) minmax(430px, 1fr);
  gap: 14px;
  margin: auto;
}

.auth-layout-wide {
  width: min(100%, 1160px);
  grid-template-columns: minmax(340px, .78fr) minmax(600px, 1.22fr);
}

.auth-aside,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 32px;
}

.auth-aside {
  min-height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 30px;
  background: linear-gradient(145deg, #efeeff 0%, #f7f6ff 58%, #eceaff 100%);
}

.auth-aside::before,
.auth-aside::after {
  position: absolute;
  border: 1px solid rgba(91, 79, 233, .12);
  border-radius: 50%;
  content: "";
}

.auth-aside::before { width: 250px; height: 250px; inset: -135px -105px auto auto; }
.auth-aside::after { width: 190px; height: 190px; inset: auto auto -105px -75px; }

.auth-brand,
.auth-aside-copy,
.auth-home { position: relative; z-index: 1; }

.auth-brand a {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.auth-brand a > span:last-child { display: grid; line-height: 1.35; }
.auth-brand strong { font-size: 1.08rem; font-weight: 900; }
.auth-brand small { margin-top: -1px; color: var(--muted); font-size: .72rem; }

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 9px 22px rgba(67, 56, 202, .14);
}
.brand-logo {
  display: block; width: 100%; height: 100%; background: var(--brand);
  -webkit-mask: url("./brand-logo.png?v=20260817-brand-color-v2") center / contain no-repeat;
  mask: url("./brand-logo.png?v=20260817-brand-color-v2") center / contain no-repeat;
}

.auth-aside-copy { max-width: 420px; }
.auth-hero-emoji { display: block; width: fit-content; font-size: 4.5rem; line-height: 1.15; }

.auth-kicker {
  width: fit-content;
  margin: 17px 0 0;
  padding: 4px 10px;
  border: 1px solid rgba(91, 79, 233, .12);
  border-radius: 999px;
  color: var(--brand-strong);
  background: rgba(255, 255, 255, .62);
  font-size: .75rem;
  font-weight: 850;
}

.auth-aside-copy h2 {
  margin: 13px 0 0;
  color: var(--ink);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 900;
  line-height: 1.48;
  letter-spacing: -.035em;
}

.auth-aside-copy > p:not(.auth-kicker) {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.95;
}

.auth-promises {
  display: grid;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.auth-promises li {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid rgba(91, 79, 233, .1);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .58);
  font-size: .79rem;
  font-weight: 750;
}

.auth-promises li > span {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: .7rem;
  font-weight: 900;
}

.auth-steps { counter-reset: none; }
.auth-home {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}
.auth-home:hover { color: var(--brand-strong); }

.auth-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4vw, 48px);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 20px 55px rgba(38, 31, 79, .08);
}

.auth-heading { margin-bottom: 25px; }
.auth-heading p { margin: 0 0 6px; color: var(--brand-strong); font-size: .78rem; font-weight: 850; }
.auth-heading h1 { margin: 0; color: var(--ink); font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 900; line-height: 1.45; letter-spacing: -.03em; }
.auth-heading span { display: block; margin-top: 7px; color: var(--muted); font-size: .87rem; line-height: 1.85; }

form { display: grid; gap: 17px; }
.field { min-width: 0; display: grid; align-content: start; gap: 7px; }
.signup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { color: var(--ink); font-size: .8rem; font-weight: 800; }

input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  caret-color: var(--brand);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input::placeholder { color: #aaa7b5; opacity: 1; }
input:hover { border-color: #aaa5c7; }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91, 79, 233, .11); }
input:user-invalid:not(:focus) { border-color: color-mix(in srgb, var(--danger) 55%, var(--line-strong)); }

.password-control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  direction: ltr;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.password-control:hover { border-color: #aaa5c7; }
.password-control:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91, 79, 233, .11); }
.password-control input { min-height: 48px; border: 0; border-radius: 0; box-shadow: none; }
.password-control input:focus { border: 0; box-shadow: none; }
.password-control button {
  min-width: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--brand-strong);
  background: var(--surface-alt);
  cursor: pointer;
}
.password-control button:hover { background: var(--brand-soft); }

.password-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle [data-password-icon="hide"],
.password-toggle[aria-pressed="true"] [data-password-icon="show"] { display: none; }
.password-toggle[aria-pressed="true"] [data-password-icon="hide"] { display: block; }

.primary-action {
  min-height: 50px;
  margin-top: 2px;
  padding: 9px 16px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #665df3, #5047dc);
  box-shadow: 0 10px 24px rgba(79, 70, 229, .2);
  cursor: pointer;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.primary-action:hover { background: linear-gradient(135deg, #5a51e8, #453bc8); box-shadow: 0 13px 28px rgba(79, 70, 229, .25); transform: translateY(-1px); }
.primary-action:disabled { opacity: .62; cursor: wait; transform: none; }

.recovery-link { justify-self: start; padding: 3px 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: .78rem; }
.recovery-link:hover { color: var(--brand-strong); }
.field-hint { min-height: 20px; margin: 0; color: var(--faint); font-size: .72rem; }
.field-hint[data-valid="true"] { color: var(--success); }

.signup-consent { margin: 1px 2px 0; color: var(--faint); font-size: .72rem; line-height: 1.9; }
.signup-consent a { color: var(--brand-strong); font-weight: 750; text-underline-offset: 3px; }

.signup-availability {
  margin: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: var(--surface-alt);
  font-size: .78rem;
}

.auth-feedback {
  margin: 0 0 16px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-inline-start: 3px solid var(--danger);
  border-radius: 12px;
  color: #842e28;
  background: var(--danger-soft);
  font-size: .78rem;
}
.auth-feedback[data-kind="success"] { border-color: color-mix(in srgb, var(--success) 30%, var(--line)); border-inline-start-color: var(--success); color: var(--success); background: var(--success-soft); }

.auth-switch {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: .82rem;
}
.auth-switch span { margin-inline-end: 4px; }
.auth-switch a { color: var(--brand-strong); font-weight: 850; text-underline-offset: 3px; }

.workspace-chooser h2 { margin: 0 0 12px; font-size: 1.12rem; }
#workspace-options { display: grid; gap: 8px; }
#workspace-options button { min-height: 50px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface); text-align: right; cursor: pointer; }
#workspace-options button:hover { border-color: var(--brand); background: var(--brand-soft); }

@media (max-width: 960px) {
  body { place-items: start center; }
  .auth-layout,
  .auth-layout-wide { width: min(100%, 690px); grid-template-columns: 1fr; }
  .auth-aside { min-height: 330px; }
  .auth-aside-copy { max-width: 560px; }
  .auth-promises { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-promises li { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  body { padding: 11px; }
  .auth-layout,
  .auth-layout-wide { min-height: calc(100vh - 22px); gap: 10px; }
  .auth-aside,
  .auth-panel { border-radius: 24px; }
  .auth-aside { min-height: 245px; gap: 20px; padding: 21px; }
  .auth-brand small { display: none; }
  .auth-hero-emoji { font-size: 3.3rem; }
  .auth-kicker { margin-top: 10px; }
  .auth-aside-copy h2 { margin-top: 9px; font-size: 1.55rem; }
  .auth-aside-copy > p:not(.auth-kicker) { margin-top: 7px; font-size: .82rem; }
  .auth-promises { display: none; }
  .auth-home { font-size: .72rem; }
  .auth-panel { padding: 25px 18px; }
  .auth-heading { margin-bottom: 21px; }
  .auth-heading h1 { font-size: 1.65rem; }
  .signup-grid { grid-template-columns: 1fr; gap: 16px; }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-aside { animation: auth-aside-in .35s ease-out; }
  .auth-panel { animation: auth-panel-in .35s .05s ease-out backwards; }
  @keyframes auth-aside-in { from { opacity: 0; transform: translateX(8px); } }
  @keyframes auth-panel-in { from { opacity: 0; transform: translateY(8px); } }
}

@media (forced-colors: active) {
  .brand-mark,
  .primary-action,
  .auth-promises li > span { border: 1px solid currentColor; }
}
