:root {
  --ink: #07121e;
  --navy: #0a1d31;
  --navy-soft: #122b45;
  --gold: #d8a84f;
  --gold-light: #f1d18f;
  --paper: #f7f3ea;
  --paper-deep: #ebe5d8;
  --muted: #66717c;
  --line: #d8d1c3;
  --success: #176b4d;
  --error: #a33c32;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.payment-header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 4vw;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--ink);
  color: var(--paper);
}

.payment-brand {
  color: var(--gold-light);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.payment-header span {
  color: #d4dbe1;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
}

.payment-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  width: min(100%, 1280px);
  min-height: calc(100vh - 64px);
  margin: 0 auto;
}

.payment-main {
  padding: clamp(2rem, 5vw, 4.5rem) clamp(1.25rem, 5vw, 5rem);
}

.payment-sidebar {
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 2.5rem);
  border-left: 1px solid var(--line);
  background: #eee8dc;
}

.payment-intro {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #8f641e;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  max-width: 660px;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 0.98;
}

h2 {
  font-size: 2rem;
  line-height: 1.05;
}

.payment-intro > p:last-child,
.instruction-heading > p:last-child {
  max-width: 620px;
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.lookup-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 760px;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
}

label small {
  color: var(--muted);
  font-size: inherit;
  font-weight: 600;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 0.95rem;
  border: 1px solid #aaa295;
  border-radius: 3px;
  background: #fffdf8;
  color: var(--ink);
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(216, 168, 79, 0.48);
  outline-offset: 2px;
}

.button {
  min-height: 50px;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.button-primary {
  background: var(--ink);
  color: var(--paper);
}

.button-primary:hover:not(:disabled) {
  background: var(--navy-soft);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.lookup-form .button {
  grid-column: 1 / -1;
  width: fit-content;
  min-width: 220px;
}

.lookup-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.55rem;
  width: min(100%, 520px);
}

.lookup-progress > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.lookup-progress-track {
  height: 6px;
  overflow: hidden;
  background: var(--paper-deep);
}

.lookup-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold);
}

.lookup-progress.is-active .lookup-progress-track span {
  animation: lookup-progress-fill 8s cubic-bezier(0.22, 0.7, 0.2, 1) forwards;
}

.lookup-progress.is-complete .lookup-progress-track span {
  width: 100%;
  animation: none;
  transition: width 180ms ease-out;
}

@keyframes lookup-progress-fill {
  0% { width: 3%; }
  45% { width: 64%; }
  100% { width: 92%; }
}

.form-status {
  display: none;
  grid-column: 1 / -1;
  padding: 0.8rem 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-error {
  color: var(--error);
}

.form-status.is-success {
  color: var(--success);
}

.lookup-results {
  max-width: 760px;
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 2px solid var(--ink);
  scroll-margin-top: 1rem;
}

.lookup-results-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.lookup-match-list {
  display: grid;
  margin-top: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.lookup-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.lookup-match h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.lookup-match p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.confirm-reservation-button {
  min-width: 150px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.reservation {
  max-width: 760px;
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 2px solid var(--ink);
  scroll-margin-top: 1rem;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.text-button,
.copy-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: #805916;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.reservation-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  margin: 1.5rem 0 0;
  border-block: 1px solid var(--line);
}

.reservation-summary div {
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid var(--line);
}

.reservation-summary div:first-child {
  padding-left: 0;
}

.reservation-summary div:last-child {
  border-right: 0;
}

dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0.35rem 0 0;
  font-weight: 700;
}

.amount-due dd {
  color: var(--success);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
  line-height: 1;
}

.memo-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #c7b384;
  background: #fff9e9;
}

.memo-block span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.memo-block strong {
  display: block;
  margin-top: 0.35rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.payment-instructions,
.paid-confirmation {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 2px solid var(--ink);
}

.provider-list {
  display: grid;
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.provider-row {
  display: grid;
  grid-template-columns: 22px 0.65fr 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.provider-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}

.provider-name {
  font-weight: 800;
}

.provider-recipient,
.provider-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.provider-note {
  grid-column: 2 / 4;
  margin-top: -0.5rem;
}

.provider-link {
  grid-column: 4;
  grid-row: 1 / span 2;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ink);
  border-radius: 3px;
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.provider-link:hover {
  background: var(--ink);
  color: var(--paper);
}

.attestation {
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  margin-top: 1.25rem;
  color: var(--ink);
  line-height: 1.5;
}

.attestation input {
  width: 18px;
  height: 18px;
  margin: 0.15rem 0 0;
  accent-color: var(--success);
}

.complete-button {
  margin-top: 1rem;
}

.paid-confirmation {
  color: var(--ink);
}

.paid-confirmation > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.paid-confirmation dl {
  display: flex;
  gap: 2.5rem;
  margin: 1.25rem 0;
}

.payment-progress h2 {
  font-size: 2.4rem;
}

.payment-progress > p:not(.eyebrow) {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.overall-track,
.lodge-track {
  height: 6px;
  overflow: hidden;
  background: #d7d0c3;
}

.overall-track {
  margin-top: 1rem;
}

.overall-track span,
.lodge-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--success);
  transition: width 240ms ease;
}

.payment-leaderboard {
  display: grid;
  gap: 0;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.payment-leaderboard li {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.lodge-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.lodge-name {
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 800;
}

.lodge-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.leaderboard-status {
  min-height: 1.4em;
}

.project-note {
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.support-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.support-note a {
  color: var(--ink);
  font-weight: 700;
}

.payment-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 80px;
  padding: 1rem;
  background: var(--ink);
  color: #cbd2d8;
}

.payment-footer strong {
  color: var(--gold-light);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2rem;
}

.payment-footer span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .payment-shell {
    grid-template-columns: 1fr;
  }

  .payment-sidebar {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .payment-progress,
  .project-note,
  .support-note {
    max-width: 760px;
    margin-inline: auto;
  }
}

@media (max-width: 620px) {
  .payment-header {
    min-height: 58px;
    padding-inline: 1rem;
  }

  .payment-header span {
    max-width: 150px;
    font-size: 0.62rem;
  }

  .payment-main,
  .payment-sidebar {
    padding: 1.5rem 1rem 2rem;
  }

  h1 {
    font-size: 2.65rem;
  }

  .lookup-form {
    grid-template-columns: 1fr;
  }

  .lookup-form .button {
    width: 100%;
  }

  .lookup-progress {
    width: 100%;
  }

  .section-heading {
    display: grid;
  }

  .lookup-match {
    grid-template-columns: 1fr;
  }

  .confirm-reservation-button {
    width: 100%;
  }

  .section-heading .text-button {
    width: fit-content;
  }

  .reservation-summary {
    grid-template-columns: 1fr 1fr;
  }

  .reservation-summary div:nth-child(2) {
    border-right: 0;
  }

  .reservation-summary .amount-due {
    grid-column: 1 / -1;
    padding-left: 0;
    border-top: 1px solid var(--line);
  }

  .memo-block {
    display: grid;
  }

  .copy-button {
    width: fit-content;
  }

  .provider-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .provider-recipient {
    grid-column: 2;
  }

  .provider-note {
    grid-column: 2;
    margin-top: 0;
  }

  .provider-link {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }

  .complete-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lookup-progress.is-active .lookup-progress-track span {
    width: 92%;
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
