#rsvp {
  overflow: hidden auto;
  background:
    radial-gradient(circle at 12% 18%, rgba(138,158,133,.15), transparent 27%),
    radial-gradient(circle at 88% 82%, rgba(201,169,110,.14), transparent 28%),
    var(--c-cream);
  text-align: center;
}

#rsvp .section-inner {
  width: min(100%, 620px);
  max-width: 620px;
}

.rsvp-card {
  position: relative;
  padding: calc(clamp(.9rem, 2.2svh, 1.4rem) + 16px) clamp(1.25rem, 6vw, 3.4rem) 16px;
  overflow: hidden;
  border: 1px solid rgba(190,150,78,.68);
  border-radius: clamp(24px, 7vw, 42px) 12px clamp(24px, 7vw, 42px) 12px;
  background:
    radial-gradient(circle, rgba(92,72,40,.07) 0 .45px, transparent .7px) 0 0 / 7px 7px,
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(248,242,230,.97));
  box-shadow: 0 18px 42px rgba(63,61,51,.13), inset 0 0 0 5px rgba(255,255,255,.58);
}

.rsvp-card::before {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(201,169,110,.28);
  border-radius: inherit;
  content: '';
  pointer-events: none;
}

.rsvp-botanical {
  position: absolute;
  z-index: 0;
  width: clamp(92px, 25vw, 150px);
  height: auto;
  color: var(--c-sage);
  opacity: .2;
  pointer-events: none;
}

.rsvp-botanical path,
.rsvp-botanical ellipse {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.rsvp-botanical-top {
  top: -23px;
  left: -21px;
}

.rsvp-botanical-bottom {
  right: -21px;
  bottom: -23px;
  transform: rotate(180deg);
}

.rsvp-card-content {
  position: relative;
  z-index: 1;
}

.rsvp-seal {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto .8rem;
  place-items: center;
  border: 1px solid rgba(201,169,110,.75);
  border-radius: 50%;
  background: rgba(250,247,242,.86);
  color: var(--c-gold);
  font-family: var(--f-serif);
  font-size: .72rem;
  box-shadow: 0 0 0 4px rgba(201,169,110,.1);
}

#rsvp .label {
  margin-bottom: .45rem;
  text-align: center;
}

#rsvp .title {
  margin-bottom: .7rem;
  color: var(--c-sage-dark);
  text-align: center;
}

.rsvp-flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  margin: 0 auto clamp(.75rem, 2svh, 1.15rem);
  color: var(--c-gold);
  font-size: .55rem;
}

.rsvp-flourish::before,
.rsvp-flourish::after {
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,.8));
  content: '';
}

.rsvp-flourish::after { transform: scaleX(-1); }

.rsvp-intro {
  max-width: 430px;
  margin: 0 auto clamp(1rem, 2.8svh, 1.45rem);
  color: var(--c-dark-soft);
  font-family: var(--f-serif);
  font-size: clamp(.88rem, 3.2vw, 1.05rem);
  line-height: 1.55;
}

.rsvp-deadline {
  display: flex;
  width: min(100%, 390px);
  margin: 0 auto clamp(1rem, 2.8svh, 1.5rem);
  align-items: center;
  gap: clamp(.8rem, 3vw, 1.1rem);
  padding: .75rem 1rem;
  border: 1px solid rgba(201,169,110,.5);
  border-radius: 16px;
  background: rgba(255,255,255,.62);
  text-align: left;
  box-shadow: 0 7px 18px rgba(91,82,65,.07);
}

.rsvp-calendar {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(107,125,103,.45);
  border-radius: 12px;
  background: rgba(138,158,133,.09);
  color: var(--c-sage-dark);
}

.rsvp-calendar svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.rsvp-deadline-copy span {
  display: block;
  margin-bottom: .15rem;
  color: #9a7943;
  font-size: .56rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.rsvp-deadline-copy time {
  display: block;
  color: var(--c-sage-dark);
  font-family: var(--f-serif);
  font-size: clamp(.9rem, 3.5vw, 1.08rem);
  font-weight: 600;
}

.rsvp-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
}

.rsvp-response-note {
  display: flex;
  width: min(100%, 390px);
  align-items: center;
  justify-content: center;
  padding: .72rem .9rem;
  border: 1px solid rgba(107,125,103,.3);
  border-radius: 14px;
  background: rgba(138,158,133,.1);
  color: var(--c-sage-dark);
  text-align: left;
}

.rsvp-response-note p {
  color: var(--c-sage-dark);
  font-size: clamp(.72rem, 2.6vw, .84rem);
  line-height: 1.45;
}

.rsvp-action > p {
  max-width: 420px;
  color: var(--c-dark-soft);
  font-size: clamp(.72rem, 2.6vw, .84rem);
  line-height: 1.5;
}

.rsvp-button {
  min-width: min(100%, 280px);
  min-height: 48px;
  box-shadow: 0 8px 20px rgba(201,169,110,.27);
}

.rsvp-button .rsvp-button-icon {
  font-size: 1rem;
  line-height: 1;
}

.rsvp-button-spinner {
  display: none;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  border: 2px solid rgba(201,169,110,.25);
  border-top-color: var(--c-gold);
  border-radius: 50%;
  animation: rsvp-spin .75s linear infinite;
}

@keyframes rsvp-spin { to { transform: rotate(360deg); } }

.rsvp-form-note {
  color: rgba(74,74,74,.65);
  font-size: .58rem;
  letter-spacing: .04em;
}

.rsvp-form,
.rsvp-fallback {
  width: min(100%, 390px);
}

.rsvp-form[hidden],
.rsvp-fallback[hidden] { display: none; }

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: .42rem;
  text-align: left;
}

.rsvp-form label {
  margin-top: .28rem;
  color: var(--c-sage-dark);
  font-family: var(--f-serif);
  font-size: .9rem;
  line-height: 1.35;
}

.rsvp-form label span { color: var(--c-gold); }
.rsvp-form label small { color: var(--c-dark-soft); font-family: var(--f-sans); font-size: .67rem; }

.rsvp-form input:not([type="hidden"]),
.rsvp-form textarea {
  width: 100%;
  padding: .72rem .84rem;
  border: 1px solid rgba(107,125,103,.4);
  border-radius: 12px;
  outline: none;
  background: rgba(255,255,255,.78);
  color: var(--c-dark);
  font: inherit;
  font-size: .8rem;
}

.rsvp-form textarea { resize: vertical; min-height: 72px; }
.rsvp-form input:disabled,
.rsvp-form textarea:disabled {
  opacity: 1;
  border-color: #c4cdc1;
  background: #e9ede7;
  color: #6f7a6c;
  -webkit-text-fill-color: #6f7a6c;
  cursor: not-allowed;
}
.rsvp-form input:focus-visible,
.rsvp-form textarea:focus-visible { border-color: var(--c-sage-dark); box-shadow: 0 0 0 3px rgba(107,125,103,.16); }
.rsvp-form .rsvp-button { width: 100%; margin-top: .48rem; }
.rsvp-form .rsvp-button:disabled {
  opacity: 1;
  border: 1px solid #c4cdc1;
  background: #dfe5dc;
  color: #697768;
  cursor: not-allowed;
  box-shadow: none;
}
.rsvp-form .rsvp-button:disabled:active { transform: none; }
.rsvp-form[data-rsvp-state="saved"] .rsvp-button { background: var(--c-sage-dark); box-shadow: 0 8px 20px rgba(70,96,70,.2); }
.rsvp-form[data-rsvp-state="sending"] .rsvp-button:disabled {
  border-color: rgba(201,169,110,.65);
  background: #fbf8f0;
  color: var(--c-sage-dark);
  cursor: progress;
}
.rsvp-form[data-rsvp-state="sending"] .rsvp-button-icon { display: none; }
.rsvp-form[data-rsvp-state="sending"] .rsvp-button-spinner { display: block; }
.rsvp-status {
  display: flex;
  height: 3.5em;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--c-dark-soft);
  font-size: .7rem;
  line-height: 1.45;
  text-align: center;
  transition: opacity .25s ease;
}
.rsvp-status:empty { opacity: 0; }
.rsvp-status.is-success { color: var(--c-sage-dark); }
.rsvp-status.is-error { color: #8a4b3c; }
.rsvp-fallback { display: flex; flex-direction: column; align-items: center; gap: .65rem; padding-bottom: .8rem; }

.rsvp-toast {
  position: fixed;
  z-index: 50;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  left: max(1rem, env(safe-area-inset-left));
  display: flex;
  width: fit-content;
  max-width: min(calc(100% - 2rem), 390px);
  margin-inline: auto;
  align-items: center;
  gap: .65rem;
  padding: .8rem 1rem;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 14px;
  background: #526e53;
  color: #fff;
  box-shadow: 0 12px 32px rgba(33,57,37,.3);
  font-size: .82rem;
  line-height: 1.3;
  text-align: left;
  animation: rsvp-toast-in .32s ease-out both;
}

.rsvp-toast[hidden] { display: none; }
.rsvp-toast-check { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: rgba(255,255,255,.2); font-weight: 700; }

@keyframes rsvp-toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 599px) {
  #rsvp {
    padding-right: .55rem;
    padding-left: .55rem;
  }

  .rsvp-card {
    padding-right: clamp(1rem, 5vw, 1.3rem);
    padding-left: clamp(1rem, 5vw, 1.3rem);
  }
}

@media (max-width: 767px) and (max-height: 740px) {
  #rsvp { padding-block: .6rem; }

  #rsvp .rsvp-card {
    padding-top: calc(clamp(.45rem, 1.2svh, .7rem) + 16px);
    padding-bottom: 8px;
  }

  #rsvp .rsvp-seal { margin-bottom: .4rem; }
  #rsvp .title {
    margin-bottom: .35rem;
    font-size: clamp(1.55rem, 6.5vw, 1.8rem);
  }
  #rsvp .rsvp-intro { margin-bottom: .65rem; }
  #rsvp .rsvp-deadline { margin-bottom: .6rem; padding-block: .62rem; }
  #rsvp .rsvp-action { gap: .4rem; }
  #rsvp .rsvp-response-note { padding: .5rem .75rem; }
}

/* Solo los móviles de muy poca altura usan una variante compacta. */
@media (max-width: 767px) and (max-height: 600px) {
  #rsvp { padding-top: .7rem; padding-bottom: .7rem; justify-content: flex-start; }
  #rsvp .rsvp-card { padding-top: calc(.65rem + 16px); padding-bottom: 16px; }
  #rsvp .rsvp-seal { width: 32px; height: 32px; margin-bottom: .3rem; font-size: .58rem; }
  #rsvp .label { margin-bottom: .15rem; font-size: .56rem; }
  #rsvp .title { margin-bottom: .3rem; font-size: clamp(1.3rem, 5.5vw, 1.5rem); }
  #rsvp .rsvp-flourish { margin-bottom: .35rem; }
  #rsvp .rsvp-intro { margin-bottom: .4rem; font-size: .74rem; line-height: 1.35; }
  #rsvp .rsvp-deadline { margin-bottom: .4rem; padding: .4rem .65rem; }
  #rsvp .rsvp-calendar { width: 36px; height: 36px; }
  #rsvp .rsvp-calendar svg { width: 22px; height: 22px; }
  #rsvp .rsvp-action { gap: .3rem; }
  #rsvp .rsvp-response-note { padding: .35rem .5rem; }
  #rsvp .rsvp-response-note p { font-size: .62rem; }
  #rsvp .rsvp-form { gap: .28rem; }
  #rsvp .rsvp-form label { font-size: .76rem; }
  #rsvp .rsvp-form input:not([type="hidden"]),
  #rsvp .rsvp-form textarea { padding: .5rem .65rem; font-size: .72rem; }
  #rsvp .rsvp-form textarea { min-height: 52px; }
  #rsvp .rsvp-button { min-height: 40px; padding-block: .6rem; font-size: .66rem; }
}

@media (max-width: 767px) and (max-height: 500px) {
  #rsvp .rsvp-card { padding-top: calc(.45rem + 16px); padding-bottom: 16px; }
  #rsvp .rsvp-seal { width: 27px; height: 27px; margin-bottom: .15rem; }
  #rsvp .title { font-size: 1.2rem; }
  #rsvp .rsvp-intro { margin-bottom: .25rem; font-size: .68rem; }
  #rsvp .rsvp-deadline { margin-bottom: .25rem; }
  #rsvp .rsvp-response-note p,
  #rsvp .rsvp-action > p { font-size: .58rem; }
  #rsvp .rsvp-form label { font-size: .7rem; }
  #rsvp .rsvp-form textarea { min-height: 42px; }
}

/* Los móviles estrechos necesitan una composición más contenida. */
@media (max-width: 374px) and (max-height: 700px) {
  #rsvp { padding-top: .4rem; padding-bottom: .4rem; justify-content: flex-start; }
  #rsvp .rsvp-card { padding-top: calc(.55rem + 16px); padding-bottom: 16px; }
  #rsvp .rsvp-seal { width: 30px; height: 30px; margin-bottom: .22rem; font-size: .55rem; }
  #rsvp .label { margin-bottom: .1rem; font-size: .54rem; }
  #rsvp .title { margin-bottom: .2rem; font-size: 1.35rem; }
  #rsvp .rsvp-flourish { margin-bottom: .3rem; }
  #rsvp .rsvp-intro { margin-bottom: .38rem; font-size: .72rem; line-height: 1.3; }
  #rsvp .rsvp-deadline { margin-bottom: .38rem; padding: .4rem .55rem; gap: .55rem; }
  #rsvp .rsvp-calendar { width: 35px; height: 35px; }
  #rsvp .rsvp-calendar svg { width: 21px; height: 21px; }
  #rsvp .rsvp-deadline-copy span { font-size: .5rem; }
  #rsvp .rsvp-deadline-copy time { font-size: .88rem; }
  #rsvp .rsvp-action { gap: .25rem; }
  #rsvp .rsvp-response-note { padding: .32rem .5rem; }
  #rsvp .rsvp-response-note p { font-size: .6rem; line-height: 1.3; }
  #rsvp .rsvp-form { gap: .22rem; }
  #rsvp .rsvp-form label { margin-top: .1rem; font-size: .7rem; line-height: 1.25; }
  #rsvp .rsvp-form input:not([type="hidden"]),
  #rsvp .rsvp-form textarea { padding: .43rem .6rem; font-size: .7rem; }
  #rsvp .rsvp-form textarea { min-height: 44px; height: 44px; }
  #rsvp .rsvp-form .rsvp-button { min-height: 38px; margin-top: .2rem; padding-block: .5rem; font-size: .62rem; }
  #rsvp .rsvp-status { height: 4.35em; font-size: .65rem; }
}

@media (max-width: 767px) {
  #rsvp .section-inner { margin-block: auto; }

  #rsvp .rsvp-form input:not([type="hidden"]),
  #rsvp .rsvp-form textarea {
    font-size: 16px;
    scroll-margin-block: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-button { transition: none; }
  .rsvp-toast { animation: none; }
}
