:root {
  color-scheme: light;
  --ground: #F5F4F0;
  --surface: #FFFFFF;
  --ink: #17181C;
  --muted: #4A4C55;
  --caption: #6A6C75;
  --line: #E3E1DA;
  --field: #D6D4CC;
  --accent: #2448C9;
  --brand: #101418;
  --error: #B42318;
  --error-bg: #FEF3F2;
  --error-line: #FBD5D1;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 56px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.brand {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: Michroma, Geist, ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  text-decoration: none;
}
.brand img { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px 28px;
  box-shadow: 0 1px 2px rgba(16, 20, 24, 0.04), 0 8px 24px rgba(16, 20, 24, 0.05);
}
@media (max-width: 420px) { .card { padding: 24px 20px 20px; } }

h1 { margin: 0; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.sub { margin: 6px 0 22px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
label { font-weight: 500; font-size: 14px; }
small { color: var(--caption); font-size: 13px; line-height: 1.45; }
input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[aria-invalid="true"] { border-color: var(--error); }

.pw { position: relative; }
.pw input { padding-right: 72px; }
.show {
  position: absolute;
  top: 4px;
  right: 4px;
  height: 40px;
  min-width: 60px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.show:hover { background: #F0EEE8; color: var(--ink); }

.msg:empty { display: none; }
.msg {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--error-line);
  border-radius: 10px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 14px;
}

.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.primary:hover { background: #222831; }
.primary[disabled] { opacity: 0.6; cursor: progress; }

.foot { margin: 16px 0 0; color: var(--caption); font-size: 13px; text-align: center; }
.guest { margin: 0; text-align: center; font-size: 14px; }
