:root {
  --bg: #fff7f4;
  --ink: #3c2730;
  --muted: #7c6470;
  --line: #ead2da;
  --paper: #fffdfa;
  --accent: #c94e78;
  --accent-strong: #a9365c;
  --green: #5f8f77;
  --blue: #75608d;
  --gold: #bf9651;
  --shadow: 0 24px 80px rgba(86, 48, 61, 0.24);
  --display-font: "Great Vibes", "Snell Roundhand", "Apple Chancery",
    "Brush Script MT", cursive;
  --soft-font: "Quicksand", "Avenir Next Rounded", "Trebuchet MS", sans-serif;
  --body-font: "Quicksand", "Avenir Next", Inter, ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--body-font);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.invite-page {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: start center;
  padding: clamp(430px, 50vh, 620px) 18px 44px;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--ink);
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.invite-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.invite-content {
  position: relative;
  z-index: 1;
  width: min(740px, calc(100vw - 44px));
  margin-bottom: 0;
  padding: clamp(22px, 3.2vw, 34px) clamp(24px, 4.5vw, 50px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 250, 252, 0.16);
  box-shadow: 0 20px 60px rgba(70, 34, 50, 0.18);
  text-align: center;
  text-shadow: none;
  backdrop-filter: blur(2px) saturate(1.02);
  -webkit-backdrop-filter: blur(2px) saturate(1.02);
}

.invite-content::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(191, 150, 81, 0.26);
  border-radius: 6px;
  pointer-events: none;
}

.invite-content::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background:
    linear-gradient(to top, rgba(255, 250, 252, 0.36), transparent 72%),
    var(--floral-image) center bottom / cover no-repeat;
  opacity: 0.3;
  filter: saturate(1.18);
  pointer-events: none;
}

.invite-content > * {
  position: relative;
  z-index: 2;
}

.theme-butterfly {
  position: absolute;
  z-index: 1;
  width: 58px;
  height: auto;
  fill: rgba(201, 78, 120, 0.24);
  stroke: rgba(166, 54, 92, 0.3);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.butterfly-left {
  left: 44px;
  top: 102px;
  transform: rotate(-18deg);
}

.butterfly-right {
  right: 48px;
  top: 168px;
  transform: rotate(16deg) scale(0.82);
}

.event-kicker {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--soft-font);
  font-size: clamp(1.02rem, 2.1vw, 1.24rem);
  font-weight: 600;
  line-height: 1.35;
  text-transform: none;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.78);
}

.event-pretitle {
  margin: 0 0 14px;
  color: var(--accent);
  font-family: var(--soft-font);
  font-size: clamp(1.48rem, 3.1vw, 2rem);
  font-weight: 600;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.86),
    0 2px 0 rgba(191, 150, 81, 0.2);
}

.invite-title {
  margin: 0 0 8px;
  color: #bd4d76;
  font-family: var(--display-font);
  font-size: clamp(5.5rem, 10vw, 7.5rem);
  font-style: normal;
  font-weight: 400;
  line-height: 0.82;
  -webkit-text-stroke: 0;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.96),
    0 2px 0 rgba(191, 150, 81, 0.32),
    0 11px 18px rgba(96, 48, 64, 0.16);
}

.event-age {
  width: fit-content;
  margin: 8px auto 14px;
  border: 1px solid rgba(191, 150, 81, 0.62);
  border-radius: 999px;
  padding: 5px 28px 7px;
  color: var(--accent);
  background: rgba(255, 245, 241, 0.34);
  font-family: var(--soft-font);
  font-size: clamp(1.36rem, 2.8vw, 1.78rem);
  font-style: italic;
  font-weight: 800;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.78);
}

.event-copy {
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid rgba(191, 150, 81, 0.34);
  border-radius: 8px;
  padding: 10px 18px;
  color: #452b36;
  background: rgba(255, 255, 255, 0.42);
  font-family: var(--soft-font);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.34;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.86),
    0 6px 18px rgba(255, 255, 255, 0.32);
}

.event-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(650px, 100%);
  margin: 16px auto 14px;
  border-block: 2px dotted rgba(191, 150, 81, 0.42);
  padding: 10px 0;
  list-style: none;
}

.event-meta li {
  min-height: 112px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  justify-items: center;
  gap: 5px;
  border: 1px solid rgba(201, 78, 120, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  color: #573143;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  font-family: var(--soft-font);
  font-size: 1.02rem;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.74);
}

.event-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(201, 78, 120, 0.28);
  border-radius: 50%;
  color: var(--accent);
  background: rgba(255, 234, 241, 0.36);
}

.event-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.event-label {
  color: var(--accent);
  font-family: var(--soft-font);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.event-meta strong {
  color: #5a3142;
  font: inherit;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.14;
}

.event-meta li:last-child:nth-child(3) strong {
  font-size: 1.05rem;
  line-height: 1.16;
}

.rsvp-note {
  width: min(610px, 100%);
  margin: 0 auto 14px;
  border: 1px solid rgba(201, 78, 120, 0.22);
  border-radius: 8px;
  padding: 10px 16px;
  color: #4f2e3a;
  background: rgba(255, 255, 255, 0.34);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

.gift-line {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--soft-font);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  font-weight: 800;
}

.deadline-line {
  max-width: 520px;
  margin: 0 auto;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.primary-button {
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 0 28px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 14px 28px rgba(201, 78, 120, 0.3);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-strong);
}

.modal {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid rgba(191, 150, 81, 0.36);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(45, 28, 38, 0.54);
}

.modal-shell {
  padding: 24px;
  background:
    linear-gradient(rgba(255, 253, 250, 0.93), rgba(255, 253, 250, 0.96)),
    var(--floral-image);
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: cover;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.modal-title {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 1.55rem;
  line-height: 1.15;
}

.modal-subtitle {
  margin: 0;
  color: var(--muted);
}

.icon-button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.confirm-form {
  display: grid;
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label,
.participants-label {
  font-size: 0.9rem;
  font-weight: 750;
}

.form-field input,
.participant-row input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

.form-field input:focus,
.participant-row input:focus {
  outline: 3px solid rgba(201, 78, 120, 0.18);
  border-color: var(--accent);
}

.participants-block {
  display: grid;
  gap: 9px;
}

.participants-list {
  display: grid;
  gap: 8px;
}

.participant-row {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 8px;
  align-items: center;
}

.secondary-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: #6d4b75;
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
  font-weight: 750;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--blue);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.submit-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font-weight: 800;
}

.submit-button:hover,
.submit-button:focus-visible {
  background: #23785d;
}

.form-result {
  min-height: 22px;
  margin: 0;
  font-weight: 700;
}

.form-result.success {
  color: var(--green);
}

.form-result.error {
  color: var(--accent-strong);
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.admin-page {
  min-height: 100vh;
  padding: 24px;
  background: #f4f7f8;
}

.admin-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-title {
  margin: 0;
  font-size: 1.85rem;
}

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

.link-button,
.logout-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  cursor: pointer;
  font-weight: 750;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--paper);
}

.summary-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-value {
  margin: 0;
  color: var(--blue);
  font-size: 2rem;
  font-weight: 850;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.participants-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef4f8;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f7fafc, #e9f0f4);
}

.login-box {
  width: min(380px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
}

.login-title {
  margin: 0 0 16px;
}

.flash {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-weight: 700;
}

@media (max-width: 640px) {
  .invite-page {
    align-items: start;
    padding: clamp(430px, 54svh, 560px) 14px calc(22px + env(safe-area-inset-bottom));
  }

  .invite-content {
    width: min(360px, 100%);
    margin-bottom: 0;
    padding: 18px 14px;
  }

  .invite-title {
    font-size: 4.45rem;
  }

  .event-pretitle {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }

  .event-copy {
    font-size: 0.88rem;
    padding: 6px 10px;
  }

  .event-meta li {
    min-height: 50px;
    grid-template-columns: 38px 68px 1fr;
    justify-items: stretch;
    align-items: center;
    gap: 7px;
    padding: 6px 5px;
    font-size: 0.9rem;
    text-align: left;
  }

  .event-icon {
    width: 32px;
    height: 32px;
  }

  .event-icon svg {
    width: 19px;
    height: 19px;
  }

  .event-label {
    font-size: 0.66rem;
  }

  .event-age {
    margin-bottom: 10px;
    font-size: 1.2rem;
  }

  .event-meta {
    grid-template-columns: 1fr;
    margin-bottom: 18px;
    padding: 0;
    gap: 0;
  }

  .event-meta li {
    border: 0;
    border-bottom: 1px dotted rgba(191, 150, 81, 0.34);
    border-radius: 0;
  }

  .event-meta li:last-child {
    border-bottom: 0;
  }

  .event-meta strong {
    font-size: 1rem;
  }

  .event-meta li:last-child:nth-child(3) strong {
    font-size: 0.95rem;
  }

  .rsvp-note {
    margin-bottom: 12px;
    padding: 8px 10px;
  }

  .gift-line {
    font-size: 1rem;
  }

  .deadline-line {
    font-size: 0.8rem;
  }

  .primary-button {
    width: 100%;
  }

  .modal-shell {
    padding: 18px;
  }

  .form-actions {
    display: grid;
  }

  .admin-page {
    padding: 16px;
  }

  .admin-header,
  .summary-grid {
    display: grid;
  }
}
