:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --auth-bg: #080912;
  --auth-panel: #11121d;
  --auth-panel-2: #151724;
  --auth-ink: #f8fafc;
  --auth-muted: #9299aa;
  --auth-line: #2a2d3e;
  --auth-purple: #8b5cf6;
  --auth-purple-bright: #9f74ff;
  --auth-green: #35d6a0;
  --auth-red: #fb7185;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--auth-ink);
  background: var(--auth-bg);
  letter-spacing: 0;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.auth-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(380px, 0.92fr) minmax(480px, 1.08fr);
}

.auth-story {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 100dvh;
  padding: 42px clamp(36px, 5vw, 82px);
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 15% 86%, rgba(53, 214, 160, 0.12), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(139, 92, 246, 0.26), transparent 36%),
    #090a13;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-story::after {
  content: "";
  position: absolute;
  right: -180px;
  bottom: -260px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(139, 92, 246, 0.035), 0 0 0 150px rgba(139, 92, 246, 0.025);
}

.auth-brand,
.auth-mobile-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.auth-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(180, 153, 255, 0.5);
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #8b5cf6, #5b21b6);
  box-shadow: 0 14px 34px rgba(91, 33, 182, 0.34);
  font-size: 17px;
  font-weight: 750;
}

.auth-brand strong,
.auth-brand small,
.auth-mobile-brand strong,
.auth-mobile-brand small { display: block; }
.auth-brand strong,
.auth-mobile-brand strong { font-size: 15px; font-weight: 720; }
.auth-brand small,
.auth-mobile-brand small { margin-top: 2px; color: var(--auth-muted); font-size: 11px; }

.auth-story-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding: 72px 0;
}

.auth-story-copy > p {
  margin: 0 0 16px;
  color: var(--auth-purple-bright);
  font-size: 13px;
  font-weight: 700;
}

.auth-story-copy h1 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(2.55rem, 4.4vw, 4.9rem);
  font-weight: 680;
  line-height: 0.98;
}

.auth-story-copy ul {
  display: grid;
  margin: 40px 0 0;
  padding: 0;
  gap: 16px;
  list-style: none;
  color: #d7dbe6;
  font-size: 14px;
}

.auth-story-copy li { display: flex; align-items: center; gap: 11px; }
.auth-story-copy li span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--auth-green);
  box-shadow: 0 0 0 5px rgba(53, 214, 160, 0.1);
}

.auth-story-foot {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #777f91;
  font-size: 12px;
}

.auth-panel {
  display: grid;
  min-height: 100dvh;
  padding: 56px clamp(28px, 6vw, 100px);
  place-items: center;
  background: #0f1019;
}

.auth-panel-inner { width: min(460px, 100%); }
.auth-mobile-brand { display: none; margin-bottom: 52px; }

.auth-heading > span {
  color: var(--auth-purple-bright);
  font-size: 11px;
  font-weight: 740;
  text-transform: uppercase;
}

.auth-heading h1,
.auth-heading h2 {
  margin: 12px 0 0;
  font-size: clamp(2rem, 3.1vw, 2.8rem);
  font-weight: 680;
  line-height: 1.04;
}

.auth-heading p {
  margin: 13px 0 0;
  color: var(--auth-muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-form { display: grid; margin-top: 34px; gap: 10px; }
.auth-field-group { display: grid; gap: 10px; }
.auth-form label { margin-top: 8px; color: #d9dce5; font-size: 12px; font-weight: 620; }

.auth-form input {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid #343748;
  border-radius: 10px;
  outline: none;
  background: #0b0c14;
  color: white;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.auth-form input:hover { background: #0d0f18; }
.auth-form input:focus { border-color: var(--auth-purple); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18); }
.auth-form small { color: #747b8d; font-size: 11px; line-height: 1.5; }

.auth-primary,
.auth-secondary,
.auth-danger {
  display: inline-flex;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  font-weight: 650;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.auth-primary { margin-top: 16px; background: #7c3aed; box-shadow: 0 14px 30px rgba(124, 58, 237, 0.25); }
.auth-primary:hover { background: #8b5cf6; transform: translateY(-1px); }
.auth-primary:disabled { cursor: wait; opacity: 0.58; transform: none; }
.auth-secondary { border-color: #373a4b; background: #181a26; }
.auth-secondary:hover { border-color: #54586c; background: #1c1f2c; }
.auth-danger { border-color: rgba(251, 113, 133, 0.34); color: #fecdd3; background: rgba(251, 113, 133, 0.08); }

.auth-error,
.auth-notice {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.5;
}

.auth-error { border: 1px solid rgba(251, 113, 133, 0.3); color: #fecdd3; background: rgba(251, 113, 133, 0.08); }
.auth-notice { border: 1px solid rgba(53, 214, 160, 0.26); color: #b9f6df; background: rgba(53, 214, 160, 0.07); }

.preview-hint {
  display: grid;
  margin-top: 24px;
  padding: 14px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(139, 92, 246, 0.26);
  border-radius: 10px;
  background: rgba(139, 92, 246, 0.08);
}

.preview-hint strong,
.preview-hint span { display: block; }
.preview-hint strong { font-size: 12px; }
.preview-hint span { margin-top: 3px; color: var(--auth-muted); font-size: 10px; line-height: 1.4; }
.preview-hint button { padding: 8px 10px; border: 1px solid #4b4267; border-radius: 8px; color: white; background: #241b38; font-size: 11px; cursor: pointer; }

.auth-help { margin-top: 28px; padding-top: 22px; border-top: 1px solid #252735; }
.auth-help span { color: #d9dce5; font-size: 12px; font-weight: 650; }
.auth-help p { margin: 5px 0 0; color: #777f91; font-size: 11px; line-height: 1.5; }

.auth-summary {
  display: grid;
  margin: 30px 0 0;
  overflow: hidden;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #0c0d15;
}

.auth-summary-row {
  display: grid;
  min-height: 58px;
  padding: 12px 15px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}
.auth-summary-row + .auth-summary-row { border-top: 1px solid #242735; }
.auth-summary-row span { color: var(--auth-muted); font-size: 11px; }
.auth-summary-row strong { max-width: 260px; overflow: hidden; font-size: 12px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.auth-actions { display: grid; margin-top: 22px; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-actions .auth-primary { margin: 0; }

.auth-state {
  display: grid;
  width: min(500px, 100%);
  justify-items: start;
}
.auth-state-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  place-items: center;
  border: 1px solid rgba(53, 214, 160, 0.35);
  border-radius: 15px;
  color: var(--auth-green);
  background: rgba(53, 214, 160, 0.08);
  font-size: 24px;
  font-weight: 700;
}
.auth-state-icon.error { border-color: rgba(251, 113, 133, 0.35); color: var(--auth-red); background: rgba(251, 113, 133, 0.08); }
.auth-state .auth-primary,
.auth-state .auth-secondary { margin-top: 24px; min-width: 190px; }

.password-rules { display: grid; margin: 5px 0 0; padding: 0; gap: 5px; list-style: none; color: #777f91; font-size: 10px; }
.password-rules li::before { content: "·"; margin-right: 6px; color: var(--auth-purple-bright); }

@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-panel { min-height: 100dvh; padding: calc(26px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); place-items: start center; }
  .auth-panel-inner { width: min(460px, 100%); }
  .auth-mobile-brand { display: inline-flex; margin-bottom: clamp(52px, 12vh, 94px); }
  .auth-heading h1,
  .auth-heading h2 { font-size: 30px; }
  .auth-form { margin-top: 28px; }
  .auth-form input { height: 54px; }
  .auth-primary,
  .auth-secondary,
  .auth-danger { min-height: 52px; }
}

@media (max-width: 460px) {
  .auth-panel { padding-right: 18px; padding-left: 18px; }
  .preview-hint { grid-template-columns: 1fr; }
  .preview-hint button { min-height: 40px; }
  .auth-actions { grid-template-columns: 1fr; }
  .auth-summary-row { align-items: start; grid-template-columns: 1fr; gap: 5px; }
  .auth-summary-row strong { max-width: 100%; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
