/* ============================================================
   Neil & Melissa — Honeymoon Registry
   Palette:
     Aegean blue   #1B4B66  (--sea)
     Cream         #FBF8F3  (--cream)
     Ochre gold    #C98A3E  (--accent)
     Muted brick   #A8553E  (--brick)
     Ink navy      #16232E  (--ink)
   ============================================================ */

:root {
  --sea: #1b4b66;
  --cream: #fbf8f3;
  --accent: #c98a3e;
  --brick: #a8553e;
  --ink: #16232e;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--cream);
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
}

.page {
  min-height: 100%;
  padding: 48px 24px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

/* ---------- Header ---------- */

.hero {
  text-align: center;
  margin-bottom: 44px;
}

.hero .eyebrow {
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--brick);
  margin-bottom: 8px;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-size: 40px;
  margin: 0;
  line-height: 1.15;
}

.hero p {
  max-width: 480px;
  margin: 14px auto 0;
  color: rgba(22, 35, 46, 0.65);
  font-size: 15.5px;
  line-height: 1.6;
}

/* ---------- Card grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.grid-message {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(22, 35, 46, 0.65);
  font-size: 14.5px;
  padding: 30px 0;
}

.card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(22, 35, 46, 0.08);
}

.card-img {
  height: 150px;
  background-size: cover;
  background-position: center;
  filter: saturate(0.9);
}

.card-img.done {
  filter: none;
}

.card-body {
  padding: 18px;
}

.card-title {
  font-family: "Fraunces", serif;
  font-size: 18px;
  margin: 0 0 6px;
  line-height: 1.3;
}

.card.open-ended .card-desc {
  margin-bottom: 4px;
}

.card.open-ended .avatars {
  margin-top: 14px;
}

/* ---------- Progress ---------- */

.progress {
  margin-top: 14px;
}

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(22, 35, 46, 0.08);
  overflow: hidden;
}

.progress-fill {
  position: relative;
  height: 100%;
  background: var(--sea);
  transition: width 500ms ease;
  border-radius: 3px;
}

.progress-fill.done {
  background: var(--accent);
}

/* ---------- gift completion celebration ---------- */

/* Raised total changed (someone gifted): sweep the bar smoothly
   from its previous width to the new one. */
.progress-fill.animate-fill {
  animation: fill-up 800ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fill-up {
  from {
    width: var(--from-w, 0%);
  }
  to {
    width: var(--to-w, 100%);
  }
}

/* The final gift just landed: bar sweeps to 100% in Aegean blue,
   melts to gold, then a light shimmer runs across it. */
.progress-fill.just-done {
  background: var(--sea);
  animation:
    fill-up 800ms cubic-bezier(0.22, 1, 0.36, 1) forwards,
    turn-gold 700ms ease 750ms forwards;
}

@keyframes turn-gold {
  to {
    background-color: var(--accent);
  }
}

.progress-fill.just-done::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px;
  background: linear-gradient(
    105deg,
    transparent 25%,
    rgba(255, 255, 255, 0.75) 50%,
    transparent 75%
  );
  transform: translateX(-110%);
  animation: shimmer 900ms ease 1450ms forwards;
}

@keyframes shimmer {
  to {
    transform: translateX(110%);
  }
}

/* Card-level flourish while the bar completes */
.card.just-done {
  animation: card-glow 2000ms ease 750ms;
}

@keyframes card-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(201, 138, 62, 0);
  }
  35% {
    box-shadow:
      0 0 0 4px rgba(201, 138, 62, 0.28),
      0 10px 34px rgba(201, 138, 62, 0.35);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(201, 138, 62, 0);
  }
}

/* Photo blooms into full color as the moment completes */
.card.just-done .card-img {
  animation: saturate-in 1000ms ease 850ms backwards;
}

@keyframes saturate-in {
  from {
    filter: saturate(0.9);
  }
  to {
    filter: none;
  }
}

/* "Fully gifted 💛" and the locked button rise in after the gold lands */
.card.just-done .progress-meta,
.card.just-done .gift-btn {
  animation: fade-up 550ms ease 1250ms backwards;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 13px;
  color: rgba(22, 35, 46, 0.65);
  font-weight: 500;
}

.progress-meta.done {
  color: var(--accent);
  font-weight: 600;
}

.progress-meta .pct {
  color: rgba(22, 35, 46, 0.45);
}

/* ---------- Contributor pills ---------- */

.avatars {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.pill {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(27, 75, 102, 0.07);
  color: var(--sea);
  font-weight: 500;
}

/* ---------- Gift button ---------- */

.gift-btn {
  margin-top: 16px;
  width: 100%;
  padding: 11px 0;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  font-family: inherit;
}

.gift-btn:disabled {
  background: rgba(22, 35, 46, 0.06);
  color: rgba(22, 35, 46, 0.4);
  cursor: default;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 35, 46, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal {
  position: relative;
  background: var(--cream);
  border-radius: 18px;
  max-width: 420px;
  width: 100%;
  padding: 28px;
  font-family: "Source Sans 3", sans-serif;
  color: var(--ink);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.modal-kicker {
  font-size: 12.5px;
  letter-spacing: 0.2px;
  color: var(--sea);
  margin-bottom: 4px;
}

.modal-title {
  font-family: "Fraunces", serif;
  font-size: 22px;
  margin: 0 0 18px;
  line-height: 1.25;
}

.modal-needed {
  font-size: 13.5px;
  color: rgba(22, 35, 46, 0.65);
  margin-bottom: 10px;
}

.modal-notice {
  font-size: 13px;
  color: var(--brick);
  font-weight: 500;
  margin-bottom: 10px;
}

/* Quick-select amount buttons */

.quick-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  border: 1px solid rgba(22, 35, 46, 0.15);
  background: white;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
}

.quick-btn.selected {
  border: 2px solid var(--accent);
  background: rgba(201, 138, 62, 0.08);
  padding: 9px 0; /* compensate for the thicker border so height stays the same */
}

.full-btn {
  width: 100%;
  padding: 11px 0;
  border-radius: 10px;
  border: 1px dashed rgba(201, 138, 62, 0.5);
  background: rgba(201, 138, 62, 0.04);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  color: var(--brick);
  margin-bottom: 14px;
  font-family: inherit;
}

.full-btn.selected {
  border: 2px solid var(--accent);
  background: rgba(201, 138, 62, 0.1);
  padding: 10px 0;
}

/* Manual amount input */

.amount-label {
  font-size: 12.5px;
  color: rgba(22, 35, 46, 0.65);
}

.amount-wrap {
  position: relative;
  margin-top: 6px;
  margin-bottom: 10px;
}

.amount-wrap .dollar {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(22, 35, 46, 0.5);
}

.amount-input {
  width: 100%;
  padding: 12px 12px 12px 26px;
  border-radius: 10px;
  border: 1px solid rgba(22, 35, 46, 0.15);
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: white;
}

.encourage {
  font-size: 13px;
  color: var(--brick);
  font-weight: 500;
  margin-bottom: 20px;
}

/* Name / anonymous section */

.name-section {
  border-top: 1px solid rgba(22, 35, 46, 0.1);
  padding-top: 16px;
  margin-bottom: 20px;
}

.radio-row {
  display: flex;
  gap: 16px;
}

.radio-row.has-name {
  margin-bottom: 10px;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  cursor: pointer;
}

.name-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(22, 35, 46, 0.15);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: white;
}

.name-note {
  font-size: 12px;
  color: rgba(22, 35, 46, 0.5);
  margin-top: 6px;
}

/* Modal footer buttons */

.modal-actions {
  display: flex;
  gap: 10px;
}

.btn-secondary {
  flex: 1;
  padding: 12px 0;
  border-radius: 10px;
  border: 1px solid rgba(22, 35, 46, 0.15);
  background: white;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
}

.btn-primary {
  flex: 2;
  padding: 12px 0;
  border-radius: 10px;
  border: none;
  background: var(--sea);
  color: white;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Payment step */

.payment-summary {
  font-size: 13.5px;
  color: rgba(22, 35, 46, 0.65);
  margin-bottom: 14px;
}

#payment-element {
  margin-bottom: 16px;
}

.payment-error {
  font-size: 13px;
  color: var(--brick);
  font-weight: 500;
  margin-bottom: 14px;
}

/* Thank-you / fully-gifted states */

.modal-center {
  text-align: center;
  padding: 8px 0 4px;
}

.modal-center h3 {
  font-family: "Fraunces", serif;
  font-size: 22px;
  margin: 0 0 10px;
  line-height: 1.25;
}

.modal-center p {
  font-size: 14px;
  color: rgba(22, 35, 46, 0.65);
  line-height: 1.55;
  margin: 0 0 20px;
}

/* ---------- thank-you celebration ---------- */

.thanks-anim .thanks-heart {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 10px;
  animation: heart-pop 700ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes heart-pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  60% {
    transform: scale(1.18);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.thanks-anim h3 {
  animation: fade-up 550ms ease 250ms backwards;
}

.thanks-anim p {
  animation: fade-up 550ms ease 420ms backwards;
}

.thanks-anim .modal-actions {
  animation: fade-up 550ms ease 580ms backwards;
}

/* Confetti drifts down inside the modal, in wedding colors */
.confetti-layer {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  opacity: 0;
  transform: rotate(0deg);
  animation: confetti-fall var(--dur, 1400ms) ease-in var(--delay, 0ms)
    forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx, 0px), var(--fall, 340px))
      rotate(var(--rot, 360deg));
  }
}

/* ---------- Site nav ---------- */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 44px;
}

.nav-link {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(22, 35, 46, 0.6);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.nav-link:hover {
  color: var(--sea);
}

.nav-link.active {
  color: var(--sea);
  border-bottom-color: var(--accent);
}

.brand {
  display: block;
  line-height: 0;
}

.brand-mark {
  width: 52px;
  height: 52px;
  transition: transform 200ms ease;
}

.brand:hover .brand-mark {
  transform: scale(1.06);
}

/* ---------- RSVP page ---------- */

.rsvp-banner {
  max-width: 560px;
  margin: 0 auto 36px;
  padding: 11px 18px;
  text-align: center;
  font-size: 13px;
  line-height: 1.55;
  color: var(--brick);
  background: rgba(201, 138, 62, 0.09);
  border: 1px solid rgba(201, 138, 62, 0.35);
  border-radius: 12px;
}

.rsvp-card {
  position: relative;
  overflow: hidden;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px;
  background: white;
  border: 1px solid rgba(22, 35, 46, 0.08);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(22, 35, 46, 0.05);
}

.rsvp-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(22, 35, 46, 0.55);
  margin-bottom: 8px;
}

.rsvp-title {
  font-family: "Fraunces", serif;
  font-size: 21px;
  margin: 0 0 6px;
}

.rsvp-sub {
  font-size: 14px;
  color: rgba(22, 35, 46, 0.65);
  line-height: 1.55;
  margin: 0 0 18px;
}

.rsvp-error {
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--brick);
}

.rsvp-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.caps {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 13px !important;
}

/* Household picker (when a name matches more than one party) */

.household-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.household-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(22, 35, 46, 0.14);
  border-radius: 12px;
  background: white;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.household-btn:hover {
  border-color: var(--sea);
  background: rgba(27, 75, 102, 0.04);
}

.household-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.household-count {
  font-size: 12.5px;
  color: rgba(22, 35, 46, 0.55);
  white-space: nowrap;
}

/* Guest rows with attending toggles */

.guest-list {
  border-top: 1px solid rgba(22, 35, 46, 0.08);
}

.guest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 0;
  border-bottom: 1px solid rgba(22, 35, 46, 0.08);
}

.guest-name {
  font-size: 15px;
  font-weight: 500;
}

.attend-toggle {
  display: flex;
  gap: 6px;
}

.attend-btn {
  padding: 8px 13px;
  border: 1px solid rgba(22, 35, 46, 0.16);
  border-radius: 9px;
  background: white;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(22, 35, 46, 0.65);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.attend-btn:disabled {
  cursor: default;
  opacity: 0.7;
}

.attend-btn.yes.selected {
  border-color: var(--sea);
  background: rgba(27, 75, 102, 0.1);
  color: var(--sea);
  box-shadow: inset 0 0 0 1px var(--sea);
}

.attend-btn.no.selected {
  border-color: var(--brick);
  background: rgba(168, 85, 62, 0.09);
  color: var(--brick);
  box-shadow: inset 0 0 0 1px var(--brick);
}

/* Plus-one rows on the RSVP form */

.guest-plusone {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.plusone-label {
  white-space: nowrap;
  color: rgba(22, 35, 46, 0.6);
  font-style: italic;
}

.plusone-input {
  flex: 1;
  min-width: 0;
  max-width: 230px;
  padding: 8px 10px;
  border: 1px solid rgba(22, 35, 46, 0.16);
  border-radius: 9px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
}

.plusone-input:focus {
  outline: none;
  border-color: var(--sea);
}

.rsvp-edit-note {
  margin-top: 18px;
  font-size: 12.5px !important;
  color: rgba(22, 35, 46, 0.5) !important;
}

@media (max-width: 480px) {
  .guest-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .guest-plusone {
    width: 100%;
  }

  .plusone-input {
    max-width: none;
  }

  .attend-toggle {
    width: 100%;
  }

  .attend-btn {
    flex: 1;
  }
}

/* ---------- Guest list admin ---------- */

.admin-wrap {
  max-width: 640px;
  margin: 0 auto;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-count {
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(22, 35, 46, 0.6);
}

.admin-add {
  flex: 0 0 auto !important;
  padding: 11px 18px !important;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-card {
  background: white;
  border: 1px solid rgba(22, 35, 46, 0.08);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(22, 35, 46, 0.04);
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.admin-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-badge.pending {
  color: rgba(22, 35, 46, 0.55);
  background: rgba(22, 35, 46, 0.06);
}

.admin-badge.done {
  color: #2e6b46;
  background: rgba(46, 107, 70, 0.1);
}

.admin-members {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  font-size: 14px;
  color: rgba(22, 35, 46, 0.8);
}

.admin-members li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.admin-members .plusone-member {
  font-style: italic;
  color: var(--accent);
}

.attend-mark {
  flex: 0 0 auto;
  width: 1.1em;
  text-align: center;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
}

.attend-mark.yes {
  color: #2e6b46;
}

.attend-mark.no {
  color: var(--brick);
  font-size: 0.9em;
}

.attend-mark.none {
  color: rgba(22, 35, 46, 0.25);
}

.admin-card-actions {
  display: flex;
  gap: 8px;
}

.admin-card-actions .btn-secondary {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 13px;
}

.btn-secondary.danger {
  color: var(--brick);
  border-color: rgba(168, 85, 62, 0.35);
}

.btn-secondary.danger:hover {
  background: rgba(168, 85, 62, 0.06);
}

/* Household editor */

.admin-edit-card {
  max-width: 640px;
}

.member-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.member-row .name-input {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.plusone-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(22, 35, 46, 0.65);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.plusone-check input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.row-remove {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(22, 35, 46, 0.14);
  border-radius: 8px;
  background: white;
  color: rgba(22, 35, 46, 0.55);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.row-remove:hover:not(:disabled) {
  color: var(--brick);
  border-color: rgba(168, 85, 62, 0.4);
}

.row-remove:disabled {
  opacity: 0.35;
  cursor: default;
}

.add-row-btn {
  margin-top: 12px;
  padding: 9px 14px;
  border: 1px dashed rgba(27, 75, 102, 0.45);
  border-radius: 10px;
  background: rgba(27, 75, 102, 0.04);
  color: var(--sea);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.add-row-btn:hover:not(:disabled) {
  background: rgba(27, 75, 102, 0.09);
}

@media (max-width: 520px) {
  .member-row {
    flex-wrap: wrap;
  }

  .member-row .name-input {
    flex: 1 1 100%;
  }
}

/* Guests who prefer reduced motion get the plain state changes */
@media (prefers-reduced-motion: reduce) {
  .progress-fill.animate-fill,
  .progress-fill.just-done,
  .progress-fill.just-done::after,
  .card.just-done,
  .card.just-done .card-img,
  .card.just-done .progress-meta,
  .card.just-done .gift-btn,
  .thanks-anim .thanks-heart,
  .thanks-anim h3,
  .thanks-anim p,
  .thanks-anim .modal-actions,
  .confetti {
    animation: none !important;
  }
}
