/* Marriage on Mission — shared styles.
   Brand colors (--brand, --accent) are injected from /theme.css (Admin → Settings). */
:root {
  --brand: #0D1B3E;
  --accent: #C9A84C;
  --bg: #FBF8F2;
  --surface: #FFFFFF;
  --surface-2: #F4EFE4;
  --ink: #1C2233;
  --ink-2: #4A5266;
  --line: #E3DCCD;
  --line-strong: #C9BFA9;
  --danger: #A63A2B;
  --danger-bg: #FBEDEA;
  --ok: #2F6B4F;
  --ok-bg: #E8F3EC;
  --focus: #2563EB;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(13, 27, 62, .06), 0 8px 24px rgba(13, 27, 62, .06);
  --serif: Georgia, "Cormorant Garamond", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
h1, h2, h3, .h3 { font-family: var(--serif); color: var(--brand); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); margin: .2em 0 .4em; }
h2 { font-size: 1.35rem; margin: 1.2em 0 .5em; }
h3, .h3 { font-size: 1.1rem; margin: .4em 0; }
p { margin: .5em 0 .9em; }
a { color: var(--brand); text-underline-offset: 3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.center { text-align: center; }
.left { text-align: left; }
.break { overflow-wrap: anywhere; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 720px; }
main.wrap { padding-top: 24px; padding-bottom: 40px; }

/* Header / footer */
.site-header { background: #fff; color: var(--brand); border-bottom: 3px solid var(--accent); box-shadow: 0 1px 0 var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; padding-top: 10px; padding-bottom: 10px; }
.wordmark { color: var(--brand); text-decoration: none; display: flex; align-items: center; gap: 14px; }
.logo { display: block; height: 52px; width: auto; }
@media (min-width: 640px) { .logo { height: 60px; } }
.wm-name { font-family: var(--serif); font-size: 1.35rem; letter-spacing: .02em; }
.wm-tag { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: #8A6D1E; font-weight: 600; border-left: 1px solid var(--line-strong); padding-left: 14px; max-width: 16em; line-height: 1.35; }
@media (max-width: 480px) { body:not([data-page=admin]) .wm-tag { display: none; } }
.hero-logo { margin: 4px 0 6px; }
.hero-logo img { width: min(320px, 80%); height: auto; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding-top: 14px; padding-bottom: 14px; }
.footer-inner p { margin: 0; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px clamp(18px, 5vw, 40px); }
.card + .card { margin-top: 20px; }
.subcard { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; background: var(--bg); margin-top: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: #8A6D1E; margin: 0 0 .2em; }
.lead { font-size: 1.08rem; color: var(--ink); }
.hero h1 { font-size: clamp(2rem, 7vw, 3rem); }
.hero-tag { font-family: var(--serif); font-style: italic; color: #8A6D1E; font-size: 1.2rem; }
.event-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.event-title { margin: 0; font-size: 1.15rem; }
.meta { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: .92rem; }
.meta li + li::before { content: "·"; margin-right: 14px; color: var(--line-strong); }
.form-title { font-size: clamp(1.5rem, 4.5vw, 2rem); }
.note-box { background: var(--surface-2); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.link-box { background: #fff; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .3em 0; }

/* Buttons */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid transparent; font: 600 1rem/1.2 var(--sans); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 1.05rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-accent { background: var(--accent); color: #1a1405; }
.btn-accent:hover { filter: brightness(1.05); }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.center-row { justify-content: center; }
.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

/* Forms */
.form { margin-top: 8px; }
.step > h2:first-child { margin-top: .4em; }
.field { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.label { display: block; font-weight: 650; margin-bottom: 6px; color: var(--ink); font-family: var(--sans); font-size: 1rem; padding: 0; }
legend.label { margin-bottom: 8px; }
.req { color: var(--danger); }
.opt { color: var(--ink-2); font-weight: 400; font-size: .9rem; }
.hint { margin: -2px 0 8px; color: var(--ink-2); font-size: .9rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=number], input[type=url], input[type=search], textarea, select {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 0; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .92rem; font-weight: 600; margin: 6px 0 0; }
.grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-cols { display: grid; grid-template-columns: 1fr; }
@media (min-width: 560px) { .chips-cols { grid-template-columns: 1fr 1fr; } }
.chip { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; cursor: pointer; line-height: 1.3; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip:hover { border-color: var(--brand); }
.chip.is-checked, .chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.is-checked::before, .chip:has(input:checked)::before { content: "✓"; font-weight: 700; color: var(--accent); }
.chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip.is-disabled { opacity: .45; cursor: not-allowed; }
.chip-quiet { margin-top: 10px; font-size: .92rem; border-style: dashed; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (min-width: 560px) { .scale:not(.scale-labelled) { grid-template-columns: repeat(10, 1fr); } }
.scale-labelled { grid-template-columns: 1fr; }
@media (min-width: 560px) { .scale-labelled { grid-template-columns: repeat(5, 1fr); } }
.scale-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #fff; cursor: pointer; padding: 6px; text-align: center; }
.scale-item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.scale-item:hover { border-color: var(--brand); }
.scale-item.is-checked, .scale-item:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.scale-item:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.scale-num { font-weight: 700; font-size: 1.05rem; }
.scale-sub { font-size: .82rem; line-height: 1.2; }
.scale-labelled .scale-item { flex-direction: row; gap: 10px; justify-content: flex-start; padding: 10px 14px; }
@media (min-width: 560px) { .scale-labelled .scale-item { flex-direction: column; gap: 2px; justify-content: center; padding: 8px 4px; } }
.scale-ends { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; color: var(--ink-2); margin-top: 6px; }
.scale-ends span:last-child { text-align: right; }

.progress { margin: 4px 0 18px; }
.progress-track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; transition: width .3s ease; }
.progress-text { font-size: .88rem; color: var(--ink-2); margin: 6px 0 0; font-weight: 600; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; }
.step-nav .btn-primary { margin-left: auto; }

.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 18px; font-weight: 600; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #EBC3BC; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #BFDCCB; }

.success-mark { width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--accent); font-size: 2rem; font-weight: 700; }
.success h1 { outline: none; }
.invite { margin: 22px 0; }
.invite-panel { text-align: left; margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }

.loading { padding: 48px 20px; }
.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Home page event list */
.events-home h2 { margin-top: 0; }
.event-tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.event-tile { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--bg); }
.event-tile h3 { margin: 0 0 4px; font-size: 1.15rem; }
.event-tile .btn-row { margin: 12px 0 6px; }
.event-tile .small { margin: 0; }

.meeting-join { margin: 14px 0 6px; }
.meeting-join .btn { width: 100%; }
@media (min-width: 560px) { .meeting-join .btn { width: auto; } }
.meeting-join p { margin: 6px 0 0; }
.event-tile .meeting-join { padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
