:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e7e3dc;
  --brand: #e8742a;
  --brand-dark: #c85d18;
  --danger: #b42318;
  --ok: #067647;
  --warn: #93370d;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(31, 36, 48, .10), 0 2px 6px rgba(31, 36, 48, .05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(900px 500px at 15% -10%, #fbe2cf 0%, transparent 60%),
    radial-gradient(700px 500px at 110% 110%, #f3e7da 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-dark); }

.auth {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 16px 32px;
}

/* ---------- Brand ---------- */
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo {
  display: block;
  width: 112px; height: 112px;
  margin: 0 auto 14px;
  padding: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px color-mix(in srgb, var(--brand) 35%, #fff), var(--shadow);
  object-fit: contain;
}
.auth-brand h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.auth-brand p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Card ---------- */
.auth-card {
  width: 100%; max-width: 400px;
  padding: 8px 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card.wide { max-width: 560px; }

.tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 16px 0 22px;
  background: var(--bg);
  border-radius: 12px;
}
.tabs a {
  padding: 9px 0;
  border-radius: 9px;
  color: var(--muted);
  text-align: center; text-decoration: none;
  font-size: 14px; font-weight: 600;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(31, 36, 48, .12); }

.auth-card h2 { margin: 0 0 4px; font-size: 18px; }
.auth-card .lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.field .opt { color: var(--muted); font-weight: 400; }
.field .hint { margin-top: 5px; color: var(--muted); font-size: 12px; }
.field .error { margin-top: 5px; color: var(--danger); font-size: 13px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

input[type=text], input[type=email], input[type=tel], input[type=password], textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font: inherit; font-size: 16px;   /* 16px stops iOS zooming in */
}
input:focus, textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-color: var(--brand);
}
.has-error input, .has-error textarea { border-color: var(--danger); }
textarea { min-height: 84px; resize: vertical; }

.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.check {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 11px;
  font-size: 14px; cursor: pointer;
}
.check:has(input:checked) { border-color: var(--brand); background: #fff7f1; }
.check input { accent-color: var(--brand); width: 17px; height: 17px; margin: 0; flex: none; }
.check.plain { padding: 0; border: 0; background: none !important; align-items: flex-start; line-height: 1.4; }
.field label.check { display: flex; margin-bottom: 0; font-size: 14px; font-weight: 400; }
.check.plain input { margin-top: 1px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 18px; }
.row .check.plain { font-size: 14px; color: var(--muted); }

.btn-primary {
  width: 100%;
  padding: 12px 16px;
  border: 0; border-radius: 12px;
  background: var(--brand); color: #fff;
  font: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: var(--brand-dark); }

.switch { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: 14px; }
.switch a { font-weight: 600; }

.section-title { margin: 20px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }

/* Honeypot: hidden from people, bots fill it in */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Messages ---------- */
.msg { padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.msg-error   { background: #fef3f2; color: var(--danger); }
.msg-success { background: #ecfdf3; color: var(--ok); }
.msg-info    { background: #fffaeb; color: var(--warn); }

.done { text-align: center; padding: 8px 0 4px; }
.done .icon {
  width: 56px; height: 56px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #ecfdf3; color: var(--ok);
  font-size: 26px;
}
.done p { color: var(--muted); font-size: 14px; line-height: 1.5; }

.auth-foot { margin: 22px 0 0; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; }

@media (max-width: 520px) {
  .auth { padding-top: 28px; }
  .auth-logo { width: 92px; height: 92px; }
  .auth-card { padding: 4px 18px 22px; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- Privacy page ---------- */
.prose { font-size: 14px; line-height: 1.55; }
.prose h3 { margin: 22px 0 6px; font-size: 15px; }
.prose p, .prose ul { margin: 0 0 8px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 4px; }
.auth-foot a { color: var(--muted); }
