:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1b2130;
  --muted: #5b6475;
  --border: #d5dae4;
  --accent: #2357d9;
  --accent-text: #ffffff;
  --accent-hover: #1b47b8;
  --focus: rgba(35, 87, 217, 0.35);
  --error: #b42318;
  --error-bg: #fdecea;
  --ok: #157f3c;
  --ok-bg: #e5f5eb;
  --warn: #a15c07;
  --warn-bg: #fdf1dc;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131b;
    --card: #181e29;
    --text: #e8ebf2;
    --muted: #a1a9b8;
    --border: #2f3747;
    --accent: #6f95ff;
    --accent-text: #0f131b;
    --accent-hover: #8eabff;
    --focus: rgba(111, 149, 255, 0.4);
    --error: #ff8a80;
    --error-bg: #3a1d1c;
    --ok: #6fd394;
    --ok-bg: #16301f;
    --warn: #f3b562;
    --warn-bg: #352812;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

@media (min-height: 640px) { body { align-items: center; } }

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  font-weight: 700;
  font-size: 18px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
}

h1 { font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
h1:focus { outline: none; }
.lead { margin: 0 0 20px; color: var(--muted); }
.note { margin: 0; color: var(--muted); font-size: 14px; }

.field { margin-bottom: 16px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }

input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
input[aria-invalid="true"] { border-color: var(--error); }

.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 14px;
}

button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.primary {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled { opacity: 0.65; cursor: progress; }

.link-button {
  border: 0;
  padding: 4px 0;
  background: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 700;
}

.icon-ok { background: var(--ok-bg); color: var(--ok); }
.icon-warn { background: var(--warn-bg); color: var(--warn); }
