:root {
  color-scheme: dark;
  font: 16px/1.55 system-ui, sans-serif;
  --night: #150d26;
  --ink: #fff7fb;
  --muted: #c8bbd8;
  --amber: #ffdb9c;
  --edge: #f0d9ff35;
  --surface: #2b203deb;
  --glass: linear-gradient(155deg, #4a3650b8 0%, #30213bbf 48%, #1e152ad9 100%);
  --control: linear-gradient(155deg, #f4d3ff1a, #ae88c014 47%, #1009186b);
  --shine: inset 0 1px 0 #fff1ff2e, inset 0 -1px 0 #f0bfff0c;
  --shadow: 0 14px 40px #09041340;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--night); }
body {
  display: flow-root;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 82% 3%, #87523c72, transparent 39rem),
    radial-gradient(ellipse at 9% 30%, #6648907d, transparent 39rem),
    radial-gradient(ellipse at 88% 93%, #4f2f6a78, transparent 44rem),
    linear-gradient(145deg, #1d1335, #140d25 60%, #201334);
}

a { color: var(--amber); text-underline-offset: .28em; }
small, .muted { color: var(--muted); }
h1, h2, h3 { line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 6vw, 4.25rem); letter-spacing: -.06em; }
h2 { font-size: 1.35rem; letter-spacing: -.025em; }
h3 { font-size: 1.05rem; letter-spacing: -.01em; }

.glass {
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: 24px;
  box-shadow: var(--shine), var(--shadow);
  backdrop-filter: blur(18px) saturate(142%);
}
.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.13rem;
  font-weight: 760;
  letter-spacing: -.025em;
}
.brand img {
  width: 43px;
  height: 43px;
  flex: none;
  border: 1px solid #ecc99d50;
  border-radius: 13px;
  box-shadow: 0 6px 15px #08031160;
}
.brand small { font-size: .86rem; }
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  width: min(100%, 945px);
  margin: clamp(32px, 9vh, 112px) auto 0;
  min-height: 420px;
  padding: 10px;
  gap: 10px;
}
.auth-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 17px;
  background: radial-gradient(ellipse at 40% 35%, #4f2a70, #211039 73%);
  box-shadow: inset 0 0 0 1px #dcbafa2b;
}
.auth-art img {
  display: block;
  width: min(90%, 430px);
  height: auto;
  margin: auto;
  mask-image:
    linear-gradient(to right, transparent, #000 13% 87%, transparent),
    linear-gradient(to bottom, transparent, #000 14% 86%, transparent);
  mask-composite: intersect;
}
.auth-form { align-self: center; padding: clamp(14px, 4vw, 46px); min-width: 0; }
.auth-form h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3.05rem); }
.auth-form p { color: var(--muted); margin: 0 0 24px; }
.auth-form bdi { overflow-wrap: anywhere; }
.auth-form #auth-error { color: #ffc0bf; }

label { display: grid; min-width: 0; gap: 6px; font-weight: 650; font-size: .84rem; color: var(--muted); }
button, input, select, textarea { font: inherit; color: var(--ink); }
button, input, select, textarea {
  border: 1px solid var(--edge);
  background: var(--control);
  border-radius: 12px;
  padding: 9px 13px;
  min-width: 0;
  min-height: 41px;
  box-shadow: var(--shine);
}
input, select, textarea { width: 100%; font-size: .94rem; }
select option { background: #2e203e; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #c9bbd2; opacity: .76; }
textarea { resize: vertical; }
button {
  cursor: pointer;
  font-weight: 670;
  border-radius: 100vmax;
  padding-inline: 16px;
  font-size: .91rem;
}
button:hover:not(:disabled) { border-color: #f5dba380; background-color: #ffdfa21a; }
button:disabled { opacity: .55; cursor: default; }
button.primary, .button-primary {
  color: #2e1a1a;
  border-color: #fff2d09c;
  background: linear-gradient(165deg, #fff0cf 2%, #fbd397 46%, #eaa761 100%);
  box-shadow: inset 0 1px 1px #fff9ea, 0 5px 16px #d77f393b;
}
button.primary:hover:not(:disabled) { background: linear-gradient(165deg, #fff8e5, #ffdca5 60%, #efb17a); }
:focus-visible { outline: 2px solid #ffdd9f; outline-offset: 3px; }
[hidden] { display: none !important; }

@media (max-width: 640px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; margin-top: 28px; }
  .auth-art img { width: min(69%, 235px); margin: 8px auto; }
  .auth-form { padding: 16px 14px 20px; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--surface); backdrop-filter: none; }
}
