:root {
  --bg0: #e8f4f8;
  --bg1: #f7fbfc;
  --ink: #1a3340;
  --muted: #5a7380;
  --accent: #e85d4c;
  --accent-dark: #c94a3b;
  --teal: #2a9d8f;
  --teal-dark: #1f7a6f;
  --line: rgba(26, 51, 64, 0.12);
  --ok: #2a9d8f;
  --warn: #e9a820;
  --bad: #c94a3b;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(26, 51, 64, 0.08);
  --font: "Nunito", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #ffe8e2 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, #cfeef5 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 40%, #fff);
  background-attachment: fixed;
}

a {
  color: var(--teal-dark);
}

button,
input,
textarea,
select {
  font: inherit;
}

.wrap {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.brand {
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.brand span {
  color: var(--accent);
}

.lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
  max-width: 36rem;
}

.panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.panel + .panel {
  margin-top: 1rem;
}

.panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
}

.tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field-check {
  margin-bottom: 1rem;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.check-label input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--teal);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-teal {
  background: var(--teal);
  color: #fff;
}

.btn-teal:hover {
  background: var(--teal-dark);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-danger {
  background: transparent;
  color: var(--bad);
  border: 1px solid rgba(201, 74, 59, 0.35);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.msg {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--bad);
  min-height: 1.2em;
}

.msg.ok {
  color: var(--ok);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.list li:first-child {
  border-top: none;
  padding-top: 0;
}

.list .meta {
  flex: 1;
  min-width: 12rem;
}

.list .name {
  font-weight: 800;
}

.list .sub {
  color: var(--muted);
  font-size: 0.88rem;
  word-break: break-all;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #eef6f5;
  color: var(--teal-dark);
}

.badge.yes { background: #e5f6f2; color: var(--ok); }
.badge.no { background: #fdeceb; color: var(--bad); }
.badge.later { background: #fff6e0; color: #9a6b00; }
.badge.none { background: #eef1f3; color: var(--muted); }
.badge.free { background: #e5f6f2; color: var(--ok); }
.badge.taken { background: #fdeceb; color: var(--bad); }
.badge.mine { background: #fff6e0; color: #9a6b00; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.hidden {
  display: none !important;
}

/* Invite page */
.invite-hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
  animation: rise 0.7s ease both;
}

.invite-hero .brand {
  font-size: clamp(2rem, 7vw, 3rem);
}

.invite-hero .when,
.invite-hero .where {
  margin: 0.85rem 0 0;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-weight: 700;
  line-height: 1.4;
}

.invite-hero .where {
  margin-top: 0.45rem;
}

.invite-hero .label {
  color: var(--muted);
  font-weight: 800;
  margin-right: 0.25rem;
}

.invite-hero .maps {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 800;
}

.welcome {
  white-space: pre-wrap;
  line-height: 1.55;
  margin: 0;
}

.rsvp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.rsvp-grid .btn {
  width: 100%;
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.rsvp-grid .btn.selected-yes {
  background: var(--ok);
  color: #fff;
  border: none;
}

.rsvp-grid .btn.selected-no {
  background: var(--bad);
  color: #fff;
  border: none;
}

.rsvp-grid .btn.selected-later {
  background: var(--warn);
  color: #1a3340;
  border: none;
}

.wish-toggle {
  width: 100%;
  margin-top: 0.25rem;
}

.wish-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.35s ease, margin 0.35s ease;
  margin-top: 0;
}

.wish-panel.open {
  max-height: 2000px;
  opacity: 1;
  margin-top: 1rem;
}

.wish-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.9rem 0;
  border-top: 1px solid var(--line);
}

.wish-item:first-child {
  border-top: none;
  padding-top: 0;
}

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

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.panel.animate {
  animation: pop 0.45s ease both;
}

@media (max-width: 640px) {
  .rsvp-grid {
    grid-template-columns: 1fr;
  }

  .wrap {
    width: min(920px, calc(100% - 1.25rem));
  }
}
