:root {
  --ivory: #fffaf5;
  --cream: #fffdf9;
  --blush: #f6d8dd;
  --blush-deep: #c97889;
  --rose: #a85e70;
  --sage: #586746;
  --olive: #6f795d;
  --champagne: #b8a983;
  --ink: #33372a;
  --muted: #747866;
  --danger: #a33d3d;
  --success: #426b3d;
  --shadow-soft: 0 24px 70px rgba(88, 103, 70, 0.14);
  --shadow-card: 0 14px 40px rgba(88, 103, 70, 0.12);
  --radius-xl: 34px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Candara, 'Segoe UI', sans-serif;
}

a { color: inherit; }

.public-shell {
  background:
    linear-gradient(rgba(255, 250, 245, .74), rgba(255, 250, 245, .86)),
    url('/assets/watercolour-page-wash.png') center/cover fixed,
    var(--ivory);
}

.admin-shell {
  background: #f6f7f8;
  color: #1f2933;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.page {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 72px;
}

.public-page { position: relative; }

.public-page::before,
.public-page::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: -1;
  opacity: .22;
  background: url('/assets/calla-corner-sprig.png') center/contain no-repeat;
}

.public-page::before {
  width: 360px;
  height: 360px;
  left: -96px;
  bottom: -54px;
  transform: rotate(-8deg);
}

.public-page::after {
  width: 300px;
  height: 300px;
  right: -84px;
  top: 92px;
  transform: rotate(128deg);
}

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid rgba(184, 169, 131, .38);
  border-radius: 999px;
  background: rgba(255, 253, 249, .72);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 35px rgba(88, 103, 70, .08);
}

.brand-mark {
  text-decoration: none;
  color: var(--rose);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.25rem;
  letter-spacing: .04em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav-link {
  border-radius: 999px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--sage);
  font-size: .94rem;
  transition: background .22s ease, color .22s ease, transform .22s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
  background: rgba(246, 216, 221, .68);
  color: var(--rose);
  transform: translateY(-1px);
}

.landing-hero,
.page-hero,
.form-panel,
.registry-panel,
.confirmation-page,
.event-details-card,
.keepsake-note {
  border: 1px solid rgba(184, 169, 131, .34);
  background: rgba(255, 253, 249, .82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.landing-hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  align-items: center;
  gap: 20px;
  overflow: hidden;
  border-radius: 44px;
  padding: clamp(34px, 5vw, 72px);
  position: relative;
}

.landing-hero::after,
.page-hero::after,
.confirmation-page::after {
  content: '';
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(184, 169, 131, .34);
  border-radius: inherit;
  pointer-events: none;
}

.hero-copy { position: relative; z-index: 2; }

.eyebrow {
  color: var(--sage);
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  font-size: .78rem;
  margin: 0 0 12px;
}

.landing-hero h1,
.page-hero h1,
.confirmation-page h1 {
  margin: 0;
  color: var(--rose);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(3.8rem, 10vw, 8rem);
  font-weight: 400;
  line-height: .86;
}

.landing-hero h1 span {
  display: block;
  color: var(--sage);
  font-style: italic;
  font-size: .78em;
}

.hero-subtitle,
.page-hero p,
.keepsake-note p,
.event-detail-list,
.confirmation-page p {
  color: var(--olive);
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  line-height: 1.72;
}

.hero-subtitle { max-width: 560px; }

.hero-art {
  min-height: 520px;
  align-self: stretch;
  background: url('/assets/calla-hero-watercolour.png') center/contain no-repeat;
  filter: drop-shadow(0 22px 24px rgba(88, 103, 70, .12));
  transform: translateX(18px) scale(1.08);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.centered-actions { justify-content: center; }

.btn-primary,
.btn-secondary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 24px;
  min-height: 46px;
  font: 700 1rem/1 Candara, 'Segoe UI', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, color .22s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blush-deep), var(--rose));
  color: #fff;
  box-shadow: 0 14px 28px rgba(168, 94, 112, .22);
}

.btn-secondary {
  background: rgba(255, 255, 255, .82);
  color: var(--rose);
  border: 1px solid rgba(201, 120, 137, .34);
}

.btn-danger {
  background: #ffe3e3;
  color: var(--danger);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover,
.gift-card:hover,
.action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(88, 103, 70, .16);
}

.text-link {
  color: var(--rose);
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100%/100% 1px no-repeat;
  transition: background-size .22s ease, color .22s ease;
}

.text-link:hover,
.text-link:focus-visible { background-size: 0 1px; color: var(--sage); }

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 22px;
  margin-top: 22px;
}

.event-details-card,
.keepsake-note,
.form-panel,
.registry-panel,
.confirmation-page,
.page-hero {
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 44px);
}

.event-details-card h2,
.keepsake-note h2,
.form-panel h2,
.gift-card h3,
.status-panel h2 {
  margin: 0 0 14px;
  color: var(--rose);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
}

.script-word {
  margin: 0 0 10px;
  color: var(--blush-deep);
  font-family: 'Brush Script MT', 'Segoe Script', cursive;
  font-size: 2.5rem;
}

.event-detail-list {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}

.event-detail-list div {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(184, 169, 131, .28);
}

.event-detail-list dt {
  color: var(--sage);
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-size: .72rem;
}

.event-detail-list dd { margin: 6px 0 0; }

.page-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
}

.compact-hero h1,
.confirmation-page h1 { font-size: clamp(2.8rem, 7vw, 5.7rem); }

.compact-hero::before,
.confirmation-page::before {
  content: '';
  position: absolute;
  right: -48px;
  bottom: -96px;
  width: 300px;
  height: 300px;
  background: url('/assets/calla-corner-sprig.png') center/contain no-repeat;
  opacity: .28;
}

form label {
  display: block;
  margin-bottom: 16px;
  color: var(--sage);
  font-weight: 800;
}

form input,
form textarea,
.rsvp-select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 12px 14px;
  border: 1px solid rgba(184, 169, 131, .52);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  font-size: 1rem;
}

.rsvp-select {
  min-height: 48px;
  padding-right: 44px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--sage) 50%) calc(100% - 24px) 52% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--sage) 50%, transparent 50%) calc(100% - 17px) 52% / 7px 7px no-repeat,
    rgba(255, 255, 255, .82);
  cursor: pointer;
}

form input:focus,
form textarea:focus,
.rsvp-select:focus,
a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(201, 120, 137, .34);
  outline-offset: 3px;
}

.g-recaptcha { margin: 14px 0; }

.cutoff-note { color: var(--rose); }
.success-note { color: var(--success); font-weight: 700; }
.error-note { color: var(--danger); font-weight: 700; }
.closed-note,
.empty-note,
.gift-status { color: var(--muted); }

.status-panel {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: rgba(255, 250, 245, .72);
  border: 1px solid rgba(184, 169, 131, .3);
}

.success-panel { border-color: rgba(88, 103, 70, .25); }
.error-panel { border-color: rgba(163, 61, 61, .22); }

.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.gift-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: rgba(255, 253, 249, .9);
  border: 1px solid rgba(184, 169, 131, .32);
  box-shadow: var(--shadow-card);
  transition: transform .24s ease, box-shadow .24s ease;
}

.gift-image,
.purchase-image {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #fff;
}

.purchase-image {
  max-width: 360px;
  height: 240px;
  margin: 20px auto;
  border-radius: 24px;
}

.gift-image-placeholder {
  background:
    linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)),
    url('/assets/calla-corner-sprig.png') center/70% no-repeat,
    linear-gradient(135deg, #fffaf5, #f6d8dd);
}

.gift-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}
.gift-description { color: var(--olive); line-height: 1.55; }
.gift-card-actions {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-top: 8px;
}
.gift-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.gift-price { margin: 0; color: var(--sage); font-weight: 900; font-size: 1.18rem; }
.gift-buy-link {
  display: inline-block;
  margin: 0;
  color: var(--rose);
  font-weight: 800;
}
.gift-reserve-button { width: 100%; }
.reserve-form { margin-top: 0; }

.gift-reserve-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 32px;
  background: transparent;
  box-shadow: 0 30px 90px rgba(51, 55, 42, .24);
  overflow: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

body.reserve-dialog-open {
  overflow: hidden;
}

body.reserve-dialog-open::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 900;
  background:
    radial-gradient(circle at 30% 20%, rgba(246, 216, 221, .34), transparent 32%),
    rgba(51, 55, 42, .42);
  backdrop-filter: blur(6px);
}

.reserve-dialog-form {
  position: relative;
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid rgba(184, 169, 131, .44);
  border-radius: inherit;
  background:
    linear-gradient(rgba(255, 253, 249, .94), rgba(255, 250, 245, .96)),
    url('/assets/calla-corner-sprig.png') calc(100% + 70px) calc(100% + 82px)/240px no-repeat;
}

.reserve-dialog-form h2 {
  margin: 0 0 14px;
  color: var(--rose);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2rem, 6vw, 3.35rem);
  font-weight: 400;
  line-height: 1;
}

.reserve-dialog-copy {
  color: var(--olive);
  font-size: 1.02rem;
  line-height: 1.62;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 1px solid rgba(184, 169, 131, .36);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .74);
  color: var(--sage);
  font-weight: 800;
  cursor: pointer;
}

.reserve-dialog-result {
  margin: 14px 0;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.dialog-actions .btn-primary { flex: 1 1 230px; }

.confirmation-page {
  min-height: 430px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.reveal-card {
  animation: reveal .7s ease both;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-page {
  width: min(1100px, calc(100% - 32px));
  padding: 24px 0 48px;
}

.admin-login,
.admin-dashboard section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.admin-login { max-width: 380px; margin: 64px auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.admin-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.admin-table th,
.admin-table td { text-align: left; padding: 8px; border-bottom: 1px solid #d7dde4; }
.admin-gift-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.admin-shell h1,
.admin-shell h2,
.admin-shell h3 { color: #1f2933; }
.admin-shell .btn-primary { background: #1f6feb; color: #fff; box-shadow: none; border-radius: 8px; }
.admin-shell .btn-secondary { background: #e7eef8; color: #1f2933; border-color: #cbd5e1; border-radius: 8px; }
.admin-shell .btn-danger { background: #fee2e2; color: #991b1b; border-radius: 8px; box-shadow: none; }
.admin-shell .btn-primary:hover,
.admin-shell .btn-secondary:hover,
.admin-shell .btn-danger:hover { transform: none; box-shadow: none; }
.admin-shell .error-note { color: #b42318; }

@media (max-width: 920px) {
  .landing-hero,
  .landing-grid { grid-template-columns: 1fr; }
  .landing-hero { min-height: auto; }
  .hero-art { min-height: 360px; order: -1; transform: none; }
  .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .page { width: min(100% - 18px, 1120px); padding-top: 10px; }
  .public-nav { align-items: flex-start; border-radius: 24px; flex-direction: column; }
  .nav-links { justify-content: flex-start; }
  .landing-hero,
  .event-details-card,
  .keepsake-note,
  .form-panel,
  .registry-panel,
  .confirmation-page,
  .page-hero { border-radius: 24px; padding: 24px; }
  .landing-hero h1 { font-size: 4.1rem; }
  .hero-art { min-height: 280px; }
  .gift-grid { grid-template-columns: 1fr; }
  .gift-image { height: 200px; }
  .gift-meta-row { align-items: flex-start; flex-direction: column; }
  .dialog-actions .btn-primary,
  .dialog-actions .btn-secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
