/* Amigo invisible — app (assets/secret-santa.js). Tokens del tema con
   respaldo, así funciona igual fuera de ElegiFácil. */
.ef-si-app {
  --si-ink: var(--ef-text, #1a1a1a);
  --si-muted: #595959;
  --si-blue: var(--ef-ml-blue, #2968c8);
  --si-blue-dark: var(--ef-ml-blue-dark, #1f56a8);
  --si-yellow: #ffe600;
  --si-red: #d6324a;
  --si-green: #00814a;
  --si-wa: #128c4b;
  --si-border: #e4e7ee;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
  color: var(--si-ink);
}
.ef-si-col { width: 100%; max-width: 720px; margin: 0 auto; display: grid; gap: 16px; }

/* Explicación al lado del formulario (arriba en celular) */
.ef-si-split { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) {
  .ef-si-split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; }
  .ef-si-howto { position: sticky; top: calc(var(--ef-header-h, 0px) + 16px); }
}
.ef-si-howto {
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(160deg, #0b1430, #1b2a5c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}
.ef-si-howto h2 { margin: 0 0 16px; font-size: 20px; color: #fff; }
.ef-si-howto ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ef-si-howto li { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 12px 0; }
/* Línea que une los pasos */
.ef-si-howto li:not(:last-child)::after { content: ''; position: absolute; left: 21px; top: 56px; bottom: -8px; width: 2px; background: rgba(255,255,255,.14); }
.ef-si-howto-ico {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #ffe600;
}
.ef-si-howto li.is-current .ef-si-howto-ico { background: #ffe600; color: #1a1a1a; box-shadow: 0 0 0 6px rgba(255,230,0,.18); }
.ef-si-howto li.is-done .ef-si-howto-ico { background: #3ddc84; color: #0b1430; }
.ef-si-howto b { font-size: 16px; line-height: 1.35; }
.ef-si-howto-n { color: #ffe600; }
.ef-si-howto p { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: #c9d1e6; }
.ef-si-here { display: inline-block; margin-left: 4px; padding: 2px 8px; border-radius: 999px; background: #ffe600; color: #1a1a1a; font-size: 12px; font-weight: 800; vertical-align: 2px; }
.ef-si-howto-foot { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.14); font-size: 14px; color: #c9d1e6; }

/* Progreso: en qué paso está la persona y qué hacer ahora */
.ef-si-progress { background: #fff; border: 1px solid var(--si-border); border-radius: 20px; padding: 20px 24px; box-shadow: 0 4px 12px rgba(0, 0, 0, .05); }
.ef-si-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.ef-si-stepper li { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 14px; font-weight: 600; color: var(--si-muted); }
.ef-si-stepper li::before { content: ''; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--si-border); z-index: 0; }
.ef-si-stepper li:first-child::before { display: none; }
.ef-si-stepper li.is-done::before, .ef-si-stepper li.is-current::before { background: var(--si-green); }
.ef-si-stepper span {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 2px solid var(--si-border);
  font-size: 14px; font-weight: 800; color: var(--si-muted);
}
.ef-si-stepper span svg { width: 16px; height: 16px; }
.ef-si-stepper li.is-done { color: var(--si-ink); }
.ef-si-stepper li.is-done span { background: var(--si-green); border-color: var(--si-green); color: #fff; }
.ef-si-stepper li.is-current { color: var(--si-ink); font-weight: 800; }
.ef-si-stepper li.is-current span { background: var(--si-yellow); border-color: var(--si-yellow); color: #1a1a1a; box-shadow: 0 0 0 5px rgba(255,230,0,.25); }
.ef-si-now { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: #fff8d6; font-size: 15px; line-height: 1.5; }
.ef-si-loading { text-align: center; color: var(--si-muted); padding: 48px 0; min-height: 520px; } /* reserva el alto de la app: sin esto el footer subía y saltaba (CLS) */
.ef-si-app [hidden] { display: none !important; }

.ef-si-card {
  background: #fff;
  border: 1px solid var(--si-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}
.ef-si-card h2 { margin: 0 0 8px; font-size: clamp(22px, 4vw, 28px); line-height: 1.2; letter-spacing: -.02em; }
.ef-si-card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.ef-si-card h3 small { font-size: 14px; font-weight: 500; color: var(--si-muted); }
.ef-si-card p { margin: 0 0 16px; line-height: 1.55; }
.ef-si-card p:last-child { margin-bottom: 0; }
.ef-si-eyebrow { font-size: 14px !important; font-weight: 700; color: var(--si-blue); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px !important; }
.ef-si-meta { font-size: 15px; color: var(--si-muted); }
.ef-si-fine { font-size: 14px; color: var(--si-muted); }
.ef-si-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Formularios */
.ef-si-form { display: grid; gap: 16px; }
.ef-si-form label { display: grid; gap: 6px; font-size: 15px; font-weight: 600; }
.ef-si-form label small { font-weight: 500; color: var(--si-muted); }
.ef-si-app input,
.ef-si-app select,
.ef-si-app textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--si-border);
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--si-ink);
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ef-si-app textarea { resize: vertical; line-height: 1.5; }
.ef-si-app input:focus,
.ef-si-app select:focus,
.ef-si-app textarea:focus { outline: none; border-color: var(--si-blue); box-shadow: 0 0 0 4px rgba(41, 104, 200, .15); }
.ef-si-row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.ef-si-money { position: relative; display: block; }
.ef-si-money::before { content: '$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--si-muted); }
.ef-si-money input { padding-left: 28px; }
.ef-si-me { border: 1px dashed var(--si-border); border-radius: 14px; padding: 16px; margin: 0; display: grid; gap: 16px; }
.ef-si-me legend { padding: 0 6px; font-weight: 700; font-size: 15px; }
.ef-si-inline { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.ef-si-inline input, .ef-si-inline select { flex: 1 1 160px; width: auto; }
.ef-si-inline span { color: var(--si-muted); }

/* Botones */
.ef-si-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--si-blue);
  color: #fff !important;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.ef-si-btn:hover { background: var(--si-blue-dark); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(41, 104, 200, .25); }
.ef-si-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.ef-si-btn--ghost { background: #fff; color: var(--si-blue) !important; border: 1.5px solid var(--si-blue); }
.ef-si-btn--ghost:hover { background: #f2f7ff; box-shadow: none; }
.ef-si-btn--wa { background: var(--si-wa); }
.ef-si-btn--wa:hover { background: #0e7340; box-shadow: 0 6px 16px rgba(18, 140, 75, .25); }
.ef-si-btn--big { width: 100%; min-height: 56px; font-size: 18px; }
.ef-si-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ef-si-undo, .ef-si-link-btn {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--si-blue);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.ef-si-undo { display: block; margin-top: 12px; color: var(--si-muted); }
.ef-si-x {
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: none;
  color: var(--si-muted);
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.ef-si-x:hover { background: #fdecef; color: var(--si-red); }

/* Avisos */
.ef-si-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fdecef; color: #a3152b; font-size: 15px; font-weight: 600; }
.ef-si-ok { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: #e7f6ee; color: #0b5a34; font-size: 15px; font-weight: 600; }

/* Panel del organizador */
.ef-si-head { background: linear-gradient(135deg, #0b1430, #1b2a5c); color: #fff; border: 0; }
.ef-si-head .ef-si-eyebrow { color: var(--si-yellow); }
.ef-si-head .ef-si-meta { color: #c9d1e6; }
.ef-si-link { display: flex; gap: 8px; margin-bottom: 12px; }
.ef-si-link input { flex: 1; min-width: 0; font-size: 14px; color: var(--si-muted); background: #f6f8fb; }
.ef-si-count { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: #eef3fb; color: var(--si-blue); font-size: 14px; }
.ef-si-people, .ef-si-ex { list-style: none; margin: 0; padding: 0; }
.ef-si-people li, .ef-si-ex li {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 52px; padding: 4px 0;
  border-bottom: 1px solid #f0f2f6;
}
.ef-si-people li:last-child, .ef-si-ex li:last-child { border-bottom: 0; }
.ef-si-name { font-weight: 600; margin-right: auto; }
.ef-si-tag { font-size: 14px; padding: 2px 10px; border-radius: 999px; background: #f2f4f8; color: var(--si-muted); }
.ef-si-tag--ok { background: #e7f6ee; color: var(--si-green); }
.ef-si-done { border: 2px solid var(--si-green); }
.ef-si-done .ef-si-btn { margin: 0 8px 8px 0; }
.ef-si-mine ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.ef-si-mine a { font-weight: 600; color: var(--si-blue); }

/* Revelación */
.ef-si-reveal { text-align: center; padding: 32px 24px; background: radial-gradient(circle at 50% 0%, #fff8c4, #fff 60%); }
.ef-si-gift {
  display: inline-grid; justify-items: center; gap: 16px;
  margin: 8px auto 0; padding: 16px 24px;
  border: 0; background: none; cursor: pointer;
  font: inherit;
}
.ef-si-gift-box { position: relative; width: 120px; height: 112px; animation: ef-si-wiggle 2.4s ease-in-out infinite; }
.ef-si-gift-body, .ef-si-gift-lid { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 10px; background: var(--si-red); }
.ef-si-gift-body { bottom: 0; width: 104px; height: 76px; }
.ef-si-gift-lid { top: 14px; width: 120px; height: 28px; background: #e8475e; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1), opacity .6s ease; }
.ef-si-gift-body::before, .ef-si-gift-lid::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 18px; transform: translateX(-50%); background: var(--si-yellow); }
.ef-si-gift-lid::after {
  content: ''; position: absolute; left: 50%; top: -22px; width: 44px; height: 24px; transform: translateX(-50%);
  border: 8px solid var(--si-yellow); border-bottom: 0; border-radius: 24px 24px 0 0;
}
.ef-si-gift-cta { font-size: 18px; font-weight: 700; color: var(--si-blue); }
.ef-si-gift:hover .ef-si-gift-box { animation-duration: .8s; }
.ef-si-reveal.is-opening .ef-si-gift-box { animation: none; }
.ef-si-reveal.is-opening .ef-si-gift-lid { transform: translate(-50%, -60px) rotate(-18deg); opacity: 0; }
.ef-si-result { animation: ef-si-pop .55s cubic-bezier(.2, .9, .3, 1.3) both; }
.ef-si-target { font-size: clamp(36px, 8vw, 56px) !important; margin: 8px 0 16px !important; color: var(--si-ink); }
.ef-si-quote { margin: 0 auto 16px; max-width: 520px; padding: 16px 20px; border-radius: 16px; background: #f4f8ff; font-size: 17px; line-height: 1.5; text-align: left; }
.ef-si-quote span { display: block; font-size: 14px; font-weight: 700; color: var(--si-blue); margin-bottom: 4px; }
.ef-si-quote--empty { background: #fff7e0; font-size: 15px; }
.ef-si-secret { font-size: 14px; font-weight: 600; color: var(--si-red); }
.ef-si-ideas-link { margin-top: 8px; }
#abot-gift-results { scroll-margin-top: calc(var(--ef-header-h, 0px) + 16px); }
.ef-si-save { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #f6fbf8; border-color: #d2ecdd; }
.ef-si-save p { flex: 1 1 260px; margin: 0; font-size: 15px; }
.ef-si-spread { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, #0b1430, #1b2a5c); color: #fff; border: 0; }
.ef-si-spread > div { flex: 1 1 280px; }
.ef-si-spread b { display: block; font-size: 18px; margin-bottom: 4px; }
.ef-si-spread p { margin: 0; font-size: 15px; color: #c9d1e6; }
.ef-si-spread .ef-si-btn { background: var(--si-yellow); color: #1a1a1a !important; }
.ef-si-spread .ef-si-btn:hover { background: #fff04d; box-shadow: 0 6px 16px rgba(255, 214, 0, .3); }

@keyframes ef-si-wiggle {
  0%, 70%, 100% { transform: rotate(0); }
  75% { transform: rotate(-6deg); }
  85% { transform: rotate(6deg); }
  95% { transform: rotate(-3deg); }
}
@keyframes ef-si-pop { from { opacity: 0; transform: scale(.85) translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  .ef-si-card { padding: 20px 16px; border-radius: 16px; }
  .ef-si-howto { padding: 20px 16px; border-radius: 16px; }
  .ef-si-progress { padding: 16px 12px; border-radius: 16px; }
  .ef-si-row { grid-template-columns: 1fr; }
  .ef-si-btn { width: 100%; }
  .ef-si-inline .ef-si-btn, .ef-si-link .ef-si-btn { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ef-si-gift-box, .ef-si-result { animation: none; }
  .ef-si-gift-lid { transition: none; }
}
