:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --ink: #23264a;
  --muted: #5d6185;
  --accent: #6c5fc7;
  --accent-ink: #ffffff;
  --soft: #eeeafb;
  --line: #e2ddd3;
  --error: #b3261e;
  --ok: #1e6b46;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15172e;
    --surface: #1e2140;
    --ink: #ecebf7;
    --muted: #a9abc9;
    --accent: #a99cf2;
    --accent-ink: #15172e;
    --soft: #2a2d55;
    --line: #34386a;
    --error: #ff8a80;
    --ok: #7fd6a8;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin: 0 0 .6em; }
a { color: var(--accent); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; flex-wrap: wrap; }
.brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
nav ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
nav a:hover, nav a[aria-current="page"] { color: var(--ink); }

/* Buttons */
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  padding: 12px 22px; border-radius: 999px; border: 0; font: 600 1rem var(--sans);
  text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.secondary { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }

/* Sections */
section { padding: 64px 0; }
.hero { padding: 80px 0 72px; background: linear-gradient(180deg, var(--soft), var(--bg)); }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 36em; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-top: 0; }
.card .price { font-weight: 700; color: var(--accent); }
.muted { color: var(--muted); }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 16px; }
.steps li { counter-increment: step; padding-left: 52px; position: relative; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px;
  border-radius: 50%; background: var(--soft); color: var(--accent); display: grid; place-items: center; font-weight: 700;
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; color: var(--muted); font-size: .95rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Forms */
.notice { background: var(--soft); border-radius: var(--radius); padding: 18px 22px; margin: 24px 0; }
.notice strong { color: var(--ink); }

form fieldset {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 22px 22px 8px; margin: 0 0 24px;
}
form legend { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; padding: 0 8px; }
.field { margin-bottom: 18px; }
.field > label, .field > .q { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { display: block; color: var(--muted); font-size: .9rem; font-weight: 400; margin-top: -2px; margin-bottom: 6px; }
.req { color: var(--error); }

input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.options { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.options label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.consent label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-bottom: 12px; }
.consent input { margin-top: 5px; flex: none; }
.row { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { margin: 12px 0; font-weight: 600; }
.status.error { color: var(--error); }
.status.ok { color: var(--ok); }

.prose h2 { margin-top: 1.6em; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }

/* Admin inbox */
.inbox-item { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; }
.inbox-item header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.inbox-item dl { margin: 12px 0 0; }
.inbox-item dt { font-weight: 600; margin-top: 10px; }
.inbox-item dd { margin: 2px 0 0; white-space: pre-wrap; }
.inbox-item h4 { font-family: var(--serif); margin: 18px 0 4px; color: var(--accent); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar .btn { padding: 8px 14px; font-size: .9rem; }

@media print {
  .site-header, .site-footer, .toolbar, #unlock, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .inbox-item { break-inside: avoid; border-color: #999; }
}
.alt { background: var(--soft); }
