:root {
  --bg: #f4f8ff;
  --bg-alt: #fff7fb;
  --paper: rgba(255, 255, 255, 0.88);
  --ink: #34405a;
  --muted: #6b7591;
  --line: #dbe4f2;
  --blush: #f8d9ea;
  --blush-deep: #e482b8;
  --sage: #e9f4ef;
  --sage-deep: #5e90a0;
  --gold: #e5c45a;
  --sky: #dce9ff;
  --danger: #c45f6b;
  --shadow: 0 18px 48px rgba(96, 110, 144, 0.12);
  --radius: 28px;
}


* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(189, 219, 255, .45), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(247, 205, 230, .42), transparent 26%),
    linear-gradient(180deg, #f7fbff 0%, #fffafd 44%, #fbf2f8 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

.decor {
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(1px);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
}
.decor-one { top: 22%; left: -110px; background: linear-gradient(135deg, #dce9ff, #f7d6ea); }
.decor-two { top: 58%; right: -120px; background: linear-gradient(135deg, #fbd9ea, #dce9ff); }

.page-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 44px;
  position: relative;
  z-index: 1;
}

.hero { text-align: center; margin: 0 auto 42px; max-width: 720px; }
.eyebrow, .section-kicker {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .76rem;
  font-weight: 800;
  color: var(--sage-deep);
}
.hero h1, .admin-header h1 {
  margin: 8px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(2.65rem, 8vw, 5rem);
  line-height: .98;
  letter-spacing: -.035em;
}
.hero-copy { color: var(--muted); font-size: 1.05rem; line-height: 1.7; margin: 0; }
.hero-copy strong { color: var(--ink); }
.event-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.highlight-chip {
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(215, 226, 244, .95);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 8px 24px rgba(96, 110, 144, 0.08);
}
.highlight-chip span {
  display: block;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-weight: 800;
  color: var(--sage-deep);
  margin-bottom: 7px;
}
.highlight-chip strong {
  display: block;
  font-size: .97rem;
  line-height: 1.45;
  color: var(--ink);
}
.date-time-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.date-time-row strong { min-width: 0; }
.calendar-icon-button {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #cbdbea;
  border-radius: 12px;
  color: var(--sage-deep);
  background: rgba(255,255,255,.9);
  box-shadow: 0 5px 16px rgba(96, 110, 144, .08);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.calendar-icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.calendar-icon-button svg path:last-child { fill: currentColor; stroke: none; }
.calendar-icon-button:focus-visible {
  outline: 3px solid rgba(94, 144, 160, .25);
  outline-offset: 3px;
}
@media (hover: hover) and (pointer: fine) {
  .calendar-icon-button:hover {
    transform: translateY(-1px);
    border-color: var(--blush-deep);
    background: #fff;
  }
}
.host-line {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .95rem;
}
.host-line strong { color: var(--ink); font-weight: 750; }
.lookup-panel { max-width: 520px; margin: 0 auto; }
.lookup-phone-field { width: 100%; }
.venue-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--sage-deep);
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.venue-link:focus-visible {
  outline: 3px solid rgba(94, 144, 160, .25);
  outline-offset: 3px;
  border-radius: 4px;
}
@media (hover: hover) and (pointer: fine) {
  .venue-link:hover { color: var(--blush-deep); }
}

.card {
  background: var(--paper);
  border: 1px solid rgba(234, 223, 219, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.invitation-card { padding: 24px; margin-bottom: 26px; }
.rsvp-card { padding: clamp(24px, 5vw, 46px); }
.section-heading { margin-bottom: 26px; }
.section-heading h2, .admin-action-copy h2, .responses-toolbar h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.03;
  font-weight: 500;
  margin: 6px 0 10px;
  letter-spacing: -.025em;
}
.section-heading p, .admin-action-copy p { color: var(--muted); line-height: 1.65; margin: 0; }
.compact-heading { margin-bottom: 18px; }

.invitation-viewer {
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #f4f8ff, #fff);
  border: 1px solid var(--line);
}
.invitation-viewer img { width: 100%; display: block; max-height: 1080px; object-fit: contain; background: #fff; }
.invitation-viewer iframe { display: block; width: 100%; min-height: 760px; border: 0; background: #fff; }

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  background: #f6efec;
  border-radius: 16px;
  margin-bottom: 28px;
}
.mode-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  border-radius: 12px;
  padding: 12px 16px;
}
.mode-tab.active { background: #fff; color: var(--ink); box-shadow: 0 5px 18px rgba(96, 110, 144, .09); }

.form-panel { display: grid; gap: 24px; }
.form-grid { display: grid; gap: 18px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.member-grid { grid-template-columns: minmax(0, 1.6fr) minmax(130px, .7fr) minmax(130px, .7fr); }
.field { display: grid; gap: 8px; }
.field > span, .attendance-fieldset legend { font-size: .9rem; font-weight: 750; color: var(--ink); }
.field strong { color: var(--danger); }
input, select {
  width: 100%;
  border: 1px solid #dcd0cc;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(255,255,255,.92);
  outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { border-color: var(--blush-deep); box-shadow: 0 0 0 4px rgba(201, 143, 145, .13); }
.helper-text { color: var(--muted); font-size: .88rem; margin: -10px 0 0; }

.count-section {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: grid;
  gap: 20px;
}
.count-section-copy h3 {
  margin: 4px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 500;
}
.count-section-copy p { color: var(--muted); line-height: 1.6; margin: 0; }
.count-field input {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  min-height: 58px;
}
.count-field small { color: var(--muted); font-size: .78rem; }

.attendance-fieldset { margin: 0; border: 0; padding: 0; }
.attendance-fieldset legend { margin-bottom: 10px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-pill { position: relative; }
.choice-pill input { position: absolute; opacity: 0; pointer-events: none; }
.choice-pill span {
  display: block;
  text-align: center;
  padding: 13px 14px;
  border: 1px solid #ddcfcb;
  border-radius: 14px;
  background: #fff;
  font-weight: 700;
  color: var(--muted);
  transition: all .15s ease;
}
.choice-pill input:checked + span { border-color: var(--blush-deep); background: #fbefef; color: var(--ink); box-shadow: 0 0 0 3px rgba(201, 143, 145, .1); }

.attendance-choice-row { align-items: stretch; }
.attendance-choice span {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.attendance-choice span strong { font-size: 1rem; color: inherit; }
.attendance-choice span small { font-size: .78rem; font-weight: 600; opacity: .72; }
.count-section { transition: opacity .15s ease; }

.family-header { display: flex; justify-content: space-between; gap: 18px; align-items: end; border-top: 1px solid var(--line); padding-top: 24px; }
.family-header h3 { margin: 3px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; font-weight: 500; }
.members-list { display: grid; gap: 12px; }
.member-card { background: #fbf7f4; border: 1px solid var(--line); padding: 18px; border-radius: 18px; }
.member-topline { display: flex; justify-content: space-between; margin-bottom: 12px; align-items: center; }
.member-number { font-size: .82rem; font-weight: 800; color: var(--sage-deep); text-transform: uppercase; letter-spacing: .08em; }
.remove-member { border: 0; background: transparent; color: var(--danger); font-weight: 750; padding: 5px 0; }
.empty-members { text-align: center; color: var(--muted); background: #fbf8f6; border: 1px dashed #dfd1cc; padding: 18px; border-radius: 16px; margin: 0; }

.primary-button, .secondary-button {
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.primary-button { color: #fff; background: linear-gradient(135deg, #67a9d7, #e482b8); box-shadow: 0 10px 25px rgba(96, 110, 144, .18); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(73, 59, 66, .2); }
.secondary-button { color: var(--ink); background: #fff; border-color: #d9cbc7; }
.secondary-button:hover { background: #fbf5f2; }
.danger-button {
  border: 1px solid #e4b9bf;
  background: #fff5f6;
  color: var(--danger);
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 800;
  white-space: nowrap;
}
.danger-button:hover { background: #fdebed; }
.danger-button:disabled { opacity: .6; cursor: wait; }
.full-button { width: 100%; padding: 15px 18px; font-size: 1rem; }
.link-button { text-decoration: none; display: inline-flex; justify-content: center; align-items: center; }

.privacy-note { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); padding: 14px 16px; background: rgba(220, 233, 255, .5); border-radius: 14px; }
.privacy-note span { color: var(--sage-deep); font-size: 1.15rem; }
.privacy-note p { margin: 0; font-size: .86rem; line-height: 1.55; }

.notice { border-radius: 14px; padding: 13px 15px; font-size: .9rem; line-height: 1.5; border: 1px solid; }
.notice.success { color: #3e6149; background: #eff7f0; border-color: #c9ddcc; }
.notice.error { color: #88484f; background: #fff1f2; border-color: #ebc7ca; }
.notice.info { color: #5d5969; background: #f4f2f9; border-color: #dad5ea; }
.page-footer { text-align: center; padding: 28px 0 0; color: #9a858c; font-size: .85rem; }

/* Admin */
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 54px 0 60px; }
.admin-header { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; margin-bottom: 30px; }
.admin-header h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
.admin-header p { margin: 0; color: var(--muted); }
.admin-login-card { max-width: 520px; padding: 30px; margin: 40px auto; }
.pin-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-card { background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: 0 8px 30px rgba(73, 59, 66, .06); }
.summary-card span { display: block; color: var(--muted); font-size: .78rem; font-weight: 750; margin-bottom: 8px; }
.summary-card strong { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-weight: 500; }
.admin-actions-card { padding: 26px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: center; margin-bottom: 18px; }
.admin-action-copy h2 { font-size: 2rem; }
.upload-form { display: flex; gap: 10px; align-items: center; }
.file-picker { display: inline-flex; align-items: center; border: 1px dashed #d4c3be; border-radius: 14px; padding: 12px 15px; background: #fbf7f4; color: var(--muted); font-weight: 650; cursor: pointer; max-width: 280px; }
.file-picker input { display: none; }
.file-picker span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-actions-card .notice { grid-column: 1 / -1; }
.responses-card { padding: 26px; }
.responses-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 18px; }
.responses-toolbar h2 { margin-bottom: 0; font-size: 2.25rem; }
.toolbar-actions { display: flex; gap: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
.responses-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.responses-table th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; background: #fbf7f5; }
.responses-table th, .responses-table td { padding: 15px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.responses-table tbody tr:last-child td { border-bottom: 0; }
.responses-table td { font-size: .9rem; }
.guest-stack { display: grid; gap: 3px; }
.guest-chip { display: inline-block; width: fit-content; padding: 4px 8px; border-radius: 999px; background: #f2ece9; color: var(--ink); font-size: .78rem; }
.guest-chip.yes { background: #edf4ec; color: #506b55; }
.guest-chip.no { background: #f9eded; color: #8d5157; }
.empty-table { padding: 30px; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-actions-card { grid-template-columns: 1fr; }
  .upload-form { flex-wrap: wrap; }
}

@media (max-width: 720px) {
  .event-highlights { grid-template-columns: 1fr; }
  .date-time-row { justify-content: center; }
  .page-shell { width: min(100% - 20px, 920px); padding-top: 44px; }
  .hero { margin-bottom: 28px; }
  .two-col, .choice-row, .member-grid { grid-template-columns: 1fr; }
  .family-header { align-items: flex-start; flex-direction: column; }
  .family-header .secondary-button { width: 100%; }
  .invitation-card { padding: 12px; }
  .invitation-viewer iframe { min-height: 560px; }
  .admin-shell { width: min(100% - 20px, 1180px); padding-top: 34px; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .admin-header .link-button { width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .responses-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pin-form { grid-template-columns: 1fr; }
}


/* RSVP calendar prompt */
.calendar-prompt {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(42, 50, 70, .42);
  backdrop-filter: blur(5px);
}
.calendar-prompt-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(52, 64, 90, .25);
}
.calendar-check {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #edf6ef;
  color: #4f7558;
  font-size: 1.55rem;
  font-weight: 900;
}
.calendar-prompt-card h2 {
  margin: 6px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--ink);
}
.calendar-prompt-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.65;
}
.calendar-provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.calendar-provider-button {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  font-weight: 750;
  line-height: 1.25;
}
.calendar-provider-button:hover {
  background: #f7faff;
  border-color: #cbd8ec;
}
.calendar-provider-button:focus-visible {
  outline: 3px solid rgba(103, 169, 215, .28);
  outline-offset: 2px;
}
.calendar-provider-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e7ebf2;
}
.calendar-provider-mark img {
  display: block;
  width: 23px;
  height: 23px;
  object-fit: contain;
}
.calendar-provider-note {
  margin: 12px 0 0 !important;
  font-size: .79rem;
  line-height: 1.45 !important;
}
.calendar-not-now {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
}
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .calendar-prompt-card { padding: 26px 20px; }
  .calendar-provider-grid { grid-template-columns: 1fr; }
}
