/* ============================================================
   DEDICATORIA VIVA — mensaje + video que viajan con las flores
   ============================================================ */
.dv-page { --ac: #ecd39b; --glow: 208, 171, 98; min-height: 100svh; }
.dv-page[data-theme="rojo"] { --ac: #f0a0a8; --glow: 190, 40, 58; }
.dv-page[data-theme="rosa"] { --ac: #f3c1cd; --glow: 226, 138, 160; }
.dv-page[data-theme="sol"] { --ac: #f6d878; --glow: 232, 178, 40; }

/* ---------- Quien recibe ---------- */
.dv { position: relative; min-height: 100svh; overflow: hidden; isolation: isolate;
  background: radial-gradient(70% 50% at 50% 30%, rgba(var(--glow), .26), transparent 70%), radial-gradient(60% 40% at 50% 100%, rgba(var(--glow), .14), transparent 70%), var(--bg); }
.dv__petals { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.dv__bar { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: rgba(244, 236, 221, .95); color: #17110a; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.dv__bar button { height: 34px; padding: 0 16px; border-radius: 999px; background: #17110a; color: var(--cream); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }

.dv__brand { display: grid; justify-items: center; gap: 2px; margin: 0; line-height: 1; }
.dv__brand .script { font-size: 40px; color: var(--cream); }
.dv__brand small { font-size: 9px; letter-spacing: .4em; text-transform: uppercase; color: var(--gold); }

.dv__cover { position: relative; z-index: 2; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 40px 24px; text-align: center; transition: opacity .9s var(--ease), transform 1.2s var(--ease-out), visibility 0s .9s; }
.dv__cover > * { opacity: 0; transform: translateY(18px); animation: dvIn 1.1s var(--ease-out) forwards; }
.dv__cover > :nth-child(1) { animation-delay: .15s; }
.dv__cover > :nth-child(2) { animation-delay: .45s; }
.dv__cover > :nth-child(3) { animation-delay: .75s; }
.dv__cover > :nth-child(4) { animation-delay: .9s; }
.dv__cover > :nth-child(5) { animation-delay: 1.25s; }
.dv__cover > :nth-child(6) { animation-delay: 1.6s; }
@keyframes dvIn { to { opacity: 1; transform: none; } }
.dv__seal { display: grid; place-items: center; width: 74px; height: 74px; margin: 44px 0 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(var(--glow), 1), rgba(var(--glow), .55) 60%, rgba(var(--glow), .35)); box-shadow: 0 0 0 6px rgba(var(--glow), .14), 0 18px 40px -12px rgba(var(--glow), .7), inset 0 -6px 12px rgba(0, 0, 0, .25); }
.dv__seal span { font-family: var(--serif); font-style: italic; font-size: 27px; color: #1a1208; }
.dv__for { margin: 0; font-size: 11px; letter-spacing: .5em; text-transform: uppercase; color: var(--gold); padding-left: .5em; }
.dv__name { margin: 2px 0 0; font-size: clamp(74px, 22vw, 150px); line-height: 1.12; font-weight: 400; color: var(--cream); padding: 0 .15em; max-width: 100%; overflow-wrap: anywhere; text-shadow: 0 8px 50px rgba(var(--glow), .45); }
.dv__tag { max-width: 300px; margin: 14px 0 40px; font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.3; color: var(--ac); }
.dv__open { box-shadow: 0 0 0 0 rgba(236, 211, 155, .5), 0 10px 34px -14px rgba(208, 171, 98, .8); animation: dvIn 1.1s var(--ease-out) 1.6s forwards, dvPulse 2.4s var(--ease) 3s infinite; }
@keyframes dvPulse { 0% { box-shadow: 0 0 0 0 rgba(236, 211, 155, .5), 0 10px 34px -14px rgba(208, 171, 98, .8); } 70%, 100% { box-shadow: 0 0 0 18px rgba(236, 211, 155, 0), 0 10px 34px -14px rgba(208, 171, 98, .8); } }

.dv__letter { position: relative; z-index: 2; display: none; width: min(560px, 100%); margin-inline: auto; padding: clamp(70px, 14vh, 130px) 26px 60px; text-align: center; }
.is-open .dv__cover { position: absolute; inset: 0; opacity: 0; visibility: hidden; transform: translateY(-40px) scale(.96); pointer-events: none; }
.is-open .dv__letter { display: block; animation: dvFade 1.2s var(--ease) both; }
@keyframes dvFade { from { opacity: 0; } to { opacity: 1; } }
.dv__hi { margin: 0 0 22px; font-family: var(--script); font-size: clamp(54px, 15vw, 84px); line-height: 1.1; color: var(--cream); overflow-wrap: anywhere; }
.dv__msg { min-height: 3.2em; margin: 0; font-family: var(--serif); font-size: clamp(25px, 6.6vw, 34px); line-height: 1.36; color: var(--cream); white-space: pre-line; overflow-wrap: anywhere; text-wrap: pretty; }
.dv__msg.is-typing::after { content: ""; display: inline-block; width: 2px; height: .9em; margin-left: 3px; vertical-align: -.08em; background: var(--ac); animation: dvCaret .9s steps(1) infinite; }
@keyframes dvCaret { 50% { opacity: 0; } }
.dv__sign { display: grid; justify-items: center; gap: 0; margin: 30px 0 0; opacity: 0; transform: translateY(14px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease-out); }
.dv__sign small { font-size: 10.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.dv__sign .script { font-size: clamp(50px, 13vw, 72px); line-height: 1.15; color: var(--ac); }
.dv__video, .dv__end { opacity: 0; transform: translateY(24px); transition: opacity 1.3s var(--ease), transform 1.3s var(--ease-out); }
.is-done .dv__sign, .is-done .dv__video, .is-done .dv__end { opacity: 1; transform: none; }
.is-done .dv__video { transition-delay: .5s; }
.is-done .dv__end { transition-delay: .9s; }

.dv__video { position: relative; width: min(340px, 86%); margin: 46px auto 0; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 999px 999px 14px 14px; background: #050403; box-shadow: 0 0 0 1px rgba(var(--glow), .5), 0 40px 80px -30px rgba(var(--glow), .6); }
.dv__video.is-wide { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; }
.dv__video video, .dv__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; background: #050403; }
.dv__play { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 14px; background: linear-gradient(180deg, rgba(8, 6, 5, .1), rgba(8, 6, 5, .62)); color: var(--cream); font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; transition: opacity .5s var(--ease); }
.dv__play i { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; background: rgba(244, 236, 221, .94); box-shadow: 0 0 0 10px rgba(244, 236, 221, .16); }
.dv__play i::before { content: ""; margin-left: 5px; border-left: 20px solid #17110a; border-block: 12px solid transparent; }
.dv__video.is-playing .dv__play { opacity: 0; pointer-events: none; }
.dv__ph { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; padding: 30px; text-align: center; font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.3; color: var(--ac); border: 1px dashed rgba(var(--glow), .6); border-radius: inherit; }
.dv__ph small { font-family: var(--sans); font-style: normal; font-size: 11px; letter-spacing: .08em; color: var(--muted); }

.dv__end { display: grid; justify-items: center; gap: 0; margin-top: 60px; }
.dv__rule { width: 1px; height: 54px; margin-bottom: 26px; background: linear-gradient(180deg, transparent, var(--gold)); }
.dv__end > p:not(.dv__brand) { margin: 0 0 6px; font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.dv__brand--end .script { font-size: 54px; }
.dv__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.dv__staff { margin-top: 40px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: rgba(154, 143, 125, .6); }
.dv__staff:hover { color: var(--gold-2); }
.is-preview .dv__staff { display: none; }
.is-preview .dv__cover, .is-preview .dv__letter { padding-top: 90px; }

/* ---------- Crear ---------- */
.mk { min-height: 100svh; padding: 0 var(--pad) 90px; background: radial-gradient(50% 40% at 85% 12%, rgba(var(--glow), .16), transparent 70%), var(--bg); }
.mk__top { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 84px; max-width: 1240px; margin-inline: auto; }
.mk__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .8fr); gap: clamp(40px, 7vw, 110px); align-items: start; max-width: 1240px; margin: 30px auto 0; }
.mk__form { display: grid; gap: 22px; }
.mk__form .eyebrow { margin: 0; }
.mk__form .h2 { font-size: clamp(42px, 5.4vw, 72px); }
.mk__lead { max-width: 520px; margin: 0; }
.mk__price { display: inline-flex; align-items: baseline; gap: 12px; margin: 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 10.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); justify-self: start; }
.mk__price b { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 24px; letter-spacing: 0; text-transform: none; color: var(--gold-2); }
.mk__f { display: grid; gap: 9px; }
.mk__f .order__label { display: flex; justify-content: space-between; gap: 10px; }
.mk input[type="text"], .mk input[type="url"], .mk textarea { width: 100%; height: 52px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .02); color: var(--cream); font: inherit; font-size: 16px; outline: none; transition: border-color .3s, background .3s; }
.mk textarea { height: auto; min-height: 150px; padding: 16px 20px; border-radius: 18px; font-family: var(--serif); font-size: 21px; line-height: 1.4; resize: vertical; }
.mk input:focus, .mk textarea:focus { border-color: var(--gold); background: rgba(255, 255, 255, .04); }
.mk ::placeholder { color: var(--muted); opacity: .8; }
.mk__hint { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.mk__hint.is-bad { color: #f0a0a8; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px 0 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--text); transition: border-color .3s, background .3s, color .3s; }
.swatches button i { width: 26px; height: 26px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .3); }
.swatches button.is-on { border-color: var(--cream); background: rgba(244, 236, 221, .08); color: var(--cream); }
.mk__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.mk__side { position: sticky; top: 30px; display: grid; justify-items: center; gap: 22px; }
.phone { width: min(300px, 78vw); aspect-ratio: 9 / 18.5; padding: 10px; border-radius: 44px; background: linear-gradient(160deg, #2a2420, #0f0c0a); box-shadow: 0 0 0 1px rgba(232, 214, 180, .2), 0 50px 90px -40px #000, 0 30px 80px -40px rgba(var(--glow), .7); }
.phone__screen { position: relative; height: 100%; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding: 34px 20px 20px; border-radius: 35px; text-align: center; background: radial-gradient(80% 45% at 50% 20%, rgba(var(--glow), .34), transparent 70%), var(--bg); transition: background .6s var(--ease); }
.mini__for { margin: 0; font-size: 8px; letter-spacing: .5em; text-transform: uppercase; color: var(--gold); }
.mini__name { margin: 0; font-size: 50px; line-height: 1.2; color: var(--cream); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 .2em; }
.mini__msg { flex: none; max-height: 7.2em; overflow: hidden; margin: 6px 0 0; font-family: var(--serif); font-size: 16px; line-height: 1.32; color: var(--cream); white-space: pre-line; overflow-wrap: anywhere; }
.mini__sign { margin: 6px 0 0; font-size: 28px; line-height: 1.2; color: var(--ac); min-height: 6px; }
.mini__video { flex: 1; min-height: 60px; width: 62%; margin-top: 10px; display: grid; place-items: center; align-content: center; gap: 6px; border-radius: 999px 999px 8px 8px; background: #050403 center / cover no-repeat; box-shadow: 0 0 0 1px rgba(var(--glow), .5); }
.mini__video span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(244, 236, 221, .92); }
.mini__video span::before { content: ""; margin-left: 3px; border-left: 10px solid #17110a; border-block: 6px solid transparent; }
.mini__video small { font-size: 8px; letter-spacing: .26em; text-transform: uppercase; color: var(--cream); }
.mini__video.is-off { display: none; }
.mk__prev { margin-top: -6px; }

.qrbox { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 18px; align-items: center; width: min(400px, 100%); padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.qrbox canvas { width: 118px; height: 118px; border-radius: 8px; background: #f4ecdd; opacity: .25; transition: opacity .5s var(--ease); }
.qrbox.is-ready canvas { opacity: 1; }
.qrbox__t { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.15; color: var(--cream); }
.qrbox__s { margin: 4px 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.qrbox__btns { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.qrbox__btns button { padding: 2px 0; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); border-bottom: 1px solid currentColor; }
.qrbox:not(.is-ready) .qrbox__btns { opacity: .3; pointer-events: none; }

.pcard { display: none; }

@media (max-width: 900px) {
  .mk { padding-bottom: 60px; }
  .mk__top { height: 66px; }
  .mk__top .link { font-size: 10px; }
  .mk__grid { grid-template-columns: 1fr; margin-top: 10px; }
  .mk__side { position: static; }
  .mk__cta .btn { flex: 1 1 100%; }
  .dv__actions .btn { flex: 1 1 100%; }
}

/* ---------- Tarjeta impresa ---------- */
@media print {
  @page { size: A6 portrait; margin: 0; }
  body.dv-page { background: #fff !important; }
  body.dv-page::after, .dv, .mk, .toast { display: none !important; }
  .pcard { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100vh; padding: 8mm; text-align: center; color: #17110a; font-family: var(--serif); }
  .pcard__k { margin: 0; font-family: var(--sans); font-size: 8pt; letter-spacing: .5em; text-transform: uppercase; color: #9c7a39; }
  .pcard__n { margin: 0 0 5mm; font-family: var(--script); font-size: 40pt; line-height: 1.1; }
  .pcard img { width: 52mm; height: 52mm; image-rendering: pixelated; }
  .pcard__t { margin: 6mm 0 1mm; font-style: italic; font-size: 20pt; }
  .pcard__s { margin: 0; font-family: var(--sans); font-size: 8pt; letter-spacing: .08em; color: #555; }
}


/* ---------- Grabar el video aquí mismo ---------- */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; opacity: 0; }
.rec { display: grid; gap: 14px; }
.rec__stage { position: relative; width: min(280px, 100%); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 24px;
  background: radial-gradient(70% 50% at 50% 35%, rgba(var(--glow), .22), transparent 70%), #050403; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px #000; transition: box-shadow .4s var(--ease); }
.rec__stage.is-rec { box-shadow: 0 0 0 2px #e0475a, 0 0 46px -8px rgba(224, 71, 90, .7); }
.rec__live, .rec__play { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #050403; }
.rec__play { object-fit: contain; }
.rec__live.is-mirror { transform: scaleX(-1); }
.rec__ph { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 16px; padding: 26px; text-align: center; }
.rec__ph p { margin: 0; font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.38; color: var(--ac); }
.rec__icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; border: 1px solid rgba(var(--glow), .7); }
.rec__icon::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: #e0475a; box-shadow: 0 0 18px rgba(224, 71, 90, .8); }
.rec__count { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 4, 3, .35); font-family: var(--serif); font-size: 128px; line-height: 1; color: var(--cream); text-shadow: 0 6px 30px rgba(0, 0, 0, .6); animation: recPop .9s var(--ease-out) infinite; }
@keyframes recPop { from { transform: scale(1.25); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }
.rec__time { position: absolute; left: 50%; top: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; background: rgba(5, 4, 3, .62); backdrop-filter: blur(6px); font-size: 12px; letter-spacing: .06em; color: var(--cream); font-variant-numeric: tabular-nums; transform: translateX(-50%); }
.rec__time::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e0475a; animation: recBlink 1s steps(1) infinite; }
@keyframes recBlink { 50% { opacity: 0; } }
.rec__btns { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.rec__main { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 20px 0 15px; border-radius: 999px; background: var(--cream); color: #17110a; font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; transition: background .3s, transform .3s var(--ease); }
.rec__main:active { transform: scale(.96); }
.rec__main i { width: 14px; height: 14px; border-radius: 50%; background: #e0475a; transition: border-radius .3s var(--ease), background .3s; }
.rec__main[data-s="idle"] i, .rec__main[data-s="done"] i { background: transparent; box-shadow: inset 0 0 0 2px #17110a; }
.rec__main[data-s="rec"] { background: #e0475a; color: #fff; }
.rec__main[data-s="rec"] i { border-radius: 3px; background: #fff; }
.rec__main:disabled { opacity: .65; }
.rec__alt { position: relative; padding: 2px 0; border-bottom: 1px solid currentColor; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); cursor: pointer; }
.rec__alt:focus-within { outline: 1px solid var(--gold); outline-offset: 4px; }

.send { display: grid; gap: 10px; width: 100%; padding: 18px; border: 1px solid rgba(var(--glow), .45); border-radius: 18px; background: rgba(var(--glow), .07); transition: box-shadow .4s var(--ease); }
.send.is-flash { box-shadow: 0 0 0 3px rgba(var(--glow), .75); }
.send__t { margin: 0 0 2px; font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.25; color: var(--cream); }
.send__step { display: flex; align-items: center; gap: 14px; width: 100%; height: 56px; padding: 0 18px 0 9px; border-radius: 999px; background: linear-gradient(135deg, var(--gold-2), var(--gold) 55%, var(--gold-deep)); color: #17110a; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; text-align: left; transition: transform .3s var(--ease), background .3s; }
.send__step:active { transform: scale(.98); }
.send__step b { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: #17110a; color: var(--gold-2); font-family: var(--serif); font-size: 19px; font-weight: 500; letter-spacing: 0; }
.send__step.is-done { background: rgba(244, 236, 221, .12); color: var(--cream); }
.send__s { margin: 2px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

@media (max-width: 900px) {
  .rec__stage { width: min(270px, 78vw); margin-inline: auto; }
  .rec__btns { justify-content: center; }
}

/* ---------- Guardado del video ---------- */
.rec__up { position: relative; height: 3px; margin-top: 2px; border-radius: 3px; background: rgba(232, 214, 180, .12); overflow: hidden; }
.rec__up i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(.02); background: linear-gradient(90deg, var(--gold-deep), var(--gold-2)); transition: transform .35s var(--ease); }
.rec__up:not(.is-done) i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: recBrillo 1.2s linear infinite; }
.rec__up.is-done i { background: var(--gold-2); }
@keyframes recBrillo { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.mk__hint.is-ok { color: var(--gold-2); }
.mk__hint.is-ok::before { content: "✓ "; }
.dv__video.is-err .dv__play i { opacity: .35; }
.dv__end > p.dv__legal { margin: 14px 0 0; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(154, 143, 125, .6); }
.dv__legal a { color: inherit !important; text-decoration: none !important; }
.dv__legal a:hover { color: var(--gold-2) !important; }
.is-preview .dv__legal { display: none; }
