@font-face {
  font-family: "PeydaAuth";
  src: url("../public/fonts/peyda/Peyda-Regular.woff2") format("woff2"),
    url("../public/fonts/peyda/Peyda-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "PeydaAuth";
  src: url("../public/fonts/peyda/Peyda-Bold.woff2") format("woff2"),
    url("../public/fonts/peyda/Peyda-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "PeydaAuth";
  src: url("../public/fonts/peyda/Peyda-Black.woff2") format("woff2"),
    url("../public/fonts/peyda/Peyda-Black.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --auth-page: #050a16;
  --auth-page-secondary: #07101f;
  --auth-shell: #080f20;
  --auth-panel: #0a1224;
  --auth-card: #10182a;
  --auth-input: #0c1425;
  --auth-widget: #10182d;
  --auth-line: rgba(127, 145, 190, 0.2);
  --auth-line-strong: rgba(139, 156, 205, 0.34);
  --auth-text: #f7f8fc;
  --auth-muted: #98a2b8;
  --auth-soft: #69758f;
  --auth-purple: #7c3aed;
  --auth-purple-bright: #9a55ff;
  --auth-blue: #2987ff;
  --auth-success: #2dd4a8;
  --auth-danger: #fb7185;
  --auth-shadow: rgba(0, 0, 0, 0.34);
}

html[data-theme="light"] {
  color-scheme: light;
  --auth-page: #f5f7fc;
  --auth-page-secondary: #edf2fb;
  --auth-shell: #ffffff;
  --auth-panel: #f8faff;
  --auth-card: #ffffff;
  --auth-input: #f7f9fc;
  --auth-widget: #ffffff;
  --auth-line: #e3e8f2;
  --auth-line-strong: #ccd5e5;
  --auth-text: #101828;
  --auth-muted: #667085;
  --auth-soft: #98a2b3;
  --auth-shadow: rgba(26, 43, 78, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--auth-page);
}

body.AuthPage {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: clamp(12px, 2vw, 24px);
  overflow-x: hidden;
  color: var(--auth-text);
  background:
    radial-gradient(circle at 12% 18%, rgba(124, 58, 237, 0.11), transparent 32rem),
    radial-gradient(circle at 88% 82%, rgba(41, 135, 255, 0.09), transparent 34rem),
    linear-gradient(145deg, var(--auth-page), var(--auth-page-secondary));
  font-family: "PeydaAuth", Tahoma, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.AuthShell {
  width: min(100%, 1540px);
  min-height: calc(100vh - clamp(24px, 4vw, 48px));
  min-height: calc(100svh - clamp(24px, 4vw, 48px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--auth-line);
  border-radius: 26px;
  background: var(--auth-shell);
  box-shadow: 0 24px 70px var(--auth-shadow);
}

.AuthHeader {
  display: flex;
  direction: ltr;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(24px, 3vw, 46px);
  border-bottom: 1px solid var(--auth-line);
  background: color-mix(in srgb, var(--auth-shell) 94%, transparent);
}

.AuthBrand,
.AuthHeader__actions,
.AuthHome,
.AuthTheme {
  display: flex;
  align-items: center;
}

.AuthBrand {
  min-width: 0;
  gap: 12px;
  direction: ltr;
}

.AuthBrand__mark {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(147, 119, 255, 0.24);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.15), rgba(41, 135, 255, 0.1));
}

.AuthBrand__mark img {
  width: 39px;
  height: 39px;
  object-fit: contain;
}

.AuthBrand__copy {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  line-height: 1.2;
}

.AuthBrand__copy strong {
  color: var(--auth-text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.AuthBrand__copy small {
  margin-top: 4px;
  color: var(--auth-muted);
  font-size: 11px;
}

.AuthHeader__actions {
  gap: 10px;
  direction: rtl;
}

.AuthHome,
.AuthTheme {
  min-height: 46px;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  color: var(--auth-muted);
  background: rgba(127, 145, 190, 0.055);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.AuthTheme {
  border: 1px solid var(--auth-line);
}

.AuthHome:hover,
.AuthTheme:hover {
  border-color: rgba(124, 58, 237, 0.5);
  color: var(--auth-text);
  background: rgba(124, 58, 237, 0.09);
  transform: translateY(-1px);
}

.AuthHome:focus-visible,
.AuthTheme:focus-visible,
.AuthPasswordToggle:focus-visible,
.AuthSubmit:focus-visible,
.AuthRegister:focus-visible,
.AuthTerms a:focus-visible,
.AuthRemember input:focus-visible + span {
  outline: 3px solid rgba(41, 135, 255, 0.26);
  outline-offset: 3px;
}

.AuthBody {
  display: grid;
  direction: ltr;
  grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
  grid-template-areas: "visual form";
  min-height: calc(100vh - 130px);
  min-height: calc(100svh - 130px);
}

.AuthVisual {
  position: relative;
  grid-area: visual;
  min-width: 0;
  padding: clamp(34px, 3.3vw, 54px) clamp(34px, 4vw, 64px) 32px;
  overflow: hidden;
  direction: rtl;
  background:
    radial-gradient(circle at 30% 44%, rgba(124, 58, 237, 0.1), transparent 28rem),
    radial-gradient(circle at 77% 71%, rgba(41, 135, 255, 0.07), transparent 23rem),
    var(--auth-panel);
}

.AuthVisual::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(128, 146, 193, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 146, 193, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  content: "";
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 75%, transparent);
  pointer-events: none;
}

.AuthVisual > * {
  position: relative;
  z-index: 2;
}

.AuthVisual__intro {
  max-width: 620px;
  margin-right: auto;
  margin-left: auto;
}

.AuthVisual__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  color: #9b8cff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.AuthVisual__intro h1 {
  margin: 0;
  color: var(--auth-text);
  font-size: clamp(42px, 3.35vw, 54px);
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: -0.035em;
}

.AuthVisual__intro h1 span {
  background: linear-gradient(90deg, var(--auth-purple-bright), var(--auth-blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.AuthVisual__intro p {
  max-width: 560px;
  margin: 14px 0 0;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.95;
}

.AuthExperience {
  position: relative;
  width: min(100%, 650px);
  margin: 28px auto 20px;
  padding: 8px 16px 4px;
}

.AuthEditor {
  position: relative;
  z-index: 3;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(125, 108, 219, 0.32);
  border-radius: 20px;
  background: #090f1d;
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.3), 0 0 42px rgba(91, 68, 196, 0.1);
  transform: perspective(1400px) rotateY(-1.6deg) rotateX(0.5deg);
  transform-origin: center;
}

.AuthEditor__bar {
  display: grid;
  direction: ltr;
  grid-template-columns: 1fr auto 1fr;
  min-height: 50px;
  align-items: center;
  padding: 0 17px;
  border-bottom: 1px solid rgba(128, 146, 193, 0.13);
  background: #0d1424;
}

.AuthEditor__dots {
  display: flex;
  gap: 7px;
}

.AuthEditor__dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fb7185;
}

.AuthEditor__dots i:nth-child(2) { background: #f7c65d; }
.AuthEditor__dots i:nth-child(3) { background: var(--auth-success); }

.AuthEditor__file,
.AuthEditor__tools {
  display: flex;
  align-items: center;
}

.AuthEditor__file {
  gap: 8px;
  color: #cbd5e1;
  font: 600 12px/1.2 "Segoe UI", Arial, sans-serif;
}

.AuthEditor__file i { color: #73b7ff; font-size: 14px; }

.AuthEditor__tools {
  justify-content: flex-end;
  gap: 13px;
  color: #60708c;
  font-size: 12px;
}

.AuthEditor__status {
  display: inline-flex;
  min-width: 65px;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(45, 212, 168, 0.17);
  border-radius: 999px;
  color: #68e3c1;
  background: rgba(45, 212, 168, 0.07);
  font: 700 10px/1 "Segoe UI", Arial, sans-serif;
  transition: color 240ms ease, border-color 240ms ease, background 240ms ease;
}

.AuthEditor__status.is-running {
  border-color: rgba(41, 135, 255, 0.22);
  color: #76b8ff;
  background: rgba(41, 135, 255, 0.08);
}

.AuthEditor__body {
  height: 252px;
  padding: 20px 18px 17px 10px;
  overflow: hidden;
  background:
    linear-gradient(90deg, #0b1221 0 49px, rgba(128, 146, 193, 0.1) 49px 50px, #090f1d 50px);
}

.AuthCode {
  min-height: 100%;
  margin: 0;
  padding: 0 0 0 49px;
  color: #d6deeb;
  font: 500 13px/1.72 Consolas, "SFMono-Regular", monospace;
  white-space: pre;
}

.AuthCode li {
  min-height: 22px;
  padding-left: 10px;
  color: #53627c;
}

.AuthCode li::marker { font-size: 11px; }
.AuthCode li > span { color: #d6deeb; }
.AuthCode .tok-keyword { color: #c792ea; }
.AuthCode .tok-function { color: #82aaff; }
.AuthCode .tok-string { color: #a6e3a1; }
.AuthCode .tok-variable { color: #f0c674; }
.AuthCode .tok-builtin { color: #89ddff; }
.AuthCode .tok-operator { color: #f78c6c; }

.AuthCode__cursor {
  display: inline-block;
  width: 2px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -3px;
  background: #e7eaf2;
  animation: authCursor 900ms steps(1) infinite;
}

.AuthEditor__footer {
  display: flex;
  min-height: 33px;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  border-top: 1px solid rgba(128, 146, 193, 0.1);
  color: #61708a;
  background: #0d1424;
  font: 500 9px/1 "Segoe UI", Arial, sans-serif;
}

.AuthEditor__footer span:first-child { margin-right: auto; color: #8e9cb3; }
.AuthEditor__footer i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--auth-success); box-shadow: 0 0 8px rgba(45, 212, 168, 0.45); }

.AuthTech {
  display: grid;
  position: absolute;
  z-index: 5;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(128, 146, 193, 0.22);
  border-radius: 13px;
  color: #a89aff;
  background: #111a2d;
  box-shadow: 0 11px 28px rgba(0, 0, 0, 0.25);
  font: 800 11px/1 "Segoe UI", Arial, sans-serif;
  animation: authFloat 6.5s ease-in-out infinite;
}

.AuthTech--code { top: 40%; left: -7px; color: #78b8ff; }
.AuthTech--js { top: 12%; right: -6px; animation-delay: -2.1s; }
.AuthTech--ts { right: 7%; bottom: -11px; color: #74b8ff; animation-delay: -4.3s; }

.AuthOrbit {
  position: absolute;
  z-index: 1;
  border: 1px solid rgba(119, 105, 207, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.AuthOrbit::after {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(115, 179, 255, 0.65);
  box-shadow: 0 0 10px rgba(41, 135, 255, 0.36);
  content: "";
}

.AuthOrbit--one { inset: -20px 65px -12px 35px; transform: rotate(-7deg); }
.AuthOrbit--one::after { top: 26%; right: 0; }
.AuthOrbit--two { inset: 28px 4px 21px 98px; transform: rotate(8deg); }
.AuthOrbit--two::after { bottom: 8%; left: 23%; }

.AuthWidgets {
  display: grid;
  width: min(100%, 650px);
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin: 0 auto;
}

.AuthWidget {
  display: grid;
  position: relative;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-height: 102px;
  padding: 15px;
  border: 1px solid var(--auth-line);
  border-radius: 16px;
  background: var(--auth-widget);
  box-shadow: 0 11px 28px rgba(0, 0, 0, 0.09);
}

.AuthWidget__icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(129, 102, 241, 0.22);
  border-radius: 12px;
  color: #a78bfa;
  background: rgba(124, 58, 237, 0.09);
}

.AuthWidget__content { min-width: 0; }
.AuthWidget__heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.AuthWidget strong { color: var(--auth-text); font-size: 12px; font-weight: 800; }
.AuthWidget__heading b { color: #a78bfa; font: 800 12px/1 "Segoe UI", Arial, sans-serif; }
.AuthWidget small { display: block; margin-top: 7px; overflow: hidden; color: var(--auth-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.AuthProgress__track {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(128, 146, 193, 0.13);
}

.AuthProgress__track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--auth-purple), var(--auth-blue));
  box-shadow: 0 0 12px rgba(99, 91, 255, 0.3);
  transition: width 1.2s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.AuthAssistant p {
  min-height: 35px;
  margin: 7px 0 0;
  color: var(--auth-muted);
  font-size: 10.5px;
  line-height: 1.65;
  transition: opacity 240ms ease, transform 240ms ease;
}

.AuthAssistant p.is-changing { opacity: 0; transform: translateY(3px); }
.AuthAssistant__online { position: absolute; top: 15px; left: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--auth-success); box-shadow: 0 0 8px rgba(45, 212, 168, 0.42); }

.AuthCommunity {
  display: grid;
  width: min(100%, 650px);
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  margin: 14px auto 0;
  padding: 9px 13px;
  border: 1px solid var(--auth-line);
  border-radius: 15px;
  background: rgba(127, 145, 190, 0.045);
}

.AuthCommunity__shield { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: var(--auth-success); background: rgba(45, 212, 168, 0.08); }
.AuthCommunity__copy { display: flex; min-width: 0; flex-direction: column; }
.AuthCommunity__copy strong { color: var(--auth-text); font-size: 11px; }
.AuthCommunity__copy small { margin-top: 3px; color: var(--auth-muted); font-size: 9.5px; }
.AuthCommunity__avatars { display: flex; direction: ltr; padding-left: 7px; }
.AuthCommunity__avatars i { display: grid; width: 29px; height: 29px; place-items: center; margin-left: -7px; border: 2px solid var(--auth-panel); border-radius: 50%; color: #d8d4ff; background: #453676; font-size: 9px; font-style: normal; font-weight: 800; }
.AuthCommunity__avatars i:nth-child(2) { background: #24537f; }
.AuthCommunity__avatars i:nth-child(3) { background: #2b665e; }
.AuthCommunity__avatars i:nth-child(4) { color: var(--auth-muted); background: var(--auth-input); }

.AuthFormArea {
  display: flex;
  grid-area: form;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 4vw, 64px);
  border-left: 1px solid var(--auth-line);
  direction: rtl;
  background: var(--auth-shell);
}

.AuthCard {
  width: min(100%, 580px);
  padding: clamp(30px, 3.1vw, 46px);
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background: var(--auth-card);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.16);
}

.AuthCard__brand {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin: 0 auto 16px;
  overflow: hidden;
  border: 1px solid rgba(145, 113, 255, 0.29);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.15), rgba(41, 135, 255, 0.1));
}

.AuthCard__brand img { width: 50px; height: 50px; object-fit: contain; }
.AuthCard__heading { text-align: center; }
.AuthCard__heading h2 { margin: 0; color: var(--auth-text); font-size: clamp(31px, 2.5vw, 38px); font-weight: 900; line-height: 1.35; }
.AuthCard__heading h2 span { font-size: 0.72em; }
.AuthCard__heading p { margin: 8px 0 0; color: var(--auth-muted); font-size: 14px; }

.AuthForm { margin-top: 27px; }
.AuthField + .AuthField { margin-top: 19px; }
.AuthField > label { display: block; margin: 0 2px 8px; color: var(--auth-text); font-size: 13px; font-weight: 700; }

.AuthInput {
  display: flex;
  position: relative;
  min-height: 64px;
  align-items: center;
  border: 1px solid var(--auth-line);
  border-radius: 15px;
  background: var(--auth-input);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.AuthInput:focus-within {
  border-color: rgba(124, 58, 237, 0.78);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.09);
}

.AuthField.is-invalid .AuthInput {
  border-color: rgba(251, 113, 133, 0.62);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.07);
}

.AuthField.is-valid .AuthInput { border-color: rgba(45, 212, 168, 0.34); }

.AuthInput > i {
  position: absolute;
  right: 19px;
  color: #73809a;
  font-size: 16px;
  pointer-events: none;
}

.AuthInput input {
  width: 100%;
  height: 62px;
  padding: 0 51px 0 50px;
  border: 0;
  outline: 0;
  color: var(--auth-text);
  background: transparent;
  caret-color: var(--auth-purple-bright);
  font-size: 14px;
  direction: rtl;
}

.AuthInput input::placeholder { color: var(--auth-soft); opacity: 0.9; }
.AuthInput input:-webkit-autofill { -webkit-text-fill-color: var(--auth-text); transition: background-color 9999s ease-out; }
.AuthInput input[dir="ltr"] { text-align: left; }

.AuthField__hint {
  display: block;
  min-height: 0;
  margin: 0 3px;
  overflow: hidden;
  color: var(--auth-danger);
  font-size: 10px;
  line-height: 0;
  opacity: 0;
  transition: margin 160ms ease, line-height 160ms ease, opacity 160ms ease;
}

.AuthField.is-invalid .AuthField__hint {
  margin-top: 5px;
  line-height: 1.45;
  opacity: 1;
}

.AuthPasswordToggle {
  display: grid;
  position: absolute;
  left: 8px;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 0;
  border-radius: 11px;
  outline: 0;
  color: #73809a;
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.AuthPasswordToggle:hover { color: var(--auth-text); background: rgba(127, 145, 190, 0.08); }

.AuthOptions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 19px 1px 21px;
}

.AuthRemember {
  display: inline-flex;
  position: relative;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: var(--auth-muted);
  cursor: pointer;
}

.AuthRemember input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.AuthRemember > span { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid var(--auth-line-strong); border-radius: 6px; background: var(--auth-input); transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.AuthRemember > span i { color: #fff; font-size: 10px; opacity: 0; transform: scale(0.5); transition: opacity 150ms ease, transform 150ms ease; }
.AuthRemember input:checked + span { border-color: var(--auth-purple); background: var(--auth-purple); box-shadow: 0 4px 13px rgba(124, 58, 237, 0.24); }
.AuthRemember input:checked + span i { opacity: 1; transform: scale(1); }
.AuthRemember b { font-size: 12px; font-weight: 600; }
.AuthOptions > a { min-height: 44px; padding-top: 13px; color: #8d7aff; font-size: 12px; font-weight: 700; transition: color 160ms ease; }
.AuthOptions > a:hover { color: var(--auth-blue); }

.AuthErrors[hidden],
.AuthNotice[hidden] { display: none !important; }
.AuthErrors { margin: -6px 0 17px; }
.AuthNotice { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0 0; padding: 11px 13px; border: 1px solid; border-radius: 12px; font-size: 11.5px; line-height: 1.65; }
.AuthNotice > i { margin-top: 4px; }
.AuthNotice--error { border-color: rgba(251, 113, 133, 0.24); color: #fda4af; background: rgba(251, 113, 133, 0.075); }
.AuthNotice--success { border-color: rgba(45, 212, 168, 0.22); color: #72e6c6; background: rgba(45, 212, 168, 0.07); }
.AuthNotice b { font-family: Consolas, monospace; }

.AuthSubmit {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(90deg, #8b2cf5, #635bff 52%, #2388ff);
  box-shadow: 0 13px 28px rgba(88, 73, 225, 0.2);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.AuthSubmit:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 16px 31px rgba(88, 73, 225, 0.27); }
.AuthSubmit:disabled { opacity: 0.48; cursor: not-allowed; filter: grayscale(0.2); transform: none; box-shadow: none; }

.AuthDivider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 13px; margin: 24px 0 18px; color: var(--auth-soft); font-size: 11px; }
.AuthDivider i { height: 1px; background: var(--auth-line); }

.AuthRegister {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--auth-line);
  border-radius: 14px;
  color: var(--auth-muted);
  background: rgba(127, 145, 190, 0.035);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.AuthRegister i,
.AuthRegister strong { color: #9b7aff; }
.AuthRegister:hover { border-color: rgba(124, 58, 237, 0.42); color: var(--auth-text); background: rgba(124, 58, 237, 0.07); transform: translateY(-1px); }

.AuthSecurity { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; color: var(--auth-soft); font-size: 10.5px; }
.AuthSecurity i { color: var(--auth-success); }

.AuthCard--register {
  width: min(100%, 640px);
  padding: clamp(24px, 2.2vw, 34px);
}

.AuthCard--register .AuthCard__brand {
  width: 56px;
  height: 56px;
  margin-bottom: 10px;
  border-radius: 17px;
}

.AuthCard--register .AuthCard__brand img { width: 44px; height: 44px; }
.AuthCard--register .AuthCard__heading h2 { font-size: clamp(27px, 2.1vw, 33px); }
.AuthCard--register .AuthCard__heading p { margin-top: 5px; font-size: 12.5px; }
.AuthCard--register .AuthForm { margin-top: 19px; }

.AuthRegisterForm__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 12px;
}

.AuthRegisterForm__grid .AuthField + .AuthField { margin-top: 0; }
.AuthCard--register .AuthField > label { margin-bottom: 5px; font-size: 11.5px; }
.AuthCard--register .AuthInput { min-height: 52px; border-radius: 13px; }
.AuthCard--register .AuthInput input { height: 50px; padding-right: 45px; font-size: 12.5px; }
.AuthCard--register .AuthInput > i { right: 16px; font-size: 14px; }
.AuthCard--register .AuthPasswordToggle { left: 4px; width: 42px; height: 42px; }

.AuthTerms {
  width: 100%;
  margin: 13px 1px 12px;
  font-size: 11px;
}

.AuthTerms b { font-size: 11px; font-weight: 500; }
.AuthTerms a { color: #9b7aff; font-weight: 750; }
.AuthTerms a:hover { color: var(--auth-blue); }
.AuthCard--register .AuthSubmit { min-height: 54px; }
.AuthCard--register .AuthDivider { margin: 14px 0 11px; }
.AuthCard--register .AuthRegister { min-height: 50px; }
.AuthCard--register .AuthSecurity { margin-top: 11px; }

.AuthCard--state {
  width: min(100%, 580px);
  padding: clamp(30px, 3vw, 42px);
}

.AuthStateIcon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin: 0 auto 15px;
  border: 1px solid rgba(145, 113, 255, 0.28);
  border-radius: 20px;
  color: #a78bfa;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.15), rgba(41, 135, 255, 0.1));
  font-size: 24px;
}

.AuthStateIcon--success {
  border-color: rgba(45, 212, 168, 0.25);
  color: var(--auth-success);
  background: linear-gradient(145deg, rgba(45, 212, 168, 0.11), rgba(41, 135, 255, 0.08));
}

.AuthCard--state .AuthCard__heading h2 { font-size: clamp(29px, 2.35vw, 36px); }
.AuthCard--state .AuthCard__heading p { max-width: 430px; margin-inline: auto; line-height: 1.75; }
.AuthCard--state .AuthCard__heading b { color: #9b8cff; font-weight: 800; }
.AuthStateForm { margin-top: 24px; }
.AuthStateForm .AuthSubmit { margin-top: 22px; }

.AuthStateForm__passwords {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 17px;
}

.AuthStateForm__passwords .AuthField + .AuthField { margin-top: 0; }
.AuthInput--otp input { text-align: center !important; letter-spacing: 0.55em; font: 700 18px/1 "Segoe UI", Arial, sans-serif; }

.AuthStateHint {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
  padding: 9px 12px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  color: var(--auth-muted);
  background: rgba(127, 145, 190, 0.035);
  font-size: 10.5px;
  text-align: center;
}

.AuthStateHint i { color: #8d7aff; }

.AuthStateLink {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 13px auto;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  color: #9b7aff;
  background: transparent;
  font: 700 12px/1.4 "PeydaAuth", Tahoma, sans-serif;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.AuthStateLink:hover { color: var(--auth-blue); background: rgba(124, 58, 237, 0.06); }
.AuthCard--state .AuthRegister { margin-top: 4px; }

.AuthResend {
  min-height: 52px;
  margin: 14px 0 10px;
  border: 1px solid var(--auth-line);
  border-radius: 13px;
  background: rgba(127, 145, 190, 0.035);
}

.AuthResend__waiting {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--auth-muted);
  font-size: 11px;
}

.AuthResend__waiting i, .AuthResend__waiting b { color: #9b7aff; }
.AuthResend form[hidden], .AuthResend__waiting[hidden] { display: none; }
.AuthResend form .AuthStateLink { width: 100%; min-height: 50px; margin: 0; }

.AuthChoice { display: grid; gap: 13px; margin-top: 27px; }
.AuthChoice .AuthSubmit { min-height: 60px; }
.AuthCard--choice .AuthStateHint { margin-top: 18px; }
.AuthCard--choice .AuthStateLink { margin-bottom: 4px; }

html[data-theme="light"] body.AuthPage {
  background:
    radial-gradient(circle at 13% 16%, rgba(124, 58, 237, 0.09), transparent 31rem),
    radial-gradient(circle at 88% 82%, rgba(41, 135, 255, 0.08), transparent 35rem),
    linear-gradient(145deg, #f5f7fc, #edf2fb);
}

html[data-theme="light"] .AuthVisual {
  background:
    radial-gradient(circle at 30% 44%, rgba(124, 58, 237, 0.09), transparent 28rem),
    radial-gradient(circle at 77% 71%, rgba(41, 135, 255, 0.07), transparent 23rem),
    #f8faff;
}

html[data-theme="light"] .AuthEditor { box-shadow: 0 24px 55px rgba(46, 58, 92, 0.16), 0 0 42px rgba(91, 68, 196, 0.08); }
html[data-theme="light"] .AuthWidget { box-shadow: 0 10px 25px rgba(36, 52, 83, 0.07); }
html[data-theme="light"] .AuthCommunity__avatars i { border-color: #f8faff; }
html[data-theme="light"] .AuthCard { box-shadow: 0 22px 52px rgba(35, 49, 77, 0.1); }
html[data-theme="light"] .AuthNotice--error { color: #c24157; }
html[data-theme="light"] .AuthNotice--success { color: #118466; }

@keyframes authFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes authCursor {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

@media (min-width: 769px) {
  /* Let a form grow when a server-side error is present.  A fixed shell
     clipped the enlarged card and made it appear over the header. */
  body.AuthPage { min-height: 100vh; min-height: 100svh; overflow-y: auto; }
  .AuthShell { height: auto; min-height: calc(100vh - clamp(24px, 4vw, 48px)); min-height: calc(100svh - clamp(24px, 4vw, 48px)); }
  .AuthBody { height: auto; min-height: calc(100vh - 130px); min-height: calc(100svh - 130px); }
  .AuthVisual, .AuthFormArea { min-height: inherit; }
}

@media (max-width: 1199px) {
  .AuthBody { grid-template-columns: minmax(0, 49fr) minmax(0, 51fr); }
  .AuthVisual { padding-inline: 30px; }
  .AuthVisual__intro h1 { font-size: 42px; }
  .AuthExperience { margin-top: 23px; }
  .AuthEditor__body { height: 238px; }
  .AuthCode { font-size: 12px; }
  .AuthFormArea { padding-inline: 34px; }
}

@media (max-width: 960px) {
  .AuthBody { grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); }
  .AuthVisual { padding: 32px 24px 25px; }
  .AuthVisual__intro h1 { font-size: 36px; }
  .AuthVisual__intro p { font-size: 13px; }
  .AuthEditor__body { height: 220px; }
  .AuthWidgets { grid-template-columns: 1fr; }
  .AuthWidget { min-height: 90px; }
  .AuthAssistant { display: none; }
  .AuthCommunity__avatars { display: none; }
  .AuthCommunity { grid-template-columns: 42px 1fr; }
  .AuthTech--js { display: none; }
  .AuthCard { padding: 31px; }
}

@media (max-width: 768px) {
  body.AuthPage { padding: 0; background: var(--auth-shell); }
  .AuthShell { min-height: 100vh; min-height: 100svh; border: 0; border-radius: 0; box-shadow: none; }
  .AuthHeader { min-height: 72px; padding: 0 20px; }
  .AuthBrand__mark { flex-basis: 42px; width: 42px; height: 42px; border-radius: 13px; }
  .AuthBrand__mark img { width: 34px; height: 34px; }
  .AuthBrand__copy small { display: none; }
  .AuthHeader__actions { gap: 7px; }
  .AuthHome, .AuthTheme { min-height: 44px; padding: 0 12px; }
  .AuthTheme span { display: none; }
  .AuthBody { display: block; min-height: calc(100svh - 72px); }
  .AuthVisual { display: none; }
  .AuthFormArea { min-height: calc(100svh - 72px); padding: 24px 20px 34px; border-left: 0; }
  .AuthCard { width: 100%; max-width: 590px; padding: 30px 24px; }
  .AuthCard__heading h2 { font-size: 32px; }
  .AuthRegisterForm__grid { grid-template-columns: 1fr; }
  .AuthCard--register { max-width: 590px; }
  .AuthCard--register .AuthInput { min-height: 58px; }
  .AuthCard--register .AuthInput input { height: 56px; }
  .AuthStateForm__passwords { grid-template-columns: 1fr; }
  .AuthCard--state { max-width: 590px; }
}

/* iPad portrait: keep the form close to the header instead of centering it in
   the full remaining viewport height. */
@media (min-width: 600px) and (max-width: 768px) {
  .AuthFormArea {
    align-items: flex-start;
    padding-top: 16px;
  }
}

@media (max-width: 480px) {
  .AuthHeader { padding-inline: 15px; }
  .AuthBrand { gap: 8px; }
  .AuthBrand__copy strong { font-size: 15px; }
  .AuthHome span { display: none; }
  .AuthHome, .AuthTheme { width: 44px; padding: 0; }
  .AuthFormArea { align-items: flex-start; padding: 20px 14px 28px; }
  .AuthCard { padding: 25px 18px; border-radius: 20px; }
  .AuthCard__brand { width: 58px; height: 58px; margin-bottom: 12px; border-radius: 18px; }
  .AuthCard__heading h2 { font-size: 29px; }
  .AuthCard__heading p { font-size: 13px; }
  .AuthForm { margin-top: 23px; }
  .AuthInput { min-height: 60px; }
  .AuthInput input { height: 58px; }
  .AuthOptions { align-items: flex-start; gap: 7px; }
  .AuthRemember b, .AuthOptions > a { font-size: 11px; }
  .AuthRemember { gap: 7px; }
  .AuthSubmit { min-height: 59px; }
  .AuthCard--register { padding: 23px 18px; }
  .AuthCard--register .AuthCard__brand { width: 52px; height: 52px; margin-bottom: 8px; }
  .AuthCard--register .AuthForm { margin-top: 17px; }
  .AuthRegisterForm__grid { gap: 12px; }
  .AuthCard--register .AuthField > label { font-size: 12px; }
  .AuthTerms { margin-block: 12px 10px; }
  .AuthCard--state { padding: 25px 18px; }
  .AuthStateIcon { width: 56px; height: 56px; margin-bottom: 11px; border-radius: 17px; font-size: 21px; }
  .AuthCard--state .AuthCard__heading h2 { font-size: 28px; }
  .AuthStateForm { margin-top: 20px; }
}

@media (min-width: 769px) and (max-height: 900px) {
  .AuthHeader { min-height: 68px; }
  .AuthBody { height: auto; min-height: calc(100vh - 118px); min-height: calc(100svh - 118px); }
  .AuthVisual { padding: 22px 32px 18px; }
  .AuthVisual__eyebrow { margin-bottom: 8px; }
  .AuthVisual__intro h1 { font-size: clamp(32px, 3vw, 42px); line-height: 1.2; }
  .AuthVisual__intro p { margin-top: 8px; font-size: 12.5px; line-height: 1.7; }
  .AuthExperience { margin: 12px auto 9px; }
  .AuthEditor__body { height: 180px; padding-block: 13px; }
  .AuthEditor__bar { min-height: 43px; }
  .AuthEditor__footer { min-height: 28px; }
  .AuthWidget { min-height: 76px; padding: 11px; }
  .AuthWidget__icon { width: 34px; height: 34px; }
  .AuthCommunity { min-height: 50px; margin-top: 9px; padding-block: 5px; }
  .AuthCommunity__shield { width: 34px; height: 34px; }
  .AuthFormArea { padding: 10px clamp(20px, 3vw, 42px); }
  .AuthCard { padding: 22px 30px; }
  .AuthCard__brand { width: 50px; height: 50px; margin-bottom: 8px; border-radius: 16px; }
  .AuthCard__brand img { width: 40px; height: 40px; }
  .AuthCard__heading h2 { font-size: 29px; }
  .AuthCard__heading p { margin-top: 4px; font-size: 12.5px; }
  .AuthForm { margin-top: 16px; }
  .AuthField + .AuthField { margin-top: 11px; }
  .AuthField > label { margin-bottom: 5px; font-size: 11.5px; }
  .AuthInput { min-height: 52px; }
  .AuthInput input { height: 50px; }
  .AuthOptions { margin: 8px 1px 10px; }
  .AuthSubmit { min-height: 52px; }
  .AuthDivider { margin: 13px 0 10px; }
  .AuthRegister { min-height: 48px; }
  .AuthSecurity { margin-top: 9px; }
  .AuthCard--register { padding: 17px 25px; }
  .AuthCard--register .AuthCard__brand { width: 45px; height: 45px; margin-bottom: 5px; }
  .AuthCard--register .AuthCard__brand img { width: 36px; height: 36px; }
  .AuthCard--register .AuthCard__heading h2 { font-size: 25px; }
  .AuthCard--register .AuthForm { margin-top: 12px; }
  .AuthRegisterForm__grid { gap: 9px 11px; }
  .AuthCard--register .AuthInput { min-height: 46px; }
  .AuthCard--register .AuthInput input { height: 44px; }
  .AuthTerms { min-height: 36px; margin-block: 7px 6px; }
  .AuthCard--register .AuthSubmit { min-height: 48px; }
  .AuthCard--register .AuthDivider { margin: 9px 0 7px; }
  .AuthCard--register .AuthRegister { min-height: 44px; }
  .AuthCard--register .AuthSecurity { margin-top: 6px; }
  .AuthCard--state { padding: 24px 30px; }
  .AuthStateIcon { width: 50px; height: 50px; margin-bottom: 8px; border-radius: 16px; font-size: 19px; }
  .AuthCard--state .AuthCard__heading h2 { font-size: 27px; }
  .AuthStateForm { margin-top: 15px; }
  .AuthStateForm .AuthSubmit { margin-top: 14px; }
  .AuthStateForm__passwords { margin-top: 11px; }
  .AuthStateHint { min-height: 42px; margin: 10px 0; }
  .AuthResend { min-height: 46px; margin-block: 10px 7px; }
  .AuthResend__waiting, .AuthResend form .AuthStateLink { min-height: 44px; }
  .AuthChoice { margin-top: 18px; }
}

@media (min-width: 769px) and (max-height: 740px) {
  .AuthVisual__eyebrow, .AuthVisual__intro p, .AuthCommunity { display: none; }
  .AuthExperience { margin-top: 8px; }
  .AuthEditor__body { height: 155px; }
  .AuthWidgets { margin-top: 6px; }
  .AuthCard__brand { display: none; }
  .AuthCard--register .AuthSecurity { display: none; }
  .AuthCard--state .AuthSecurity { display: none; }
}

@media (max-width: 360px) {
  .AuthCard { padding-inline: 14px; }
  .AuthOptions { align-items: stretch; flex-direction: column; margin-bottom: 17px; }
  .AuthOptions > a { padding-top: 4px; }
}

@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;
  }

  .AuthEditor { transform: none; }
}

/* Viewport-fitting auth screens.  The form itself remains a normal document
   flow card; compact controls at short heights keep it inside the shell. */
@media (min-width: 769px) {
  body.AuthPage { height: 100vh; height: 100svh; overflow: hidden; }
  .AuthShell { height: calc(100vh - clamp(24px, 4vw, 48px)); height: calc(100svh - clamp(24px, 4vw, 48px)); min-height: 0; }
  .AuthBody { height: calc(100% - 80px); min-height: 0; }
  .AuthVisual, .AuthFormArea { min-height: 0; }
}

@media (max-width: 768px) {
  body.AuthPage { height: 100vh; height: 100svh; overflow: hidden; }
  .AuthShell { height: 100vh; height: 100svh; min-height: 0; }
  .AuthBody { height: calc(100vh - 72px); height: calc(100svh - 72px); min-height: 0; }
  .AuthFormArea { display: flex; min-height: 0; height: 100%; padding: clamp(10px, 2.5vh, 20px) clamp(12px, 3vw, 20px); }
  .AuthCard { max-height: 100%; }
  .AuthCard--register { width: min(100%, 640px); }
  .AuthRegisterForm__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
  .AuthHeader { min-height: 64px; }
  .AuthBody { height: calc(100vh - 64px); height: calc(100svh - 64px); }
  .AuthFormArea { padding: 10px 12px; align-items: center; }
  .AuthCard { padding: 18px 16px; border-radius: 18px; }
  .AuthCard__brand { width: 46px; height: 46px; margin-bottom: 7px; border-radius: 14px; }
  .AuthCard__brand img { width: 36px; height: 36px; }
  .AuthCard__heading h2 { font-size: clamp(22px, 7vw, 28px); }
  .AuthCard__heading p { margin-top: 3px; font-size: 11.5px; }
  .AuthForm { margin-top: 12px; }
  .AuthField + .AuthField { margin-top: 9px; }
  .AuthField > label { margin-bottom: 4px; font-size: 11px; }
  .AuthInput { min-height: 46px; border-radius: 12px; }
  .AuthInput input { height: 44px; padding-right: 41px; font-size: 12px; }
  .AuthInput > i { right: 14px; font-size: 13px; }
  .AuthOptions { margin: 7px 0 8px; }
  .AuthSubmit { min-height: 46px; font-size: 12px; }
  .AuthDivider { margin: 9px 0 7px; }
  .AuthRegister { min-height: 42px; font-size: 11px; }
  .AuthSecurity { margin-top: 6px; font-size: 9px; }
  .AuthNotice { margin-top: 9px; padding: 8px 10px; font-size: 10px; }
  .AuthErrors { margin: -2px 0 8px; }
  .AuthCard--register { padding: 14px 12px; }
  .AuthCard--register .AuthCard__brand { width: 40px; height: 40px; margin-bottom: 4px; }
  .AuthCard--register .AuthCard__brand img { width: 32px; height: 32px; }
  .AuthCard--register .AuthCard__heading h2 { font-size: clamp(20px, 6.4vw, 25px); }
  .AuthCard--register .AuthForm { margin-top: 9px; }
  .AuthRegisterForm__grid { gap: 8px; }
  .AuthCard--register .AuthField > label { margin-bottom: 3px; font-size: 10px; }
  .AuthCard--register .AuthInput { min-height: 42px; }
  .AuthCard--register .AuthInput input { height: 40px; font-size: 10.5px; }
  .AuthTerms { min-height: 0; margin: 7px 0; font-size: 9px; }
  .AuthTerms b { font-size: 9px; }
  .AuthCard--register .AuthSubmit { min-height: 42px; }
  .AuthCard--register .AuthDivider { margin: 7px 0 5px; }
  .AuthCard--register .AuthRegister { min-height: 38px; }
  .AuthCard--register .AuthSecurity { display: none; }
  .AuthCard--state { padding: 18px 16px; }
  .AuthStateIcon { width: 44px; height: 44px; margin-bottom: 6px; font-size: 17px; }
  .AuthCard--state .AuthCard__heading h2 { font-size: clamp(21px, 6.8vw, 27px); }
  .AuthStateForm { margin-top: 12px; }
  .AuthStateForm .AuthSubmit { margin-top: 12px; }
  .AuthStateHint { min-height: 0; margin: 8px 0; padding: 8px; font-size: 10px; }
}

@media (max-height: 620px) {
  .AuthHeader { min-height: 56px; }
  .AuthBody { height: calc(100vh - 56px); height: calc(100svh - 56px); }
  .AuthCard__brand,
  .AuthSecurity { display: none; }
  .AuthCard { padding-block: 12px; }
  .AuthCard__heading p { display: none; }
  .AuthForm { margin-top: 8px; }
  .AuthField + .AuthField { margin-top: 6px; }
  .AuthOptions { margin-block: 5px; }
  .AuthDivider { margin-block: 5px; }
  .AuthCard--register .AuthForm { margin-top: 6px; }
  .AuthCard--state .AuthStateIcon { display: none; }
  .AuthStateHint { margin-block: 5px; }
}

/* Tablet auth layout: dedicate the viewport to the form instead of squeezing
   it beside the decorative visual panel. */
@media (min-width:769px) and (max-width:992px) {
  body.AuthPage { padding:16px; overflow:hidden; }
  .AuthShell { height:calc(100vh - 32px); height:calc(100svh - 32px); min-height:0; border-radius:22px; }
  .AuthHeader { min-height:76px; padding-inline:clamp(22px,4vw,36px); }
  .AuthBody { display:block; height:calc(100% - 76px); min-height:0; }
  .AuthVisual { display:none; }
  .AuthFormArea {
    width:100%;
    height:100%;
    min-height:0;
    padding:clamp(18px,3vh,32px) clamp(28px,7vw,68px);
    border-left:0;
  }
  .AuthCard { width:min(82vw,640px); padding:clamp(26px,3.4vw,36px); }
  .AuthCard--register { width:min(90vw,760px); max-width:760px; padding:clamp(20px,2.8vw,30px); }
  .AuthCard--state { width:min(82vw,640px); max-width:640px; }
  .AuthRegisterForm__grid { gap:13px 16px; }
  .AuthForm { margin-top:20px; }
  .AuthInput { min-height:55px; }
  .AuthInput input { height:53px; }
  .AuthCard--register .AuthInput { min-height:50px; }
  .AuthCard--register .AuthInput input { height:48px; }
}
