:root {
  --bg: #f8f1e8;
  --bg-accent: #eadcc8;
  --card: rgba(255, 250, 245, 0.84);
  --text: #2d241f;
  --muted: #6e5d52;
  --line: rgba(90, 67, 53, 0.18);
  --accent: #8d5a44;
  --accent-strong: #6d3f2f;
  --success: #2d6a4f;
  --error: #9f2d2d;
  --shadow: 0 24px 60px rgba(68, 41, 27, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 32%),
    radial-gradient(circle at bottom right, rgba(201, 168, 144, 0.28), transparent 24%),
    linear-gradient(135deg, var(--bg), var(--bg-accent));
  overflow-x: hidden;
}

.page-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding-block: clamp(20px, 5.2vw, 72px);
  padding-inline: clamp(10px, 3vw, 22px);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 3vw, 30px);
  align-items: start;
  position: relative;
  z-index: 1;
}

.hero-card,
.form-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  width: 100%;
}

.hero-card {
  max-width: 100%;
  padding-block: clamp(14px, 4vw, 48px) clamp(8px, 2vw, 18px);
  padding-inline: clamp(4px, 1vw, 14px);
  text-align: center;
}

.hero-card::after {
  content: none;
}

.eyebrow {
  margin: 0 0 clamp(14px, 3.2vw, 22px);
  letter-spacing: clamp(0.22em, 0.55vw, 0.42em);
  text-transform: uppercase;
  font-family: 'Cinzel', serif;
  font-size: clamp(0.74rem, 2.4vw, 1.12rem);
  color: rgba(110, 93, 82, 0.86);
}

.hero-title {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.45rem, 13.5vw, 6.8rem);
  line-height: 0.92;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #382b24;
  text-wrap: balance;
}

.hero-ampersand {
  display: inline-block;
  margin: 0 0.14em;
  font-family: 'Parisienne', cursive;
  font-size: 1.1em;
  font-weight: 400;
  color: var(--accent);
  transform: translateY(-0.04em);
}

.hero-details,
.hero-invite {
  display: grid;
  gap: clamp(8px, 2vw, 12px);
}

.hero-details {
  margin-top: clamp(16px, 4vw, 30px);
}

.event-meta,
.intro,
.deadline-text {
  margin: 0;
  color: var(--muted);
}

.event-meta {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.95rem, 3.6vw, 1.3rem);
  letter-spacing: clamp(0.03em, 0.25vw, 0.08em);
  text-transform: uppercase;
}

.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.8vw, 18px);
  margin: clamp(22px, 5vw, 38px) auto clamp(18px, 4vw, 30px);
  max-width: 560px;
}

.hero-divider span {
  display: block;
}

.hero-divider span:not(.divider-heart) {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(141, 90, 68, 0),
    rgba(141, 90, 68, 0.45),
    rgba(141, 90, 68, 0)
  );
}

.divider-heart {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.2rem, 5.3vw, 2rem);
  line-height: 1;
  color: var(--accent);
  transform: translateY(-1px);
}

.intro {
  color: var(--text);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(1.35rem, 6.2vw, 2rem);
  line-height: 1.06;
}

.deadline-text {
  font-size: clamp(0.92rem, 3.3vw, 1.02rem);
  letter-spacing: clamp(0.01em, 0.16vw, 0.04em);
  color: var(--accent-strong);
  font-weight: 600;
}

.form-card {
  width: min(860px, 100%);
  margin-inline: auto;
  padding: 0;
}

.rsvp-form {
  display: grid;
  gap: clamp(14px, 2.1vw, 22px);
  background: rgba(255, 250, 245, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: clamp(18px, 4.3vw, 30px);
  box-shadow: var(--shadow);
  padding: clamp(16px, 4.2vw, 34px);
}

.field-group {
  display: grid;
  gap: 8px;
}

label,
legend {
  font-size: clamp(0.94rem, 2.8vw, 0.98rem);
  font-weight: 600;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-size: 16px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

textarea {
  min-height: 124px;
  resize: vertical;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

.custom-select-trigger {
  width: 100%;
  min-height: 50px;
  padding: 12px 56px 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  text-align: left;
  font-size: 16px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  cursor: pointer;
}

.custom-select-trigger::after {
  content: '';
  width: 9px;
  height: 9px;
  position: absolute;
  right: 20px;
  top: 50%;
  border-right: 2px solid rgba(45, 36, 31, 0.8);
  border-bottom: 2px solid rgba(45, 36, 31, 0.8);
  transform: translateY(-62%) rotate(45deg);
  transition: transform 170ms ease;
  pointer-events: none;
}

.custom-select.is-open .custom-select-trigger::after {
  transform: translateY(-28%) rotate(-135deg);
}

.custom-select-trigger.is-placeholder {
  color: rgba(110, 93, 82, 0.95);
}

.custom-select-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(260px, 45vh);
  overflow-y: auto;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(141, 90, 68, 0.2);
  background: rgba(255, 252, 249, 0.98);
  box-shadow: 0 20px 36px rgba(68, 41, 27, 0.18);
  z-index: 80;
}

.custom-select-option {
  width: 100%;
  display: block;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 11px 12px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  font-size: clamp(0.95rem, 2.8vw, 1rem);
  line-height: 1.35;
  position: relative;
}

.custom-select-option.is-selected {
  background: rgba(141, 90, 68, 0.14);
  font-weight: 700;
  padding-left: 32px;
}

.custom-select-option.is-selected::before {
  content: '✓';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-strong);
  font-weight: 700;
}

.custom-select-option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.custom-select.is-disabled .custom-select-trigger {
  opacity: 0.65;
  cursor: not-allowed;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(141, 90, 68, 0.12);
}

.custom-select-trigger:focus-visible,
.custom-select-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(141, 90, 68, 0.12);
}

.attendance-box {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
}

.choice-card input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.choice-card span {
  font-size: clamp(0.95rem, 3vw, 1.02rem);
  line-height: 1.4;
}

.attendance-details {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(141, 90, 68, 0.16);
}

.hidden {
  display: none;
}

.guest-fields {
  display: grid;
  gap: 12px;
}

.guest-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 249, 0.92);
}

.guest-card h3 {
  margin: 0 0 10px;
  font-size: clamp(0.95rem, 3.2vw, 1rem);
}

.guest-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.guest-card-grid-single {
  grid-template-columns: 1fr;
}

.submit-button {
  border: 0;
  border-radius: 999px;
  width: 100%;
  min-height: 50px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fffaf6;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(109, 63, 47, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.form-message {
  min-height: 22px;
  margin: 0;
  font-size: clamp(0.9rem, 2.8vw, 0.98rem);
  font-weight: 600;
}

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

.form-message.error {
  color: var(--error);
}

.single-column {
  grid-template-columns: 1fr;
  max-width: 980px;
}

.compact-card {
  padding-bottom: clamp(6px, 1.6vw, 16px);
}

.single-column .form-card {
  width: 100%;
}

.admin-shell {
  max-width: 1000px;
}

.admin-panel {
  width: min(880px, 100%);
  margin-inline: auto;
}

.admin-login-form {
  max-width: 540px;
  margin-inline: auto;
}

.admin-subtitle {
  margin-top: 14px;
}

.admin-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-header h2 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 6vw, 2rem);
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-weight: 600;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.responses-list {
  display: grid;
  gap: 12px;
}

.response-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 249, 0.92);
}

.response-card h3,
.response-card p {
  margin: 0;
}

.response-card p {
  margin-top: 8px;
  color: var(--muted);
  word-break: break-word;
}

.response-topline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.response-topline h3 {
  font-size: clamp(1.08rem, 4.9vw, 1.3rem);
  overflow-wrap: anywhere;
}

.response-topline span {
  color: var(--muted);
  font-size: 0.9rem;
}

.guest-summary {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.guest-summary li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(90, 67, 53, 0.1);
}

.guest-summary li span {
  color: var(--muted);
}

.empty-state {
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 252, 249, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
}

@media (min-width: 480px) {
  .page-shell {
    padding-inline: clamp(14px, 4vw, 24px);
  }

  .rsvp-form {
    padding: clamp(20px, 4.5vw, 34px);
  }

  .guest-card,
  .response-card {
    padding: 16px;
  }

  .custom-select-trigger {
    padding-right: 58px;
  }
}

@media (min-width: 760px) {
  .guest-card-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 14px;
  }

  .admin-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .admin-actions .secondary-button {
    width: auto;
    min-width: 124px;
  }

  .response-topline {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
  }

  .guest-summary li {
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
  }
}

@media (min-width: 980px) {
  .hero-card {
    padding-top: clamp(34px, 4.2vw, 54px);
  }

  .rsvp-form {
    gap: 20px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 34px rgba(109, 63, 47, 0.28);
  }

  .secondary-button:hover {
    transform: translateY(-1px);
    border-color: rgba(90, 67, 53, 0.3);
    box-shadow: 0 10px 20px rgba(68, 41, 27, 0.1);
  }

  .custom-select-option:hover {
    background: rgba(141, 90, 68, 0.1);
  }
}

@media (max-width: 360px) {
  .page-shell {
    padding-inline: 8px;
    gap: 14px;
  }

  .eyebrow {
    letter-spacing: 0.16em;
  }

  .rsvp-form {
    padding: 14px;
  }

  .attendance-details {
    padding: 12px;
  }

  .custom-select-trigger {
    padding-right: 52px;
  }

  .custom-select-trigger::after {
    right: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
