/* KC-RSVP Diamond · Crónica de Sociedad (Khal & Silvie)
   Viste los nodos que arma gala-rsvp-bridge.ts en KC-Center: placa de reserva, campos extra, pase y despedida.
   Papel de trapo, tinta verde grabado, filete de latón y el sello I·N de lacre vino. Derivado del Salón dorado de Paola & Carlos.
   Todo va anclado a #rsvp, salvo .kc-rsvp-capture-clean, que el bridge pone en <html> antes de rasterizar el PNG.
   Sin KC-Center estos nodos no existen y nada de esto pinta. */

#rsvp {
  accent-color: #7A2E3A;
  --pc-seal: url("../../assets/gate/seal-es.webp");
  --pc-papel-tinta: #283A34;
  --pc-sepia: #6B4F2A;
  --pc-granate: #7A2E3A;
  --pc-muted: #4A5751;
  --pc-gold: #C9A45C;
  --pc-bone: #F7F4EE;
  --pc-bone-muted: #D9D2C3;
  --pc-gold-night: #E8CF9A;
  --pc-field: #B9A88A;
  --pc-lift: 0 1px 0 rgba(40, 58, 52, .08), 0 18px 30px -18px rgba(30, 36, 51, .5);
  --pc-display: 'Bodoni Moda', 'Bodoni 72', Didot, Georgia, serif;
  --pc-text: 'Cormorant Garamond', 'Cormorant', Garamond, Georgia, serif;
  --pc-script: 'Italianno', 'Snell Roundhand', cursive;
}

/* ══════════ Placa de reserva: el nombre escrito a mano en el papel ══════════ */
#rsvp .kc-rsvp-reservation {
  position: relative;
  max-width: 420px;
  margin: 26px auto 18px;
  padding: 40px 22px 24px;
  border-radius: 2px;
  background: #F7F4EE url('../../assets/page/paper.webp') 0 0 / 256px 256px repeat;
  color: var(--pc-papel-tinta);
  text-align: center;
  box-shadow: var(--pc-lift);
}
/* Filete de oro a 8px, el mismo de la tarjeta de respuesta */
#rsvp .kc-rsvp-reservation::after,
#rsvp .kc-rsvp-farewell::after { content: ''; position: absolute; inset: 8px; border: 1px solid var(--pc-gold); pointer-events: none; }
/* Sello de lacre granate con el destello: corona la placa y el pase */
#rsvp .kc-rsvp-reservation::before,
#rsvp .kc-rsvp-ticket-host .kc-ticket::before {
  content: ''; position: absolute; left: 50%; z-index: 3;
  width: 40px; height: 40px; margin-left: -20px;
  background: var(--pc-seal) center / contain no-repeat;
}
#rsvp .kc-rsvp-reservation::before { top: -20px; }
#rsvp .kc-rsvp-reservation-eyebrow {
  margin: 0;
  font-family: var(--pc-text); font-size: 13px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
  color: var(--pc-sepia);
}
#rsvp .kc-rsvp-reservation-name {
  margin: .2em 0 .25em;
  font-family: var(--pc-script); font-size: clamp(2.3rem, 10vw, 3rem); font-weight: 400; line-height: 1.15;
  color: var(--pc-papel-tinta);
  overflow-wrap: anywhere; text-wrap: balance;
}
/* Píldora de pases: canto de oro liso, nunca se parte en dos líneas */
#rsvp .kc-rsvp-reservation-passes,
#rsvp .kc-rsvp-ticket-host .kc-ticket-passes {
  display: inline-block; margin: 0; padding: 7px 16px;
  border: 1px solid var(--pc-gold);
  background: rgba(201, 169, 97, .12);
  font-family: var(--pc-text); font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; white-space: nowrap;
  color: var(--pc-sepia);
}

/* Leyenda pedida por los novios: va debajo de la píldora, sin tocar el bridge compartido. */
#rsvp .kc-rsvp-reservation .kc-rsvp-reservation-passes { position: relative; margin-bottom: 1.9em; }
#rsvp .kc-rsvp-reservation .kc-rsvp-reservation-passes::after {
  content: 'Pases NO transferibles';
  position: absolute; top: calc(100% + 9px); left: 50%; transform: translateX(-50%);
  font-size: 10.5px; letter-spacing: .16em; white-space: nowrap;
  color: var(--pc-sepia); opacity: .85;
}

/* ══════════ Campos que suma el bridge: viven dentro de la tarjeta de papel ══════════ */
#rsvp .kc-rsvp-extra { margin-top: 14px; }
#rsvp .kc-rsvp-field-group { margin-bottom: 16px; }
#rsvp .kc-rsvp-field-group label {
  display: block; margin-bottom: 10px;
  font-family: var(--pc-display); font-size: 22px; font-weight: 400;
  color: var(--pc-papel-tinta);
}
#rsvp .kc-rsvp-field-group input,
#rsvp .kc-rsvp-field-group textarea,
#rsvp .kc-rsvp-field-group select {
  display: block; width: 100%; min-height: 50px; padding: 10px 14px;
  border: 1px solid var(--pc-field); border-radius: 0;
  background: rgba(255, 253, 248, .75); color: var(--pc-papel-tinta);
  font-family: var(--pc-text); font-size: 18px; line-height: 1.45;
}
#rsvp .kc-rsvp-field-group :is(input, textarea) { -webkit-appearance: none; appearance: none; }
#rsvp .kc-rsvp-field-group textarea { min-height: 104px; resize: vertical; }
#rsvp .kc-rsvp-field-group :is(input, textarea)::placeholder { color: rgba(78, 70, 58, .72); font-style: italic; }
#rsvp .kc-rsvp-field-group :is(input, textarea, select):focus-visible { outline: 2px solid var(--pc-sepia); outline-offset: 2px; }
#rsvp #kc-rsvp-x-children_count-hint,
#rsvp .kc-open-welcome,
#rsvp .kc-rsvp-closed-note { margin: 8px 0 0; font-size: 18px; font-style: italic; line-height: 1.5; color: var(--pc-muted); text-align: center; }

/* Adultos y niños: botones de lacre granate */
#rsvp .kc-rsvp-headcount-title { margin: 0 0 12px; font-family: var(--pc-display); font-size: 22px; color: var(--pc-papel-tinta); text-align: center; }
#rsvp .kc-rsvp-headcount-cells { display: grid; /* 124px por celda (44+4+28+4+44): en hojas angostas se apilan */
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); gap: 12px; }
#rsvp .kc-rsvp-headcount-cell { min-width: 0; text-align: center; }
#rsvp .kc-rsvp-headcount input[type="hidden"] { display: none; }
#rsvp .kc-rsvp-headcount-label {
  display: block; margin-bottom: 8px;
  font-family: var(--pc-text); font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--pc-sepia);
}
#rsvp .kc-rsvp-headcount-stepper { display: flex; align-items: center; justify-content: center; gap: 4px; }
#rsvp .kc-rsvp-headcount-btn {
  display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
  border: 1px solid #4A1520; border-radius: 50%;
  background: radial-gradient(circle at 32% 26%, #A9475A, #8E2F42 55%, #5E1D2A); color: #F7F4EE;
  font-family: var(--pc-text); font-size: 1.4rem; line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(226, 194, 124, .55);
  cursor: pointer; transition: transform .14s var(--kc-ease);
}
#rsvp .kc-rsvp-headcount-btn:disabled { opacity: .4; cursor: default; }
#rsvp .kc-rsvp-headcount-btn:focus-visible { outline: 2px solid var(--pc-sepia); outline-offset: 3px; }
#rsvp .kc-rsvp-headcount-btn:active:not(:disabled) { transform: scale(.94); }
#rsvp .kc-rsvp-headcount-value { min-width: 2ch; text-align: center; font-family: var(--pc-text); font-size: 2rem; font-weight: 600; font-variant-numeric: lining-nums; color: var(--pc-papel-tinta); }
#rsvp #kc-rsvp-headcount-total { margin: 8px 0 0; color: var(--pc-muted); font-style: italic; font-size: 18px; text-align: center; }

/* ══════════ Confirmar / Actualizar ══════════ */
#rsvp #kc-rsvp-submit { display: block; width: 100%; margin-top: 16px; }
#rsvp #kc-rsvp-submit:active:not(:disabled) { transform: scale(.98); }
#rsvp form[aria-busy="true"] #kc-rsvp-submit {
  cursor: progress; opacity: 1; color: #FFFDF8;
  background: linear-gradient(105deg, #6B4F2A 0%, #6B4F2A 38%, #8A6A2E 50%, #6B4F2A 62%, #6B4F2A 100%) 0 0 / 260% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  #rsvp form[aria-busy="true"] #kc-rsvp-submit { animation: pcBrilloEspera 1.4s linear infinite; }
}
@keyframes pcBrilloEspera { from { background-position: 100% 0; } to { background-position: -160% 0; } }
/* Actualizar: hueco, en oro de noche, al ancho del pase */
#rsvp .kc-rsvp-update {
  display: block; width: 100%; max-width: 400px; min-height: 50px; margin: 16px auto 0;
  border: 1px solid var(--pc-gold-night); border-radius: 0;
  background: transparent; color: var(--pc-gold-night);
  font-family: var(--pc-text); font-size: 15px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer;
}
#rsvp .kc-rsvp-update:focus-visible { outline: 2px solid var(--pc-gold-night); outline-offset: 4px; }

/* Con el pase en mano la tarjeta de respuesta se retira: el pase queda solo bajo las luces */
#rsvp[data-pc-scene] .kc-rsvp-form:has(> .kc-rsvp-ticket-host:not([hidden])),
#rsvp[data-pc-scene] .kc-rsvp-form:has(.kc-rsvp-farewell) { padding: 0; background: none; box-shadow: none; }
#rsvp[data-pc-scene] .kc-rsvp-form:has(> .kc-rsvp-ticket-host:not([hidden]))::after,
#rsvp[data-pc-scene] .kc-rsvp-form:has(.kc-rsvp-farewell)::after { display: none; }
/* Sin papel debajo, la línea de estado pasa a hueso: la sepia no se lee sobre la noche */
#rsvp[data-pc-scene] .kc-rsvp-form:has(> .kc-rsvp-ticket-host:not([hidden])) :is(.kc-rsvp-status, .kc-rsvp-error),
#rsvp[data-pc-scene] .kc-rsvp-form:has(.kc-rsvp-farewell) :is(.kc-rsvp-status, .kc-rsvp-error) { color: var(--pc-bone-muted); }

/* ══════════ El pase: la puerta de la parroquia en papel marfil ══════════ */
#rsvp .kc-rsvp-ticket-host { max-width: 400px; margin: 30px auto 0; text-align: center; }
#rsvp .kc-rsvp-ticket-host .kc-ticket {
  position: relative; isolation: isolate;
  margin: 0; padding: 58px 28px 30px;
  border-radius: 50% 50% 3px 3px / 92px 92px 3px 3px;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255, 252, 244, .8), rgba(255, 252, 244, 0) 70%),
    #F7F4EE url('../../assets/page/paper.webp') 0 0 / 256px 256px repeat;
  color: var(--pc-papel-tinta);
  /* Doble filete que sigue el arco: oro por fuera, granate por dentro */
  box-shadow:
    inset 0 0 0 9px #F7F4EE, inset 0 0 0 10px rgba(201, 169, 97, .95),
    inset 0 0 0 13px #F7F4EE, inset 0 0 0 14px rgba(119, 59, 67, .55),
    0 4px 10px rgba(0, 0, 0, .3), 0 28px 60px rgba(0, 0, 0, .5);
}
#rsvp .kc-rsvp-ticket-host .kc-ticket::before { top: -20px; }
/* Las partículas del contrato se vuelven un brillo de luz de fiesta que cruza el papel al abrir */
#rsvp .kc-rsvp-ticket-host .kc-ticket-particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; border-radius: inherit; }
#rsvp .kc-rsvp-ticket-host .kc-tp { display: none; }
#rsvp .kc-rsvp-ticket-host .kc-ticket-particles::after {
  content: ''; position: absolute; inset: -10% -60%;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 240, 205, .65) 50%, transparent 58%);
  transform: translateX(-100%); opacity: 0;
}
#rsvp .kc-rsvp-ticket-host .kc-ticket > :not(.kc-ticket-particles) { position: relative; z-index: 2; }

#rsvp .kc-ticket-header { margin: 0 0 8px; }
#rsvp .kc-ticket-crown-ornament {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--pc-text); font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; white-space: nowrap;
  color: var(--pc-sepia);
}
#rsvp .kc-ticket-crown-ornament::before,
#rsvp .kc-ticket-crown-ornament::after { content: ''; width: 22px; height: 1px; background: linear-gradient(90deg, transparent, var(--pc-gold)); }
#rsvp .kc-ticket-crown-ornament::after { transform: scaleX(-1); }
#rsvp .kc-ticket-status { margin: 4px 0 0; font-family: var(--pc-text); font-style: italic; font-size: 18px; color: var(--pc-granate); }
#rsvp .kc-ticket-event {
  margin: 6px 0 0;
  font-family: var(--pc-script); font-weight: 400; font-size: clamp(2.2rem, 9.4vw, 2.8rem); line-height: 1.1;
  color: var(--pc-papel-tinta);
  overflow-wrap: anywhere; text-wrap: balance;
}
#rsvp .kc-ticket-celebrant {
  margin: 6px 0 0;
  font-family: var(--pc-display); font-size: 14px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--pc-sepia);
}
/* Regla con rombo granate (el texto «· · ◆ · ·» del contrato queda como respaldo invisible) */
#rsvp .kc-ticket-rule {
  position: relative; width: 210px; height: 9px; margin: 18px auto;
  background: linear-gradient(to right, transparent, var(--pc-gold) 18%, var(--pc-granate) 50%, var(--pc-gold) 82%, transparent) center / 100% 1px no-repeat;
}
#rsvp .kc-ticket-rule span {
  display: block; width: 7px; height: 7px; margin: 1px auto 0;
  overflow: hidden; font-size: 0; color: transparent;
  background: var(--pc-granate); transform: rotate(45deg);
}
#rsvp .kc-ticket-guest-label {
  margin: 0;
  font-family: var(--pc-text); font-size: 12px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
  color: var(--pc-sepia);
}
#rsvp .kc-ticket-guest {
  margin: 4px 0 12px;
  font-family: var(--pc-script); font-size: clamp(2rem, 8.6vw, 2.5rem); line-height: 1.2;
  color: var(--pc-papel-tinta);
  overflow-wrap: anywhere; text-wrap: balance;
}
#rsvp .kc-ticket-date {
  margin: 14px 0 0;
  font-family: var(--pc-text); font-size: 13px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
  color: var(--pc-muted);
}
/* QR: panel marfil limpio con filete de oro. Los módulos no se tocan. */
#rsvp .kc-ticket-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 20px auto 0; }
#rsvp .kc-ticket-qr-frame {
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; width: 206px; height: 206px; padding: 0;
  border: 1px solid var(--pc-gold); background: #F7F4EE;
  outline: 1px solid rgba(201, 169, 97, .7); outline-offset: 3px;
}
#rsvp .kc-ticket-qr-img { display: block; width: 180px; height: 180px; }
#rsvp .kc-ticket-qr-img svg { display: block; width: 100%; height: 100%; }
#rsvp .kc-ticket-qr-hint {
  margin: 4px 0 0;
  font-family: var(--pc-text); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--pc-muted);
}
#rsvp .kc-ticket-id {
  margin: 14px 0 0;
  font-family: var(--pc-text); font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-variant-numeric: lining-nums tabular-nums;
  color: var(--pc-muted);
}
#rsvp .kc-ticket-brand {
  margin: 8px 0 0;
  font-family: var(--pc-text); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(78, 70, 58, .85);
}
/* Guardar pase: placa de oro, hermana del pase (no entra a la captura) */
#rsvp .kc-ticket-share { display: flex; justify-content: center; margin-top: 22px; }
#rsvp .kc-ticket-share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: min(100%, 17rem); min-height: 50px; padding: 12px 24px;
  border: 0; border-radius: 0;
  background: linear-gradient(180deg, #F3DDA2, #E8CF9A 45%, #C9A45C);
  color: #2A1F0C;
  font-family: var(--pc-text); font-size: 15px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 250, 232, .7), inset 0 -2px 3px rgba(90, 66, 26, .35), 0 10px 22px rgba(0, 0, 0, .4);
  cursor: pointer;
}
#rsvp .kc-ticket-share-btn:focus-visible { outline: 2px solid var(--pc-gold-night); outline-offset: 4px; }
#rsvp .kc-ticket-share-btn:active { transform: scale(.98); }
#rsvp .kc-ticket-share .kc-open-reload { background: transparent; color: var(--pc-gold-night); box-shadow: inset 0 0 0 1px var(--pc-gold-night); }

/* La apertura: el papel sube desde abajo y luego cruza la luz. Una sola vez, solo opacity/transform. */
@media (prefers-reduced-motion: no-preference) {
  #rsvp .kc-rsvp-ticket-host .kc-ticket { animation: pcPaseLlega .9s cubic-bezier(.22, 1, .36, 1) both; }
  #rsvp .kc-rsvp-ticket-host .kc-ticket-particles::after { animation: pcLuzCruza 1.5s ease-in-out .8s both; }
  #rsvp .kc-ticket-share { animation: pcSubeSuave .7s var(--kc-ease) .9s both; }
}
@keyframes pcPaseLlega { from { opacity: 0; transform: translateY(22px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pcLuzCruza { 0% { transform: translateX(-100%); opacity: 1; } 100% { transform: translateX(100%); opacity: 1; } }
@keyframes pcSubeSuave { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ══════════ Despedida (declinó): una nota en papel, sin QR ══════════ */
#rsvp .kc-rsvp-farewell {
  position: relative;
  max-width: 400px; margin: 30px auto 0; padding: 40px 24px 28px;
  border-radius: 2px;
  background: #F7F4EE url('../../assets/page/paper.webp') 0 0 / 256px 256px repeat;
  text-align: center; color: var(--pc-papel-tinta);
  box-shadow: var(--pc-lift);
}
#rsvp .kc-rsvp-farewell::before {
  content: ''; position: absolute; left: 50%; top: -20px;
  width: 40px; height: 40px; margin-left: -20px;
  background: var(--pc-seal) center / contain no-repeat;
}
#rsvp .kc-rsvp-farewell-eyebrow { margin: 0; font-family: var(--pc-text); font-size: 13px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--pc-sepia); }
#rsvp .kc-rsvp-farewell-guest { margin: 10px 0 6px; font-family: var(--pc-script); font-size: clamp(2rem, 8.6vw, 2.5rem); line-height: 1.2; overflow-wrap: anywhere; }
#rsvp .kc-rsvp-farewell-body { margin: 0; font-family: var(--pc-text); font-style: italic; font-size: 19px; line-height: 1.55; color: var(--pc-muted); text-wrap: balance; }
#rsvp .kc-rsvp-farewell-brand { margin: 14px 0 0; font-family: var(--pc-text); font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: rgba(78, 70, 58, .85); }

/* ══════════ Galería (la inyecta KC-Center en #captura): el mismo hueco de oro de noche ══════════ */
#captura .kc-gallery-cta__link {
  border: 1px solid var(--pc-bone-muted); border-radius: 0;
  background: transparent; color: var(--pc-bone); opacity: 1;
  font-family: var(--pc-text); font-size: 15px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
}

/* ══════════ Captura del PNG: sin sombras exteriores, sin animación ══════════ */
.kc-rsvp-capture-clean #rsvp .kc-rsvp-ticket-host .kc-ticket {
  animation: none !important; transform: none !important; opacity: 1 !important;
  box-shadow:
    inset 0 0 0 9px #F7F4EE, inset 0 0 0 10px rgba(201, 169, 97, .95),
    inset 0 0 0 13px #F7F4EE, inset 0 0 0 14px rgba(119, 59, 67, .55) !important;
}
.kc-rsvp-capture-clean #rsvp .kc-ticket-particles { display: none !important; }
/* El sello sale del borde: en la captura baja adentro para que el PNG no lo recorte */
.kc-rsvp-capture-clean #rsvp .kc-rsvp-ticket-host .kc-ticket::before { top: 10px; }
