:root {
  --bg: #fbf5f2;
  --card: #ffffff;
  --ink: #2b1b23;
  --muted: #7d6a72;
  --line: #eadfe0;
  --brand: #9b2c50;
  --brand-dark: #7a1f3e;
  --brand-soft: #f7e3ea;
  --green: #1d6b4c;
  --green-soft: #e3f2ea;
  --amber: #b4720f;
  --amber-soft: #fbefd9;
  --red: #b3261e;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(60, 20, 35, .06), 0 8px 24px rgba(60, 20, 35, .07);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 20px; }
.narrow { max-width: 480px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 20px; max-width: 1040px; margin: 0 auto; }
.logo { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--brand-dark); text-decoration: none; }
.logo span { color: var(--ink); font-weight: 500; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); font-size: .85rem; font-weight: 600;
}

/* Forms */
label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=password], textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); outline: none;
}
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 12px 0 0; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.prefix-input { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.prefix-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.prefix-input span { padding: 12px 0 12px 14px; color: var(--muted); white-space: nowrap; font-size: .95rem; }
.prefix-input input { border: 0; box-shadow: none !important; padding-left: 2px; border-radius: 0; }
.error { color: var(--red); font-size: .9rem; margin-top: 10px; min-height: 1.2em; }
.help { color: var(--muted); font-size: .82rem; margin-top: 5px; }

/* Buttons */
.btn {
  appearance: none; border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-block { width: 100%; padding: 15px; font-size: 1.05rem; margin-top: 18px; }
.btn-sm { padding: 6px 11px; font-size: .85rem; border-radius: 10px; }
.btn-danger { color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }

/* Footer credit */
.credit { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px 32px; }
.credit a { color: var(--brand); text-decoration: none; font-weight: 600; }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(43, 27, 35, .45); display: flex; align-items: center;
  justify-content: center; padding: 16px; z-index: 50;
}
.modal { background: #fff; border-radius: var(--radius); max-width: 460px; width: 100%; padding: 24px; max-height: 92vh; overflow: auto; }
.option {
  display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; margin: 8px 0 0; font-weight: 500; cursor: pointer;
}
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.option input { accent-color: var(--brand); width: 18px; height: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: .95rem; z-index: 60; box-shadow: var(--shadow);
}

.offline { background: var(--amber-soft); color: var(--amber); text-align: center; padding: 6px; font-weight: 600; font-size: .9rem; z-index: 40; }
