:root {
  color: #23213d;
  background: #f5f4fa;
  --accent: #57418d;
  --accent-hover: #493478;
  --line: #e6e1ef;
  font: 16px/1.5 system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at 16% 10%, #e9e0f5, transparent 55%),
              radial-gradient(ellipse at 88% 87%, #e5edf7, transparent 55%);
}

main {
  width: min(100%, 410px);
  padding: clamp(22px, 6vw, 38px);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #fff;
  box-shadow: 0 22px 54px #30204b16;
}

.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(155deg, #7959b2, #503980);
  box-shadow: 0 5px 11px #50398029;
}

h1 {
  margin: 0;
  font-size: clamp(21px, 5vw, 28px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

form { display: grid; }
label { font-size: .875rem; font-weight: 650; margin-bottom: 5px; }

input, button {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  transition: background-color .17s, box-shadow .17s, border-color .17s, transform .13s;
}

input {
  margin-bottom: 16px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: inherit;
  background: #f8f7fb;
}

button {
  margin-top: 4px;
  border: 0;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

button:focus, input:focus { outline: none; }
button:focus-visible { box-shadow: inset 0 0 0 2px #e1d5ff; background: var(--accent-hover); }
input:focus { border-color: #9782c4; background: white; box-shadow: inset 0 0 0 1px #9782c4; }
@media (hover: hover) {
  button:hover { background: var(--accent-hover); }
  input:hover { border-color: #c3b4df; }
}
button:active { background: #3b2865; transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { input, button { transition: none; } }
.error { color: #9a3046; margin: 12px 0 0; font-size: .875rem; }
.error:empty { display: none; }
