:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #3f3d56;
  --muted: #7a7891;
  --line: #ebe6f0;
  --accent: #b39ddb;
  --accent-strong: #8a72c0;
  --accent-soft: #ede3f6;
  --danger: #d9607a;
  --danger-soft: #fde2e4;
  --ok: #3f9e7d;
  --ok-soft: #dff5e3;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(63, 61, 86, 0.08), 0 2px 6px rgba(63, 61, 86, 0.05);
  --font-ui: 'Sarabun', system-ui, sans-serif;
  --font-head: 'Kanit', 'Sarabun', system-ui, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

h1,
h2 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.05rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.center {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 15% 20%, #fde2e4 0, transparent 40%),
    radial-gradient(circle at 85% 15%, #dcebfa 0, transparent 40%),
    radial-gradient(circle at 70% 85%, #dff5e3 0, transparent 45%),
    radial-gradient(circle at 20% 90%, #ede3f6 0, transparent 40%),
    var(--bg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: block;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 0.95rem var(--font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.btn.primary:hover {
  background: #7760ad;
}

.btn.ghost {
  background: transparent;
}

.btn.block {
  width: 100%;
}

.btn.sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

/* ---------- messages ---------- */

.msg {
  min-height: 1.6em;
  margin: 12px 0 0;
  font-size: 0.95rem;
}

.msg.error {
  color: var(--danger);
}

.msg.ok {
  color: var(--ok);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: var(--danger);
}
