/* ============================================================
   TuMetaIA · by EmotionIArt
   Tokens del sitio de EmotionIArt (navy / cyan, Poppins + Inter).
   Las tipografías del vinilo (Oswald, Barlow Condensed, Share Tech
   Mono) solo se usan dentro del SVG del sticker.
   ============================================================ */
:root {
  --navy-950: #0a1628;
  --navy-900: #0f1f3d;
  --navy-800: #16294f;
  --navy-700: #1f3663;
  --cyan-400: #3ecfe8;
  --cyan-500: #23b8d6;
  --cyan-600: #1a94ac;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f4f7fa;
  --gray-200: #e6ecf2;
  --gray-300: #d7dee6;
  --gray-500: #7c8aa0;
  --gray-700: #3a465c;
  --ok: #1f9d63;
  --warn: #c98a00;
  --bad: #d23b3b;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(10, 22, 40, 0.10);
  --font-display: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--navy-900);
  background: var(--gray-100);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy-950); line-height: 1.2; margin: 0 0 0.4em; }
a { color: var(--cyan-600); text-decoration: none; }
a:hover { color: var(--navy-900); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.container { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

/* ---------- Header ---------- */
.site-header {
  background: var(--navy-950);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}
.site-header__row { display: flex; align-items: center; gap: 14px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo-plate {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%; background: var(--white); padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); overflow: hidden;
}
.brand-logo-plate img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.brand-text { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--white); letter-spacing: -0.01em; }
.brand-text span, .site-footer strong span { color: var(--cyan-400); }
.brand-by { color: var(--gray-300); font-size: 0.8rem; display: none; }
.brand-by a { color: var(--cyan-400); }
.site-header__cta { margin-left: auto; }
@media (min-width: 560px) { .brand-by { display: inline; } }

/* ---------- Intro ---------- */
.intro {
  color: var(--white);
  background:
    radial-gradient(circle at 12% 110%, rgba(62, 207, 232, 0.20), transparent 55%),
    radial-gradient(circle at 88% -10%, rgba(62, 207, 232, 0.14), transparent 50%),
    linear-gradient(180deg, var(--navy-950), var(--navy-900));
  padding: 38px 0 44px;
}
.intro__inner { display: grid; gap: 26px; align-items: center; }
@media (min-width: 900px) { .intro__inner { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: 40px; } }
.intro h1 { color: var(--white); font-weight: 800; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; margin-bottom: 14px; }
.intro h1 span { display: block; color: var(--cyan-400); }
.intro__lead { max-width: 620px; color: var(--gray-300); margin: 0 0 22px; font-size: 1.08rem; }
.intro__text .intro__help { margin-bottom: 0; }

/* Video del producto terminado (assets/video/tumetaia.mp4). Sin archivo → espacio "Muy pronto". */
.intro__video { margin: 0; justify-self: center; width: 100%; max-width: 330px; }
@media (max-width: 899px) { .intro__video { max-width: 240px; } }
.intro__video video, .intro__video-ph {
  display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 18px; object-fit: cover; background: var(--navy-800);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(62, 207, 232, 0.35);
}
.intro__video video { display: none; }
.intro__video.has-video video { display: block; }
.intro__video.has-video .intro__video-ph { display: none; }
.intro__video-ph {
  display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: 20px;
  background:
    radial-gradient(circle at 50% 38%, rgba(62, 207, 232, 0.28), transparent 60%),
    linear-gradient(160deg, var(--navy-800), var(--navy-950));
}
.intro__play {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px;
  background: var(--cyan-400); box-shadow: 0 0 0 10px rgba(62, 207, 232, 0.15), 0 0 30px rgba(62, 207, 232, 0.5);
  animation: introPulse 2.4s ease-in-out infinite;
}
.intro__play svg { width: 28px; height: 28px; fill: var(--navy-950); margin-left: 3px; }
.intro__video-ph strong { font-family: var(--font-display); font-size: 1.1rem; color: var(--white); }
.intro__video-ph small { color: var(--gray-300); font-size: 0.8rem; max-width: 220px; }
.intro__video figcaption { margin-top: 10px; text-align: center; font-size: 0.8rem; color: var(--gray-300); }
@keyframes introPulse { 50% { box-shadow: 0 0 0 16px rgba(62, 207, 232, 0.06), 0 0 40px rgba(62, 207, 232, 0.6); } }
@media (prefers-reduced-motion: reduce) { .intro__play { animation: none; } }

/* ---------- Planes y precios ---------- */
.plans { background: linear-gradient(180deg, var(--navy-900), #0c1a33); color: var(--white); padding: 34px 0 60px; }
.plans__title { color: var(--white); font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 6px; text-align: center; }
.plans__sub { text-align: center; color: var(--gray-300); margin: 0 auto 18px; max-width: 560px; }
.plans__grid { display: grid; gap: 14px; max-width: 820px; margin: 0 auto; }
@media (min-width: 720px) { .plans__grid { grid-template-columns: 1fr 1fr; } }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 20px 20px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.04); border: 1.5px solid rgba(255, 255, 255, 0.14);
}
.plan--main { border-color: var(--cyan-400); background: rgba(62, 207, 232, 0.08); box-shadow: 0 12px 36px rgba(62, 207, 232, 0.15); }
.plan__tag {
  position: absolute; top: -11px; left: 20px; margin: 0; padding: 3px 10px; border-radius: 999px;
  background: var(--cyan-400); color: var(--navy-950); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.plan h3 { color: var(--white); font-size: 1.15rem; margin: 0; }
.plan__price { margin: 4px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; color: var(--white); line-height: 1; }
.plan__note { margin: 0; font-size: 0.8rem; color: var(--gray-300); }
.plan__list { margin: 10px 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.88rem; color: var(--gray-300); }
.plan__list li::before { content: '✓'; color: var(--cyan-400); font-weight: 800; margin-right: 8px; }
.plan .btn { margin-top: auto; }

/* Interruptor del chip NFC (franja de precios y paso 6) */
.nfc-toggle {
  display: flex; align-items: center; gap: 12px; max-width: 820px; margin: 0 auto 18px; padding: 12px 14px; cursor: pointer;
  border-radius: 14px; border: 1.5px solid rgba(62, 207, 232, 0.45); background: rgba(62, 207, 232, 0.08);
}
.nfc-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex-shrink: 0; width: 46px; height: 26px; border-radius: 999px; background: #3a465c; position: relative; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.nfc-toggle input:checked + .switch { background: var(--cyan-500); }
.nfc-toggle input:checked + .switch::after { transform: translateX(20px); }
.nfc-toggle input:focus-visible + .switch { box-shadow: 0 0 0 3px rgba(62, 207, 232, 0.45); }
.nfc-toggle__txt { display: grid; gap: 2px; }
.nfc-toggle__txt strong { font-family: var(--font-display); font-size: 0.95rem; }
.nfc-toggle__txt small { font-size: 0.8rem; color: var(--gray-300); }
.nfc-toggle--light { margin: 0 0 14px; max-width: none; background: #e9f9fc; border-color: var(--cyan-500); }
.nfc-toggle--light .nfc-toggle__txt small { color: var(--gray-700); }

/* ---------- Vista real del marco ---------- */
.mk-tabs { display: inline-flex; background: var(--gray-100); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 10px; }
.mk { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: var(--gray-200); }
.mk__stage { position: absolute; top: 0; left: 0; width: 1024px; height: 1024px; transform-origin: 0 0; }
.mk__photo { position: absolute; inset: 0; width: 1024px; height: 1024px; display: block; user-select: none; }
.mk__pieces { position: absolute; inset: 0; }
.mk__piece { position: absolute; top: 0; left: 0; transform-origin: 0 0; filter: brightness(0.94) contrast(1.02); }
.mk__piece svg { display: block; width: 100%; height: 100%; }
.frame-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.frame-color {
  font: inherit; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; cursor: pointer;
  border-radius: 999px; border: 1.5px solid var(--gray-300); background: var(--white); font-size: 0.8rem; font-weight: 600; color: var(--navy-900);
}
.frame-color i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.15); }
.frame-color.is-on { border-color: var(--navy-950); box-shadow: 0 0 0 2px var(--cyan-400); }
.frame-color small { font-size: 0.64rem; font-weight: 700; color: var(--cyan-600); letter-spacing: 0.04em; }

/* ---------- Resumen del pedido ---------- */
.summary { border-radius: 14px; background: var(--navy-950); color: var(--white); padding: 14px 16px; margin-bottom: 14px; display: grid; gap: 6px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.86rem; color: var(--gray-300); }
.summary__row strong { color: var(--white); text-align: right; display: inline-flex; align-items: center; gap: 6px; }
.summary__dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255, 255, 255, 0.4); }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 8px; margin-top: 4px; }
.summary__total strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--cyan-400); }

/* ---------- Layout ---------- */
.app { display: flex; flex-direction: column; gap: 22px; padding-top: 24px; padding-bottom: 48px; }
.app__preview { order: -1; }
@media (min-width: 980px) {
  .app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; gap: 28px; margin-top: -26px; }
  .app__preview { order: 0; position: sticky; top: 78px; }
}

/* ---------- Pasos ---------- */
.step {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-bottom: 16px;
}
@media (min-width: 640px) { .step { padding: 24px 26px; } }
.step__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.step__head h2 { font-size: 1.15rem; margin: 2px 0 2px; }
.step__head p { margin: 0; color: var(--gray-500); font-size: 0.9rem; }
.step__num {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; color: var(--navy-950);
  background: linear-gradient(135deg, var(--cyan-400), var(--cyan-500));
  box-shadow: 0 6px 16px rgba(35, 184, 214, 0.35);
}

/* ---------- Campos ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 520px) { .grid-2 { grid-template-columns: 1fr 1fr; } .field--wide { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 0.78rem; font-weight: 600; color: var(--gray-700); }
input, select, textarea {
  font: inherit; font-size: 0.95rem; color: var(--navy-950);
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  padding: 10px 12px; background: var(--white); width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan-500); box-shadow: 0 0 0 3px rgba(62, 207, 232, 0.22); }
input.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(210, 59, 59, 0.12); }
.field__err { color: var(--bad); font-size: 0.76rem; min-height: 0; }
.field--time input { font-family: 'Share Tech Mono', monospace; font-size: 1.5rem; letter-spacing: 0.06em; max-width: 220px; }
.hint { color: var(--gray-500); font-size: 0.8rem; margin: 8px 0 0; }
.note { background: var(--gray-100); border-left: 3px solid var(--cyan-500); border-radius: 8px; padding: 10px 12px; font-size: 0.86rem; color: var(--gray-700); margin: 12px 0; }
.note--tip { border-left-color: var(--warn); background: #fff8e6; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  border: 1.5px solid transparent; border-radius: 999px; padding: 11px 20px;
  cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s, color .15s;
  text-align: center; line-height: 1.2;
}
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn--sm { font-size: 0.8rem; padding: 7px 14px; }
.btn--cyan { background: var(--cyan-400); color: var(--navy-950); box-shadow: 0 6px 18px rgba(62, 207, 232, 0.35); }
.btn--cyan:hover { background: var(--cyan-500); color: var(--navy-950); transform: translateY(-1px); }
.btn--navy { background: var(--navy-900); color: var(--white); }
.btn--navy:hover { background: var(--navy-800); color: var(--white); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--gray-300); color: var(--navy-900); }
.btn--ghost:hover { border-color: var(--cyan-500); color: var(--cyan-600); }
.chip {
  font: inherit; font-size: 0.8rem; font-weight: 600; border-radius: 999px; padding: 5px 12px; cursor: pointer;
  border: 1.5px solid var(--gray-300); background: var(--white); color: var(--navy-900);
}
.chip:hover { border-color: var(--cyan-500); color: var(--cyan-600); }

/* ---------- Parciales ---------- */
.splits { display: grid; gap: 10px; }
.split {
  display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px;
  border: 1.5px solid var(--gray-200); border-radius: 12px; background: var(--gray-50);
}
@media (min-width: 560px) { .split { grid-template-columns: 130px 1fr 1fr; align-items: end; } }
.split__head { display: flex; align-items: center; gap: 8px; align-self: center; }
.split__head strong { font-family: var(--font-display); font-size: 0.9rem; }
.split__icon { width: 26px; height: 26px; fill: none; stroke: var(--cyan-600); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.split input[data-tipo="tiempo"] { font-family: 'Share Tech Mono', monospace; font-size: 1.05rem; }

/* ---------- Fotos ---------- */
.seg { display: inline-flex; background: var(--gray-100); border-radius: 999px; padding: 4px; gap: 4px; }
.seg__btn { font: inherit; font-weight: 600; font-size: 0.85rem; border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--gray-700); }
.seg__btn.is-on { background: var(--navy-950); color: var(--white); }
.photos { display: grid; gap: 10px; }
.photo { display: flex; gap: 12px; padding: 10px; border: 1.5px dashed var(--gray-300); border-radius: 12px; align-items: stretch; }
.photo.has { border-style: solid; border-color: var(--gray-200); background: var(--gray-50); }
.photo__thumb {
  width: 58px; flex-shrink: 0; aspect-ratio: 27 / 59; border-radius: 6px; overflow: hidden;
  background: var(--navy-900); display: grid; place-items: center; color: var(--gray-500); font-size: 0.66rem; text-align: center;
}
.photo__thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.photo__title { display: flex; align-items: center; gap: 8px; }
.photo__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.zoom { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; font-weight: 600; color: var(--gray-700); }
.zoom input { padding: 0; border: 0; accent-color: var(--cyan-500); box-shadow: none; }
.badge { font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.badge:empty { display: none; }
.badge--ok { background: #e3f6ec; color: var(--ok); }
.badge--warn { background: #fff3d6; color: var(--warn); }
.badge--bad { background: #fde6e6; color: var(--bad); }

/* ---------- Revisión y exportación ---------- */
.issues { border-radius: 12px; background: var(--gray-50); border: 1.5px solid var(--gray-200); padding: 12px 14px; margin-bottom: 14px; font-size: 0.86rem; }
.issues__title { margin: 0 0 6px; font-weight: 700; font-family: var(--font-display); }
.issues__ok { margin: 0; color: var(--ok); font-weight: 600; }
.issues__ok::before { content: '✓ '; }
.issues ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.issues li { padding-left: 20px; position: relative; }
.issues li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.issues li.is-error { color: var(--bad); }
.issues li.is-error::before { content: '✕'; }
.issues li.is-warn { color: var(--gray-700); }
.issues li.is-warn::before { content: '!'; color: var(--warn); left: 5px; }
.export-grid { display: grid; gap: 10px; }
@media (min-width: 640px) { .export-grid { grid-template-columns: 1fr 1fr; } .export-grid .btn:last-child { grid-column: 1 / -1; } }
.progress { margin-top: 14px; }
.progress__bar { height: 6px; border-radius: 99px; background: var(--gray-200); overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-500), var(--cyan-400)); transition: width .3s; }
.progress p { margin: 6px 0 0; font-size: 0.8rem; color: var(--gray-500); }
.order { margin-top: 18px; border: 2px solid var(--cyan-400); border-radius: 14px; padding: 16px; background: #f1fcfe; }
.order__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--navy-950); }
.order .hint { margin: 4px 0 12px; }
.order .grid-2 { margin-bottom: 12px; }
.btn--lg { width: 100%; padding: 15px 22px; font-size: 1.05rem; }
/* Modo administrador (solo con sesión de admin) */
.admin-tools { margin-top: 16px; padding: 14px 16px; border-radius: 14px; border: 2px dashed #6741d9; background: #f4f0ff; }
.admin-tools__title { margin: 0 0 2px; font-family: var(--font-display); font-weight: 800; color: #4b2bb3; }
.admin-tools .hint { margin: 0 0 10px; }
.admin-tools__save { margin-top: 10px; }
.order__result { margin-top: 10px; font-size: 0.86rem; }
.order__result .is-error { color: var(--bad); }
.order__ok { background: #e3f6ec; border-radius: 10px; padding: 10px 12px; }
.order__ok p { margin: 0 0 6px; word-break: break-all; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.share .hint { margin: 0; }

/* ---------- Vista previa ---------- */
.preview {
  background: var(--navy-950);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(10, 22, 40, 0.28);
  overflow: hidden;
}
.preview__bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); color: var(--white);
}
.preview__bar strong { font-family: var(--font-display); font-size: 0.88rem; font-weight: 600; }
.preview__bar strong::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan-400); margin-right: 8px; box-shadow: 0 0 10px var(--cyan-400); }
.preview__tools { display: flex; flex-wrap: wrap; gap: 4px; }
.tool {
  font: inherit; font-size: 0.74rem; font-weight: 600; color: var(--gray-300);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px; padding: 5px 9px; cursor: pointer; min-width: 30px;
}
.tool:hover { color: var(--white); border-color: rgba(62, 207, 232, 0.5); }
.tool.is-on { background: var(--cyan-400); color: var(--navy-950); border-color: var(--cyan-400); }
.preview__stage {
  padding: 12px; display: flex; justify-content: center; align-items: flex-start;
  overflow: auto; max-height: 82vh; touch-action: pan-y;
  background: radial-gradient(circle at 50% 30%, var(--navy-800), var(--navy-950) 70%);
}
@media (min-width: 980px) { .preview__stage { max-height: calc(100vh - 150px); } }
.preview__stage.is-zoomed { justify-content: flex-start; }
.preview__stage svg { display: block; flex-shrink: 0; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.5)); }
.photo-hit { cursor: grab; touch-action: none; }
.is-dragging, .is-dragging .photo-hit { cursor: grabbing; }
.preview__meta { margin: 0; padding: 8px 12px; font-size: 0.74rem; color: var(--gray-500); border-top: 1px solid rgba(255, 255, 255, 0.08); }

/* ---------- Editor de plantilla ---------- */
.editor__h { font-size: 0.9rem; margin: 18px 0 8px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.swatch { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 600; color: var(--gray-700); }
.swatch input { width: 38px; height: 32px; padding: 2px; flex-shrink: 0; cursor: pointer; }
.asset { display: flex; gap: 10px; border: 1.5px solid var(--gray-200); border-radius: 12px; padding: 10px; }
.asset__thumb {
  width: 64px; height: 64px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; overflow: hidden;
  background: repeating-conic-gradient(#dfe5ec 0% 25%, #fff 0% 50%) 50% / 12px 12px;
  font-size: 0.64rem; color: var(--gray-500); text-align: center;
}
.asset__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asset__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 0.82rem; }
.asset__body small { color: var(--gray-500); }
.asset__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.asset__msg { font-size: 0.76rem; color: var(--gray-700); }
.asset__note { color: var(--cyan-600) !important; font-weight: 600; }
.asset__note:empty { display: none; }
.asset__msg.is-warn { color: var(--warn); }
.asset__msg.is-error { color: var(--bad); }
.asset__bg { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.presets .hint { margin: 0; }
.disc-list { display: grid; gap: 8px; margin-bottom: 10px; }
.disc { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; background: var(--gray-50); border: 1.5px solid var(--gray-200); border-radius: 10px; }
.disc input, .disc select { padding: 7px 9px; font-size: 0.85rem; }
.disc__move { display: flex; gap: 4px; justify-content: flex-end; grid-column: 1 / -1; }
.disc__move button { font: inherit; border: 1px solid var(--gray-300); background: var(--white); border-radius: 6px; width: 30px; height: 28px; cursor: pointer; }
.disc__move button:disabled { opacity: .35; cursor: default; }
@media (min-width: 720px) {
  .disc { grid-template-columns: 1.2fr 1fr 1fr .8fr auto; align-items: center; }
  .disc__move { grid-column: auto; }
}

/* ---------- Paso 1: tipo de carrera, filtros y listado ---------- */
.muted { color: var(--gray-500); font-size: 0.78rem; }
.race-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.race-type {
  font: inherit; text-align: left; cursor: pointer; display: grid; grid-template-columns: 28px 1fr; gap: 0 8px; align-items: center;
  padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--gray-200); background: var(--gray-50); color: var(--navy-900);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.race-type svg { grid-row: span 2; width: 26px; height: 26px; fill: none; stroke: var(--cyan-600); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.race-type span { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }
.race-type small { font-size: 0.72rem; color: var(--gray-500); line-height: 1.3; }
.race-type:hover { border-color: var(--cyan-500); }
.race-type.is-on { background: var(--navy-950); border-color: var(--navy-950); color: var(--white); box-shadow: 0 8px 20px rgba(10, 22, 40, 0.25); }
.race-type.is-on svg { stroke: var(--cyan-400); }
.race-type.is-on small { color: var(--gray-300); }
/* Dos deportes: tarjeta con doble franja (un color por deporte) */
.race-type--dual { position: relative; overflow: hidden; }
.race-type--dual::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; opacity: 0.55; pointer-events: none;
  background: linear-gradient(90deg, #ff7a1a 50%, #1fd1b5 50%);
}
.race-type--dual.is-on { background: linear-gradient(160deg, #2a1a52, #1b1035); border-color: #ff7a1a; }
.race-type--dual.is-on svg { stroke: #1fd1b5; }
.race-type--dual.is-on::after { opacity: 1; }

/* Natación: tarjeta con olas (visual exclusiva de aguas abiertas) */
.race-type--agua { position: relative; overflow: hidden; }
.race-type--agua::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; opacity: 0.35; pointer-events: none;
  background: radial-gradient(circle at 10px -4px, transparent 8px, #00b4d8 8.5px) 0 0 / 20px 10px repeat-x;
}
.race-type--agua.is-on { background: linear-gradient(160deg, #063c63, #032b4a); border-color: #00b4d8; }
.race-type--agua.is-on svg { stroke: #34f5ff; }
.race-type--agua.is-on::after { opacity: 0.6; }
.race-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip.is-on { background: var(--cyan-400); border-color: var(--cyan-400); color: var(--navy-950); }
.chip:disabled { opacity: .4; cursor: default; }
.chip__n { font-size: 0.7rem; opacity: .7; margin-left: 2px; }
.race-search { position: relative; margin-bottom: 12px; }
.race-search svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--gray-500); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.race-search .race-q { padding-left: 40px; margin: 0; border-radius: 999px; background: var(--gray-50); }
.race-found { margin: 6px 4px 2px; font-size: 0.78rem; font-weight: 600; color: var(--cyan-600); }
.race-item__tipo {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; vertical-align: 1px;
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: var(--navy-800);
}
.race-item__tipo--running { background: #e8590c; }
.race-item__tipo--ciclismo { background: #2b8a3e; }
.race-item__tipo--natacion { background: #0b7285; }
.race-item__tipo--dual { background: #6741d9; }
.race-list {
  max-height: 340px; overflow-y: auto; border: 1.5px solid var(--gray-200); border-radius: 12px; padding: 4px 8px 8px;
  background: var(--white); overscroll-behavior: contain;
}
.race-group { position: sticky; top: -4px; margin: 0 -8px; padding: 8px 12px 4px; background: var(--white); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-500); z-index: 1; }
.race-group--pop { color: var(--cyan-600); }
.race-group--pop::before { content: '★ '; }
.race-item {
  font: inherit; width: 100%; text-align: left; cursor: pointer; display: grid; gap: 2px; padding: 8px 10px; margin-top: 4px;
  border: 1.5px solid transparent; border-radius: 10px; background: var(--gray-50); color: var(--navy-900);
}
.race-item:hover { border-color: var(--cyan-500); }
.race-item.is-on { border-color: var(--cyan-500); background: #e9f9fc; }
.race-item__name { font-weight: 600; font-size: 0.9rem; }
.race-item__meta { font-size: 0.76rem; color: var(--gray-500); }
.race-item__mods { display: flex; flex-wrap: wrap; gap: 4px; }
.race-item__mods i { font-style: normal; font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--gray-200); color: var(--gray-700); }
.race-empty { padding: 10px 4px; }
.picked { margin-top: 12px; border-radius: 12px; padding: 12px 14px; background: var(--navy-950); color: var(--white); }
.picked__head { display: flex; gap: 10px; align-items: center; }
.picked__head .split__icon { stroke: var(--cyan-400); }
.picked__head strong { display: block; font-family: var(--font-display); }
.picked__head .muted { color: var(--gray-300); }
.picked__lbl { margin: 10px 0 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-300); }
.picked__mods { display: flex; flex-wrap: wrap; gap: 6px; }
.picked__mods .chip { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.3); }
.picked__mods .chip.is-on { background: var(--cyan-400); color: var(--navy-950); border-color: var(--cyan-400); }
.picked__info { margin: 10px 0 0; font-size: 0.8rem; color: var(--gray-300); }
.photo__title .muted { margin-right: auto; }

/* ---------- Teléfono, consentimiento y NFC ---------- */
.phone { display: flex; gap: 6px; }
.phone select { width: auto; flex-shrink: 0; padding-right: 6px; }
.phone input { flex: 1; }
.field > .phone { font-size: inherit; font-weight: inherit; color: inherit; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 0.82rem; color: var(--gray-700); cursor: pointer; }
.consent input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; accent-color: var(--cyan-500); padding: 0; }
.nfc-line { margin: 8px 0 0; font-size: 0.82rem; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.nfc-status { color: var(--gray-500); word-break: break-all; }
.nfc-status.is-ok { color: var(--ok); font-weight: 600; }
.nfc-status.is-ok::before { content: '● '; }
.nfc-status.is-error { color: var(--bad); }
.nfc-line a { font-weight: 600; white-space: nowrap; }

/* ---------- Logo oficial y Diseño ---------- */
.step__sub { font-size: 0.9rem; margin: 18px 0 6px; }
.assets .hint:first-child { margin-top: 0; }
.design { display: grid; gap: 10px; }
.design__group { border: 1.5px solid var(--gray-200); border-radius: 12px; padding: 0 14px; background: var(--gray-50); }
.design__group[open] { padding-bottom: 14px; }
.design__group summary {
  cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; padding: 12px 0;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.design__group summary::-webkit-details-marker { display: none; }
.design__group summary::after { content: '+'; font-size: 1.2rem; color: var(--cyan-600); }
.design__group[open] summary::after { content: '−'; }
.link-btn { font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--cyan-600); background: none; border: 0; padding: 0; margin-top: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--navy-900); }
.font-pick { margin-bottom: 12px; }
.field > .font-pick__sample {
  display: block; margin-top: 4px; padding: 8px 12px; border-radius: 8px; background: var(--navy-950); color: var(--white);
  font-size: 1.15rem; letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.font-pick select optgroup { font-style: normal; font-weight: 700; }
.size-quick { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.size-quick .hint { margin: 0; }
.size-zone { margin: 14px 0 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray-500); }
.size-row { display: grid; grid-template-columns: 1fr; gap: 2px 10px; align-items: center; padding: 5px 0; font-size: 0.82rem; color: var(--gray-700); }
.size-row > span { font-weight: 600; }
.size-row input { padding: 0; border: 0; box-shadow: none; accent-color: var(--cyan-500); background: transparent; }
.size-row output { font-family: 'Share Tech Mono', monospace; font-size: 0.8rem; color: var(--navy-900); white-space: nowrap; }
@media (min-width: 560px) { .size-row { grid-template-columns: 170px 1fr 110px; } .size-row output { text-align: right; } }

/* ---------- Diálogo y toast ---------- */
.dlg { border: 0; border-radius: var(--radius); padding: 22px; max-width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.dlg::backdrop { background: rgba(10, 22, 40, 0.6); }
.dlg p { color: var(--gray-700); font-size: 0.9rem; }
.calib { overflow-x: auto; padding: 8px 0 14px; }
.calib__card {
  border-radius: 10px; background: linear-gradient(135deg, var(--navy-800), var(--cyan-600));
  display: grid; place-items: center; color: var(--white); font-weight: 700; font-family: var(--font-display);
}
#calib-range { padding: 0; border: 0; accent-color: var(--cyan-500); box-shadow: none; }
.dlg__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--navy-950); color: var(--white); padding: 12px 18px; border-radius: 12px; font-size: 0.88rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); transition: opacity .25s, transform .25s; z-index: 300;
  max-width: calc(100vw - 32px); border-left: 3px solid var(--cyan-400);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Biblioteca de logos ---------- */
.lib-line { margin: 0 0 8px; }
.lib-line .link-btn { margin: 0 0 0 4px; }
.dlg--wide { width: min(760px, calc(100vw - 32px)); max-width: none; }
.dlg__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dlg__head h3 { margin: 0; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; max-height: 55vh; overflow-y: auto; }
.lib-item { display: grid; gap: 4px; padding: 10px; border: 1.5px solid var(--gray-200); border-radius: 12px; font-size: 0.82rem; align-content: start; }
.lib-item__img {
  height: 96px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; padding: 6px;
  background: repeating-conic-gradient(#dfe5ec 0% 25%, #fff 0% 50%) 50% / 12px 12px;
}
.lib-item__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lib-item__actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.lib-item__actions .chip { font-size: 0.72rem; padding: 4px 9px; }

/* ---------- Ayuda por WhatsApp ---------- */
.btn--wa { background: #25d366; color: #073b1e; box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35); white-space: nowrap; }
.btn--wa:hover { background: #1fbd5a; color: #073b1e; transform: translateY(-1px); }
.intro__help {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; max-width: 760px; margin: 0 0 22px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(37, 211, 102, 0.35); background: rgba(37, 211, 102, 0.08);
}
.intro__help p { margin: 0; flex: 1 1 280px; font-size: 0.9rem; color: var(--gray-300); }
.intro__help strong { color: var(--white); }
.help-fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 250; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 10px; border-radius: 999px; background: #25d366; color: #073b1e;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); transition: transform .15s, box-shadow .15s;
}
.help-fab:hover { color: #073b1e; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32); }
.help-fab svg { width: 34px; height: 34px; flex-shrink: 0; fill: #fff; background: #128c4a; border-radius: 50%; padding: 6px; }
.help-fab span { display: flex; flex-direction: column; line-height: 1.15; }
.help-fab strong { font-family: var(--font-display); font-size: 0.86rem; }
.help-fab small { font-size: 0.72rem; font-weight: 600; opacity: 0.85; }
@media (max-width: 560px) {
  .help-fab { padding: 8px; }
  .help-fab span { display: none; }
  .toast { bottom: 76px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: var(--gray-300); padding: 26px 0 84px; font-size: 0.86rem; }
.site-footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.site-footer p { margin: 0; }
.site-footer strong { color: var(--white); font-family: var(--font-display); }
.site-footer a { color: var(--cyan-400); }
.site-footer .legal { margin-top: 14px; font-size: 0.74rem; color: var(--gray-500); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .toast, .progress__bar span { transition: none; }
}
