:root {
  --maroon: #6B1D2A;
  --maroon-dark: #521521;
  --marigold: #F2A900;
  --saffron: #E5741E;
  --leaf: #2F5D3A;
  --paper: #FFFDF7;
  --bg: #F4EEE4;
  --ink: #2B1B17;
  --muted: #6E5D51;
  --line: #E3D5C2;
  --error: #B42318;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}

a { color: var(--maroon); }

/* Header with a marigold garland strip */
.top {
  background: var(--maroon);
  color: var(--paper);
}
.toran {
  height: 22px;
  background:
    radial-gradient(circle at 11px 9px, var(--marigold) 7px, transparent 7.5px) 0 0 / 44px 22px repeat-x,
    radial-gradient(circle at 33px 9px, var(--saffron) 7px, transparent 7.5px) 0 0 / 44px 22px repeat-x;
  border-bottom: 2px solid var(--leaf);
}
.top-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 20px 34px;
}
.brand {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 17px;
  color: #F2D9A6;
}
.top h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: normal;
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1.15;
}
.sub {
  margin: 10px 0 0;
  max-width: 56ch;
  color: #F3E3CF;
}

.main {
  max-width: 760px;
  margin: -14px auto 0;
  padding: 0 16px 40px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 24px;
  margin-bottom: 18px;
}
.card.narrow { max-width: 440px; }
.card h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: normal;
  font-size: 22px;
}

/* Form */
fieldset {
  border: 0;
  margin: 0 0 22px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}
fieldset:last-of-type { border-bottom: 0; }
legend {
  padding: 0;
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: 21px;
  color: var(--maroon);
}
.field { margin-bottom: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row-3 { grid-template-columns: 2fr 1.4fr 1fr; }

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 15px;
}
.req {
  font-weight: normal;
  font-size: 13px;
  color: var(--muted);
}
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], select, textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #CBB9A3;
  border-radius: 6px;
}
textarea { resize: vertical; }
select { height: 48px; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(242, 169, 0, .45);
  outline-offset: 1px;
  border-color: var(--maroon);
}
[aria-invalid="true"] { border-color: var(--error); background: #FFF7F6; }
.err { margin: 6px 0 0; color: var(--error); font-size: 14px; }

.alert {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-left: 4px solid var(--error);
  background: #FDECEA;
  color: #7A1C14;
  border-radius: 4px;
}
.notice {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--leaf);
  background: #E8F0E6;
  border-radius: 4px;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  font: 600 16px var(--sans);
  color: #3B1A12;
  background: var(--marigold);
  border: 0;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #E09D00; }
.btn:focus-visible, .link-btn:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--maroon);
  outline-offset: 2px;
}
.btn-block { width: 100%; padding: 14px; font-size: 17px; }
.btn-ghost { background: var(--paper); border: 1px solid var(--line); color: var(--maroon); }
.btn-ghost:hover { background: #fff; }

.muted { color: var(--muted); }
.small { font-size: 14px; text-align: center; margin: 12px 0 0; }

/* Thank-you */
.done { text-align: center; padding: 40px 24px; }
.done-mark {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--leaf);
  color: #fff;
  font-size: 28px; line-height: 56px;
}
.done .btn { margin-top: 10px; }

/* Dashboard */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 18px;
  padding-top: 26px;
}
.copy { display: flex; gap: 10px; margin-top: 6px; }
.copy input { flex: 1; min-width: 0; background: #FBF7EF; }

.progress-card .big {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 24px;
}
.progress-card .big span { font-size: 40px; color: var(--leaf); }
.meter {
  height: 14px;
  background: #EFE4D4;
  border-radius: 7px;
  overflow: hidden;
}
.meter-fill { height: 100%; background: var(--leaf); border-radius: 7px; }
.progress-card .muted { margin: 10px 0 0; }

.chips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 12px;
  background: #FDF1D6;
  border: 1px solid #F0D58F;
  border-radius: 16px;
  font-size: 15px;
}

.table-wrap { overflow-x: auto; margin: 10px -4px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.nowrap { white-space: nowrap; }
.tag {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  font-size: 12px;
  background: #FDECEA;
  color: #7A1C14;
  border-radius: 10px;
}
.link-btn {
  margin-top: 6px;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--error);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

details summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--maroon);
}
details form { margin-top: 16px; }

.foot {
  text-align: center;
  padding: 0 16px 30px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .card { padding: 22px 16px; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .copy { flex-direction: column; }

  /* Table turns into stacked cards on phones */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 0; border-bottom: 2px solid var(--line); }
  .table td { border: 0; padding: 4px 4px; }
  .table td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    color: var(--muted);
  }
  .nowrap { white-space: normal; }
}

/* ---------- Progress garland on the form page ---------- */
.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;
}
.garland-card h2 { font-size: 21px; line-height: 1.3; }
.garland-card .count { font-size: 34px; color: var(--leaf); }
.garland-card > .muted { margin: 4px 0 0; }

.garland {
  list-style: none;
  margin: 18px 0 6px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  row-gap: 10px;
}
/* Each flower hangs from its own piece of string, so wrapped rows stay strung */
.garland li {
  position: relative;
  width: 38px;
  padding-top: 12px;
  border-top: 2px solid var(--leaf);
  display: flex;
  justify-content: center;
}
.garland li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 12px;
  background: var(--leaf);
}
.garland .flower { width: 32px; height: 32px; display: block; }

.garland .is-done .flower {
  animation: bloom .5s ease-out both;
  animation-delay: calc(var(--i) * 45ms);
  transform-origin: 50% 50%;
}
.garland .is-new .flower {
  animation: bloom-new .9s ease-out both;
}
@keyframes bloom {
  from { transform: scale(.3) rotate(-40deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes bloom-new {
  0%   { transform: scale(.2) rotate(-90deg); opacity: 0; }
  70%  { transform: scale(1.25) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .garland .flower { animation: none !important; }
}

.who { margin-top: 14px; }
.who summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--maroon);
}
.who-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 12px;
}
.who h3 { margin: 0 0 6px; font-size: 15px; }
.who ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.who li { padding: 3px 0 3px 24px; position: relative; }
.who li.tick::before {
  content: "\2713";
  position: absolute; left: 2px; top: 3px;
  color: var(--leaf); font-weight: 700;
}
.who li.dot::before {
  content: "";
  position: absolute; left: 5px; top: 11px;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px dashed #B9A68D;
}
.done { padding-top: 32px; }

@media (max-width: 640px) {
  .garland li { width: 34px; }
  .garland .flower { width: 28px; height: 28px; }
  .who-cols { grid-template-columns: 1fr; }
}
