/* ==========================================================
   INVITACIÓN DE BODA — estilos
   Los colores, fuentes y el redondeo se configuran desde el panel
   (Contenido → Apariencia); llegan como variables CSS en index.php.
   ========================================================== */

/* Texturas generadas (sin imágenes externas) */
:root {
  --tex-emboss: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.03' numOctaves='4' seed='7'/><feDiffuseLighting lighting-color='%23fff' surfaceScale='2.6'><feDistantLight azimuth='45' elevation='58'/></feDiffuseLighting></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --tex-paper: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.09' numOctaves='3' seed='2'/><feDiffuseLighting lighting-color='%23fff' surfaceScale='1.3'><feDistantLight azimuth='50' elevation='68'/></feDiffuseLighting></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --tex-marble: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='n' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.008 .014' numOctaves='5' seed='11'/><feDiffuseLighting lighting-color='%23fff' surfaceScale='4'><feDistantLight azimuth='225' elevation='52'/></feDiffuseLighting></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--f-text);
  background-color: var(--bg); background-image: var(--tex-marble); background-blend-mode: multiply;
  min-height: 100vh; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
.script { font-family: var(--f-script); font-weight: 400; }
.sans { font-family: var(--f-text); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.invitation { max-width: 520px; margin: 0 auto; padding: 0 0 0; }
@media (min-width: 640px) { .invitation { box-shadow: 0 0 60px rgba(60, 60, 90, .18); background: rgba(255,255,255,.25); } }

/* Iconos */
.ico { display: inline-block; line-height: 0; }
.ico svg { width: 100%; height: 100%; }

/* Animación de entrada */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Encabezado ---------- */
.head { padding: 26px 22px 34px; }
.head-paper {
  background-color: var(--paper); background-image: var(--tex-paper); background-blend-mode: multiply;
  padding: 34px 20px 30px; text-align: center; border-radius: 6px; box-shadow: 0 6px 22px rgba(70,70,90,.12);
}
.head .names { font-size: clamp(2.3rem, 9vw, 3.2rem); margin: 0 0 10px; color: var(--blue-dark); line-height: 1.1; }
.head .kicker { font-style: italic; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 auto; max-width: 30ch; color: #6b6b72; line-height: 1.7; }
.head .date { font-family: var(--f-title); font-weight: 600; letter-spacing: .3em; font-size: clamp(1.2rem, 5vw, 1.7rem); margin: 24px 0 14px; color: #3a3a44; }
.head .dear { margin: 14px 0 0; font-size: .8rem; color: #6b6b72; }
.divider { display: flex; align-items: center; justify-content: center; gap: 12px; color: #444; }
.divider span { height: 1px; width: 84px; background: #777; opacity: .6; }
.divider .ico { width: 13px; height: 13px; }

/* ---------- Tarjetas ---------- */
.card {
  position: relative; margin: 0 14px 30px; padding: 56px 26px 46px; text-align: center;
  border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 28px rgba(60,66,100,.22);
}
.card-blue {
  color: var(--on-blue); background-color: var(--blue); background-image: var(--tex-emboss); background-blend-mode: multiply;
}
.card-paper {
  background-color: var(--paper); background-image: var(--tex-paper); background-blend-mode: multiply; color: var(--ink);
}
.card h2 {
  font-family: var(--f-title); font-weight: 500; text-transform: uppercase; letter-spacing: .16em;
  font-size: clamp(1.7rem, 7vw, 2.3rem); margin: 22px 0 14px; line-height: 1.2;
}
.card h2.sans { font-family: var(--f-text); font-weight: 500; letter-spacing: .14em; font-size: clamp(1.5rem, 6.4vw, 2rem); color: #3a332d; }
.card-blue h2.sans { color: #45403c; }
.card .rule { border: 0; height: 1px; width: 76%; margin: 0 auto 26px; background: rgba(255,255,255,.7); }
.card-icon { display: block; margin: 0 auto; width: 96px; height: 62px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
.card-icon.wide { width: 130px; height: 70px; filter: none; }
.card-icon.small { width: 54px; height: 44px; margin-top: 30px; filter: none; }
.ico-cake_big.card-icon { width: 96px; height: 104px; }
.ico-bow.card-icon { width: 78px; height: 78px; filter: none; }
.dress-img { display: block; margin: 0 auto; max-width: 220px; max-height: 130px; width: auto; height: auto; object-fit: contain; }
.card .time { font-family: var(--f-title); font-weight: 700; font-size: 1.5rem; margin: 0 0 8px; }
.card .place { font-family: var(--f-title); font-size: 1.22rem; font-weight: 500; margin: 0 0 4px; }
.card .lead { font-size: .96rem; line-height: 1.7; margin: 0 auto 14px; max-width: 34ch; }
.card-blue.card-sans .lead { color: #4b4a5a; }
.card .code { font-weight: 600; letter-spacing: .2em; font-size: 1.05rem; margin: 18px 0 6px; color: #3a332d; }
.card .note { font-size: .92rem; line-height: 1.6; color: #4b4a5a; margin: 0 auto; max-width: 34ch; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  margin-top: 26px; padding: 16px 34px; min-width: 250px; border: 0; border-radius: 999px;
  background: #fff; color: #6f6a74; font: 600 .92rem/1 var(--f-text); letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  box-shadow: 0 5px 14px rgba(40,44,80,.22); transition: transform .2s, box-shadow .2s;
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(40,44,80,.28); outline: none; }
.btn.is-disabled { opacity: .75; cursor: default; }
.btn.is-disabled:hover { transform: none; }
.btn + .btn { margin-top: 18px; }
.btn-ico { width: 18px; height: 18px; }
.btn-solid { background: var(--blue); color: #fff; min-width: 0; width: 100%; }

/* ---------- Itinerario ---------- */
.itinerary { padding: 24px 22px 40px; text-align: center; }
.itinerary h2 { font-size: clamp(2.6rem, 11vw, 3.6rem); margin: 0 0 40px; color: #5b5b5e; }
.timeline { list-style: none; margin: 0 auto; padding: 0; position: relative; max-width: 420px; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 18px; bottom: 18px; width: 3px; margin-left: -1.5px; background: #9a9683; }
.tl-item { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center; min-height: 118px; }
.tl-dot { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: #9a9683; }
.tl-icon { width: 78px; height: 78px; color: #2e2e32; justify-self: center; }
.tl-text { display: flex; flex-direction: column; padding: 0 16px; gap: 2px; }
.tl-text strong { font-family: var(--f-title); font-weight: 700; font-size: 1.3rem; line-height: 1.15; color: #3a2f2a; }
.tl-text span { font-family: var(--f-text); font-size: 1.05rem; color: #55535a; }
.icon-left .tl-icon { grid-column: 1; grid-row: 1; }
.icon-left .tl-text { grid-column: 2; grid-row: 1; text-align: left; }
.icon-right .tl-icon { grid-column: 2; grid-row: 1; }
.icon-right .tl-text { grid-column: 1; grid-row: 1; text-align: right; }

/* ---------- Sello ---------- */
.seal-wrap { display: flex; justify-content: center; margin: -6px 0 -34px; position: relative; z-index: 2; }
.seal { width: 92px; height: 92px; filter: drop-shadow(0 4px 5px rgba(0,0,0,.28)); }
.seal-base { fill: #a4a7ad; }
.seal-ring { stroke: rgba(255,255,255,.45); stroke-width: 1.5; }
.seal-text { font-family: var(--f-script); font-size: 30px; fill: rgba(255,255,255,.85); }
.parents .seal-text { fill: #fff; }

/* ---------- Padres ---------- */
.parents {
  margin: 0 22px 34px; padding: 62px 22px 48px; text-align: center; border-radius: 6px;
  background-color: var(--paper); background-image: var(--tex-paper); background-blend-mode: multiply; box-shadow: 0 6px 22px rgba(70,70,90,.12);
}
.small-caps { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; font-style: italic; color: #66666c; line-height: 1.8; margin: 0 auto 14px; max-width: 34ch; }
.small-caps.gap { margin-top: 28px; }
.names-caps { font-family: var(--f-title); font-weight: 700; font-size: 1.12rem; text-transform: uppercase; letter-spacing: .02em; color: #48474e; margin: 0 0 8px; }

/* ---------- Regalos ---------- */
.account { margin: 22px 0 8px; font-size: .95rem; }
.account div { margin: 6px 0; line-height: 1.5; }
.account dt { display: inline; font-weight: 700; text-transform: uppercase; color: #3a332d; }
.account dd { display: inline; margin: 0; text-transform: uppercase; color: #4c4a52; }
.blank { display: inline-block; width: 9.5em; border-bottom: 1px solid #555; vertical-align: baseline; height: 1em; }
#regalos .card-icon.small { margin-top: 36px; }

/* ---------- Tarjeta-sobre ---------- */
.envelope { position: relative; margin: 0 14px 36px; aspect-ratio: 400 / 470; }
.envelope svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.env-body { fill: var(--blue); }
.env-flap { fill: var(--blue-dark); }
.env-fold { fill: none; stroke: rgba(255,255,255,.25); stroke-width: 1.5; }
.env-front { pointer-events: none; filter: drop-shadow(0 -4px 6px rgba(0,0,0,.18)); }
.env-card {
  position: absolute; left: 8%; top: 33%; width: 60%; padding: 6% 15% 5% 6%; transform: rotate(-2.5deg);
  background: #f8f1dd; border: 2px solid var(--gold); outline: 1px solid rgba(200,169,81,.6); outline-offset: -8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.28); color: var(--blue-dark); z-index: 2; height: 52%;
}
.env-card .quote { font-family: var(--f-title); font-size: clamp(.9rem, 4vw, 1.2rem); line-height: 1.25; margin: 4% 0 6%; }
.env-card .couple { font-family: var(--f-title); font-size: clamp(1.05rem, 4.8vw, 1.5rem); line-height: 1.15; margin: 0; padding-left: 14%; font-weight: 500; }
.env-card .foot { position: absolute; left: 8%; bottom: 5%; font-size: .55rem; margin: 0; color: #5c6796; }
.env-seal { position: absolute; right: -12%; bottom: 22%; width: 26%; }
.env-seal .seal { width: 100%; height: auto; }
.env-seal .seal-base { fill: var(--blue-dark); }
.env-photo {
  position: absolute; right: 3%; top: 31%; width: 42%; height: 50%; z-index: 3; transform: rotate(3deg);
  clip-path: polygon(0 6%, 28% 0, 100% 12%, 100% 100%, 0 100%); background: #444; overflow: hidden; border: 3px solid #f2f0ea; box-shadow: 0 8px 20px rgba(0,0,0,.3);
}
.env-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.env-photo.is-empty { display: grid; place-items: center; text-align: center; color: #ddd; font-size: .8rem; background: repeating-linear-gradient(135deg, #5a5a62, #5a5a62 10px, #66666e 10px, #66666e 20px); }
.env-front { z-index: 4; }

/* ---------- Cuenta regresiva ---------- */
.countdown {
  margin: 0 0 0; padding: 92px 22px 48px; text-align: center; color: var(--on-blue);
  background-color: var(--blue); background-image: var(--tex-emboss); background-blend-mode: multiply;
  border-radius: 260px 260px 0 0 / 200px 200px 0 0;
}
.countdown h2 { font-family: var(--f-title); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-size: clamp(2.2rem, 9vw, 3rem); margin: 0 0 8px; }
.countdown .sub { font-weight: 500; letter-spacing: .16em; text-transform: uppercase; font-size: .9rem; margin: 0 0 32px; }
.clock { display: flex; align-items: flex-start; justify-content: center; gap: 4px; margin-bottom: 18px; }
.clock div { min-width: 68px; }
.clock b { display: block; font-family: var(--f-title); font-weight: 500; font-size: clamp(2rem, 9vw, 2.9rem); letter-spacing: .04em; line-height: 1; }
.clock small { display: block; margin-top: 10px; font-family: var(--f-num); font-weight: 700; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }
.clock i { font-style: normal; font-size: 2rem; line-height: 1.1; padding-top: 2px; }
.deadline { margin: 16px 0 0; font-size: .78rem; opacity: .9; }
.countdown .btn { margin-top: 22px; }
.countdown.is-today .clock { display: none; }
.today-msg { font-family: var(--f-script); font-size: 2.4rem; margin: 8px 0 12px; }

/* ---------- Foto final ---------- */
.closing {
  position: relative; min-height: 78vh; background: #2c2c32 center / cover no-repeat; display: flex; align-items: flex-end;
}
.closing.is-empty { min-height: 44vh; background-image: linear-gradient(160deg, #4a4a54, #202025); }
.closing::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0,0,0,.65)); }
.closing-text { position: relative; z-index: 1; width: 100%; padding: 30px 22px 40px; text-align: center; color: #fff; font-family: var(--f-script); font-size: 2.6rem; line-height: 1.1; }
.closing-text small { display: block; margin-top: 10px; font-family: var(--f-text); font-size: .8rem; letter-spacing: .3em; }
.closing { filter: grayscale(.15); }

/* ---------- Modal / formularios ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(30,32,50,.62); backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: 100%; max-width: 430px; max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 22px; padding: 30px 24px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.modal-box h3 { font-family: var(--f-title); font-size: 1.7rem; margin: 0 0 18px; text-align: center; color: var(--blue-dark); }
.modal-x { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 2rem; line-height: 1; cursor: pointer; color: #777; }
.modal form label { display: block; margin-bottom: 14px; font-size: .82rem; font-weight: 600; color: #4a4a52; }
.modal form small { display: block; font-weight: 400; margin-top: 4px; color: #777; }
.modal input[type=text], .modal input[type=tel], .modal select, .modal textarea, .modal input[type=file] {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: 400 1rem var(--f-text); color: var(--ink);
  border: 1px solid #c9c9d3; border-radius: 12px; background: #fff;
}
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.modal fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.modal legend { font-size: .82rem; font-weight: 600; color: #4a4a52; padding: 0; margin-bottom: 6px; }
.modal .radio { display: flex; align-items: center; gap: 10px; font-weight: 400; margin-bottom: 8px; }
.modal .radio input { width: 18px; height: 18px; accent-color: var(--blue); }
.modal .btn-solid { margin-top: 6px; }
.form-msg { min-height: 1.4em; margin: 12px 0 0; text-align: center; font-size: .9rem; }
.form-msg.ok { color: #2f7a4b; } .form-msg.err { color: #b3372f; }
body.modal-open { overflow: hidden; }

/* Música de fondo */
.music-toggle { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 1.3rem; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.music-toggle.on { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(119,131,173,.25); } }
