:root {
  --bg: #25060f;
  --bg-deep: #140308;
  --bg-soft: #3c0c18;
  --panel: rgba(85, 16, 35, 0.78);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.08);
  --text: #fffafc;
  --text-dark: #2b0a14;
  --muted: rgba(255, 238, 244, 0.78);
  --line: rgba(255, 255, 255, 0.14);
  --accent: #7a1029;
  --accent-strong: #5a091d;
  --accent-soft: rgba(255, 255, 255, 0.12);
  --success-bg: rgba(255, 255, 255, 0.1);
  --success-text: #ffffff;
  --error-bg: rgba(255, 220, 227, 0.14);
  --error-text: #fff0f4;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(178, 39, 74, 0.28), transparent 30%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(135deg, var(--bg-deep) 0%, var(--bg) 48%, var(--bg-soft) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
  display: grid;
  gap: 18px;
}

.public-shell {
  width: 100%;
  padding: 0 0 64px;
  gap: 0;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-panel {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: #120207;
}

.public-shell .hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(18, 2, 7, 0.2) 0%, rgba(18, 2, 7, 0.48) 55%, rgba(18, 2, 7, 0.76) 100%),
    linear-gradient(90deg, rgba(18, 2, 7, 0.24) 0%, rgba(18, 2, 7, 0.08) 45%, rgba(18, 2, 7, 0.3) 100%);
}

.hero-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  z-index: 2;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.12), transparent 66%);
  filter: blur(44px);
}

.hero-overlay {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 88px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

.hero-names {
  font-family: Baskerville, "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(3rem, 9vw, 7.4rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 0 16px 42px rgba(0, 0, 0, 0.4);
}

.intro-text,
.section-text {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 64ch;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 240, 245, 0.84);
  font-weight: 700;
}

.hero-portrait {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  width: 100%;
  height: 100%;
}

.hero-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.form-panel {
  width: min(960px, calc(100% - 32px));
  margin: -96px auto 0;
  position: relative;
  z-index: 4;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 45%),
    rgba(59, 8, 22, 0.88);
}

.form-header {
  margin-bottom: 18px;
}

.form-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: #ffffff;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.field-disabled {
  opacity: 0.55;
}

.field label,
.field legend {
  font-weight: 700;
  font-size: 0.98rem;
  color: rgba(255, 247, 249, 0.94);
}

.text-input,
.field textarea,
.field select,
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  padding: 15px 16px;
  font: inherit;
  color: var(--text-dark);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

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

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(61, 18, 31, 0.52);
}

.field select:disabled,
.field textarea:disabled,
.field input:disabled {
  cursor: not-allowed;
}

.text-input:focus,
.field textarea:focus,
.field select:focus,
.field input:focus {
  outline: none;
  border-color: rgba(122, 16, 41, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.radio-option input {
  accent-color: #ffffff;
}

.guest-menus-section {
  display: grid;
  gap: 14px;
  margin-top: -2px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.guest-menus-title {
  font-size: 1.15rem;
  color: #ffffff;
}

.guest-menus-note {
  margin: 0;
  color: rgba(255, 238, 244, 0.78);
  line-height: 1.5;
}

.guest-menus-grid {
  display: grid;
  gap: 14px;
}

.guest-menu-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.guest-menu-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.guest-menu-name {
  min-width: 0;
}

.guest-menu-options {
  display: flex;
  justify-content: flex-end;
}

.guest-menu-options .radio-group {
  justify-content: flex-end;
}

.field-hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.button-primary,
.button-secondary,
#rsvp-form button {
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

.button-primary,
#rsvp-form button {
  background: linear-gradient(135deg, #ffffff 0%, #f3dfe6 100%);
  color: var(--accent-strong);
  box-shadow: 0 18px 28px rgba(0, 0, 0, 0.25);
}

#rsvp-form button {
  color: #fff;
  background: linear-gradient(135deg, #8e1b37 0%, #5a091d 100%);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  text-decoration: none;
  border: 1px solid var(--line);
}

.button-primary:hover,
.button-secondary:hover,
#rsvp-form button:hover {
  transform: translateY(-1px);
}

.button-primary:disabled,
#rsvp-form button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.notice {
  margin-top: 18px;
  border-radius: 18px;
  padding: 14px 16px;
  line-height: 1.55;
}

.notice.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.notice.error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid rgba(255, 214, 224, 0.2);
}

.notice ul {
  margin: 0;
  padding-left: 18px;
}

.inline-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.45rem;
  margin-bottom: 8px;
}

.stats-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.stat-card,
.sub-panel {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.sub-panel h3 {
  margin-bottom: 10px;
}

.stat-label {
  color: rgba(255, 237, 243, 0.74);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.status-confirmed {
  background: rgba(46, 133, 86, 0.22);
  color: #d8ffea;
}

.status-declined {
  background: rgba(176, 63, 83, 0.24);
  color: #ffe3ea;
}

.status-pending {
  background: rgba(255, 255, 255, 0.08);
  color: #fff7fa;
}

.qr-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.code-block {
  overflow-wrap: anywhere;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.92rem;
  color: #ffffff;
}

.qr-image {
  width: min(220px, 100%);
  aspect-ratio: 1;
  display: block;
  background: #fff;
  border-radius: 22px;
  padding: 14px;
  border: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

thead th {
  text-align: left;
  font-size: 0.92rem;
  color: rgba(255, 235, 241, 0.74);
  border-bottom: 1px solid var(--line);
  padding: 0 12px 14px 0;
}

tbody td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
  line-height: 1.5;
  color: rgba(255, 250, 252, 0.94);
}

.submit-wrap {
  margin-top: 8px;
}

@media (max-width: 720px) {
  .page-shell,
  .admin-shell {
    width: min(100% - 20px, 100%);
    padding: 20px 0 40px;
  }

  .panel {
    padding: 22px 18px;
    border-radius: 24px;
  }

  .public-shell {
    padding-bottom: 40px;
  }

  .public-shell .hero-panel {
    min-height: 78vh;
  }

  .hero-overlay {
    min-height: 78vh;
    padding: 28px 18px 56px;
  }

  .hero-names {
    font-size: clamp(2.5rem, 12vw, 4.3rem);
  }

  .form-panel {
    width: min(100% - 20px, 100%);
    margin-top: -54px;
  }

  .guest-menu-row {
    grid-template-columns: 1fr;
  }

  .guest-menu-options {
    justify-content: flex-start;
  }

  .inline-form {
    flex-direction: column;
  }

  .inline-form .text-input,
  .inline-form button {
    width: 100%;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .button-primary,
  .toolbar-actions .button-secondary {
    flex: 1 1 100%;
    text-align: center;
  }

  .qr-grid {
    grid-template-columns: 1fr;
  }

  .code-block {
    font-size: 0.86rem;
  }

  table {
    min-width: 720px;
  }
}
