:root {
  --pink-50: #fff4f8;
  --pink-100: #ffe3ed;
  --pink-200: #ffc7da;
  --green-50: #f2fff6;
  --green-100: #dff7e7;
  --green-200: #bfe9cf;
  --green-600: #4f9c67;
  --text: #314039;
  --muted: #718078;
  --white: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 70px rgba(93, 72, 80, 0.18);
  --radius: 28px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--pink-200), transparent 34rem),
    radial-gradient(circle at bottom right, var(--green-200), transparent 34rem),
    linear-gradient(135deg, var(--pink-50), var(--green-50));
}

button, input { font: inherit; }
button { cursor: pointer; }

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

.hidden { display: none !important; }
.card, .hero-card, .stat-card {
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: var(--white);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card { border-radius: var(--radius); padding: 28px; }
.login-card { max-width: 440px; margin: 12vh auto 0; }
.brand-mark { font-size: 2.5rem; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.06em; }
h2 { margin-bottom: 14px; font-size: 1.35rem; }
.muted { color: var(--muted); line-height: 1.5; }
.eyebrow { margin-bottom: 8px; color: var(--green-600); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.78rem; }

.stack-form, .guest-form { display: grid; gap: 14px; }
label { font-weight: 750; }
input[type="text"], input[type="password"], input[type="search"] {
  width: 100%;
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 15px 17px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(49, 64, 57, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
input:focus {
  border-color: var(--green-200);
  box-shadow: 0 0 0 5px rgba(191, 233, 207, 0.45);
  transform: translateY(-1px);
}

button[type="submit"], .ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 850;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}
button[type="submit"] {
  color: #244032;
  background: linear-gradient(135deg, var(--green-200), var(--pink-200));
  box-shadow: 0 12px 28px rgba(79, 156, 103, 0.18);
}
button:hover { transform: translateY(-2px); }
button:active { transform: translateY(0); }
.ghost-button { background: rgba(255, 255, 255, 0.65); color: var(--text); }

.error-text, .success-text { min-height: 20px; margin: 0; font-weight: 700; }
.error-text { color: #b84f6a; }
.success-text { color: var(--green-600); }

.app-layout { display: grid; gap: 20px; }
.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-radius: calc(var(--radius) + 8px);
  padding: 32px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card { border-radius: 24px; padding: 20px; }
.stat-card span { display: block; font-size: 2.1rem; font-weight: 900; letter-spacing: -0.05em; }
.stat-card label { color: var(--muted); font-size: 0.92rem; }
.content-grid { display: grid; grid-template-columns: 0.88fr 1.12fr; gap: 20px; align-items: start; }

.checkbox-grid { display: grid; gap: 12px; margin: 4px 0; }
.pretty-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 227, 237, 0.62), rgba(223, 247, 231, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.pretty-check:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(93, 72, 80, 0.1); }
.pretty-check input { position: absolute; opacity: 0; pointer-events: none; }
.check-ui {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--green-600);
  background: rgba(255,255,255,.75);
  display: grid;
  place-items: center;
}
.pretty-check input:checked + .check-ui { background: var(--green-600); }
.pretty-check input:checked + .check-ui::after { content: "✓"; color: white; font-weight: 900; }

.list-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.search-input { margin-bottom: 14px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filter-tag {
  border: 1px solid rgba(49, 64, 57, 0.1);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.68);
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.filter-tag.active { background: linear-gradient(135deg, var(--pink-200), var(--green-200)); box-shadow: 0 12px 24px rgba(93, 72, 80, 0.12); }
.guest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.guest-item {
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(49, 64, 57, 0.07);
  animation: popIn 220ms ease both;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.guest-item:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(93, 72, 80, 0.12); }
.guest-summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.guest-name { font-weight: 900; font-size: 1.05rem; }
.chevron { color: var(--muted); transition: transform 160ms ease; }
.guest-item.open .chevron { transform: rotate(180deg); }
.guest-events {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.guest-item.open .guest-events { display: flex; }
.event-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  background: var(--pink-100);
  color: #7c4254;
}
.event-pill:nth-child(even) { background: var(--green-100); color: #3f7651; }
.empty-state { display: none; margin: 20px 0 0; text-align: center; color: var(--muted); font-weight: 800; }
.empty-state.visible { display: block; }

.fade-in { animation: fadeIn 320ms ease both; }
.slide-up { animation: slideUp 360ms ease both; }
@keyframes fadeIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 820px) {
  .page-shell { width: min(100% - 18px, 1120px); padding-top: 12px; }
  .hero-card { flex-direction: column; align-items: stretch; padding: 24px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .card { padding: 22px; }
}

.guest-main {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
}

.guest-details {
  display: none;
  margin-top: 12px;
}

.guest-item.open .guest-details {
  display: block;
}

.guest-item.open .guest-chevron {
  transform: rotate(180deg);
}

.guest-chevron {
  transition: transform 0.2s ease;
}

.removable-role {
  cursor: pointer;
  border: none;
}

.pill-x {
  margin-left: 6px;
  font-weight: 800;
}

.remove-guest-btn {
  margin-top: 12px;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  background: #ffd6dc;
  color: #8a1f35;
  font-weight: 700;
  cursor: pointer;
}

.remove-guest-btn:hover {
  filter: brightness(0.96);
}

.add-role {
  opacity: 0.65;
  border: 1px dashed rgba(90, 120, 90, 0.45);
  background: transparent;
  cursor: pointer;
}

.add-role:hover {
  opacity: 1;
  background: rgba(210, 245, 220, 0.65);
}

.guest-section {
  margin-top: 14px;
}

.guest-section-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #6f8176;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.guest-tag-editor {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.guest-tag-input {
    flex: 1;
    min-width: 0;
}

.add-tags-btn {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;

    padding: 10px 18px;
    border: none;
    border-radius: 999px;

    background: #d9f5df;
    color: #2f6b45;
    font-weight: 700;
    cursor: pointer;

    transition: all .2s ease;
}

.add-tags-btn:hover {
    background: #cbeed3;
    transform: translateY(-1px);
}

.guest-tag-input {
  flex: 1;
}

.add-tags-btn {
  background: #d9f5df;
  color: #2f6b45;
  border: none;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.add-tags-btn:hover {
  filter: brightness(0.97);
}

.guest-name-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.name-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #dff2ff;
  color: #31637d;
  font-size: 0.75rem;
  font-weight: 800;
}

.rsvp-checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #d9f5df;
  color: #2f6b45;
  font-weight: 900;
}