:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --ring: rgba(79, 70, 229, 0.25);
  --alert-bg: #fef2f2;
  --alert-ink: #991b1b;
  --alert-border: #fecaca;
  --status-bg: #ecfdf5;
  --status-ink: #065f46;
  --status-border: #a7f3d0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-header__inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-header__brand {
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  color: var(--muted);
  text-decoration: none;
}

a.app-header__brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.app-header__logout {
  margin: 0;
}

.app-header__logout button {
  margin-top: 0;
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.app-header__logout button:hover {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--border-strong);
}

main {
  max-width: 32rem;
  margin: 2.5rem auto;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

h1 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

h2 {
  margin: 0 0 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

p {
  margin: 0 0 1rem;
  color: var(--ink);
}

p + p {
  margin-top: -0.25rem;
}

main > p {
  color: var(--muted);
}

section {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

section:first-of-type {
  padding-top: 0.25rem;
  border-top: 0;
}

form > * + * {
  margin-top: 0.875rem;
}

label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--ink);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 0.375rem;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
  color: var(--muted);
}

input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

button,
.button {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

button:hover,
.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button:focus-visible,
.button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--ring);
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.875em;
  padding: 0.125rem 0.375rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.25rem;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: var(--surface);
}

[role="alert"],
[role="status"] {
  padding: 0.75rem 1rem;
  margin: 0 0 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
}

[role="alert"] {
  color: var(--alert-ink);
  background: var(--alert-bg);
  border: 1px solid var(--alert-border);
}

[role="status"] {
  color: var(--status-ink);
  background: var(--status-bg);
  border: 1px solid var(--status-border);
}

@media (max-width: 32rem) {
  .app-header__inner {
    padding: 0.75rem 1rem;
  }
  main {
    margin: 1rem;
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-md);
  }
}
