/* Shared design tokens and primitives. */

:root {
  --cream: #fdf7ec;
  --ivory: #fffdf8;
  --sand: #f4e9d6;
  --maroon: #7a1b2b;
  --maroon-dark: #5c1220;
  --marigold: #e39b25;
  --gold: #c9a227;
  --gold-soft: #e6cf8f;
  --teal: #1f6f6b;
  --ink: #2a211c;
  --muted: #7d6f64;
  --line: #e3d5bd;
  --ok: #1f7a4d;
  --warn: #b4711a;
  --bad: #a32731;

  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --display: 'Marcellus', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --deva: 'Tiro Devanagari Hindi', var(--serif);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 34px -14px rgba(92, 18, 32, 0.28);
  --shadow-sm: 0 3px 12px -6px rgba(92, 18, 32, 0.22);
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.18; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: var(--maroon); }

.deva { font-family: var(--deva); }

/* ---------- ornament ---------- */

.rule-orn {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; color: var(--gold); margin: 26px 0;
}
.rule-orn::before, .rule-orn::after {
  content: ''; height: 1px; flex: 1 1 auto; max-width: 190px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.rule-orn span { font-size: 15px; letter-spacing: .3em; }

.eyebrow {
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--maroon); font-weight: 500;
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  letter-spacing: .04em;
  padding: 10px 20px; border-radius: 999px;
  border: 1px solid var(--maroon); background: var(--maroon); color: #fff;
  cursor: pointer; text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--maroon-dark); border-color: var(--maroon-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--maroon); }
.btn--ghost:hover { background: rgba(122, 27, 43, .07); color: var(--maroon-dark); }
.btn--gold { background: var(--gold); border-color: var(--gold); color: #3a2c07; }
.btn--gold:hover { background: #b8901f; border-color: #b8901f; color: #3a2c07; }
.btn--sm { padding: 6px 13px; font-size: 12.5px; }
.btn--danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn--danger:hover { background: var(--bad); color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- form controls ---------- */

input[type=text], input[type=tel], input[type=email], input[type=number],
input[type=date], input[type=time], select, textarea {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 11px; width: 100%; transition: border-color .14s, box-shadow .14s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .16);
}
label.field { display: block; margin-bottom: 12px; }
label.field > span {
  display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px; font-weight: 500;
}
textarea { min-height: 74px; resize: vertical; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--maroon); margin: 0; cursor: pointer; }

/* ---------- badges ---------- */

.badge {
  display: inline-block; font-size: 11px; letter-spacing: .07em; font-weight: 500;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--ivory); color: var(--muted); white-space: nowrap;
}
.badge--ok { color: var(--ok); border-color: #b6dcc6; background: #eef8f2; }
.badge--warn { color: var(--warn); border-color: #ecd6ac; background: #fdf5e6; }
.badge--bad { color: var(--bad); border-color: #ecc3c6; background: #fdeef0; }
.badge--info { color: var(--teal); border-color: #b3d5d3; background: #edf6f5; }
.badge--gold { color: #6b5410; border-color: var(--gold-soft); background: #fbf3dc; }

/* ---------- cards ---------- */

.card {
  background: var(--ivory); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px;
}
.card--flat { box-shadow: none; }
.card h3 { margin-bottom: .35em; }

/* ---------- toasts ---------- */

.toast-host {
  position: fixed; z-index: 900; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow);
  animation: toast-in .22s ease; max-width: 88vw; text-align: center;
}
.toast--warn { background: var(--warn); }
.toast--bad { background: var(--bad); }
.toast.is-out { opacity: 0; transform: translateY(6px); transition: opacity .5s, transform .5s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 800; background: rgba(42, 33, 28, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; animation: fade .16s ease;
}
.modal {
  background: var(--ivory); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 640px; border: 1px solid var(--line);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1);
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal__head h3 { margin: 0; font-size: 20px; }
.modal__body { padding: 20px; }
.modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.modal__x {
  border: none; background: none; font-size: 22px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.modal__x:hover { background: var(--sand); color: var(--ink); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
