/* ==========================================================================
   ivansoto.es · subscribe.css — popup «Te aviso de la formación» (30-oct-2026)
   El contenido (.sub) se clona dentro del modal genérico (#swModal, fuera de #smooth-content). Mientras está
   abierto, subscribe.js pone .is-sub en #swModal y .modal-panel--sub en el panel: cristal translúcido con
   blur de verdad (es un flotante: aquí sí va backdrop-filter) y fondo de la página más desenfocado.
   Lima solo en el botón principal y en el check del éxito.
   ========================================================================== */
.s-subscribe { display: none !important; }

/* ---------- Modal en modo popup ---------- */
#swModal.is-sub .modal-backdrop {
  background: rgba(24, 22, 18, 0.30);
  -webkit-backdrop-filter: blur(10px) saturate(125%); backdrop-filter: blur(10px) saturate(125%);
}
#swModal .modal-panel.modal-panel--sub {
  width: min(540px, 100%);
  padding: 10px 10px clamp(20px, 3.6vw, 28px);
  border-radius: 28px;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.95), transparent 60%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.75) 55%, rgba(250, 248, 244, 0.80) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 50px 120px rgba(30, 25, 15, 0.30), 0 0 0 1px rgba(15, 20, 30, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  scrollbar-width: thin;
}
#swModal .modal-panel--sub.corner-glass::before {
  background:
    radial-gradient(260px 160px at 0% 0%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.35) 45%, transparent 75%),
    radial-gradient(260px 160px at 100% 100%, rgba(244, 240, 232, 0.65), rgba(244, 240, 232, 0.2) 45%, transparent 75%);
}
#swModal.is-sub .modal-close {
  top: 20px; right: 20px; background: rgba(255, 255, 255, 0.72); border-color: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(40, 30, 15, 0.10);
  transition: scale 0.35s var(--ease), background 0.25s ease;
}
@media (hover: hover) { #swModal.is-sub .modal-close:hover { background: #fff; scale: 1.06; } }

.sub { display: grid; }

/* ---------- Cabecera: las dos fichas de cristal sobre puntos y orbes ---------- */
.sub-art {
  position: relative; height: 168px; border-radius: 19px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(rgba(20, 24, 31, 0.13) 1px, transparent 1.6px) 0 0 / 16px 16px,
    linear-gradient(160deg, #f6f4f0 0%, #eeebe4 100%);
  border: 1px solid rgba(15, 20, 30, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -18px 30px rgba(255, 255, 255, 0.35);
}
.sub-orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(26px); pointer-events: none; }
.sub-orb--1 { width: 190px; height: 190px; left: 14%; top: -38%; background: rgba(217, 119, 87, 0.30); }
.sub-orb--2 { width: 200px; height: 200px; right: 10%; bottom: -52%; background: rgba(149, 191, 71, 0.30); }
.sub-orb--3 { width: 130px; height: 130px; left: 44%; top: 34%; background: rgba(20, 24, 31, 0.10); }
.sub-badge {
  position: absolute; left: 14px; top: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 12px 7px 10px; border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.74); border: 1px solid rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%);
  box-shadow: 0 4px 14px rgba(40, 30, 15, 0.08);
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-2);
}
.sub-badge i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--fg); }
.sub-badge i::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid rgba(20, 24, 31, 0.35);
  animation: sub-ping 2.2s var(--ease-out) infinite;
}
@keyframes sub-ping { 0% { scale: 0.5; opacity: 1; } 80%, 100% { scale: 1.6; opacity: 0; } }
.sub-tiles { position: absolute; left: 50%; top: 54%; z-index: 1; display: flex; align-items: center; gap: 12px; translate: -50% -50%; }
.sub-tile { display: block; width: 88px; height: 88px; }
.sub-tile-f {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 27px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.36) 52%, rgba(255, 255, 255, 0.22) 100%);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 36px rgba(40, 30, 15, 0.16), inset 0 1px 1px rgba(255, 255, 255, 0.95), inset 0 -3px 8px rgba(20, 24, 31, 0.05);
}
.sub-tile svg { width: 46%; height: 46%; overflow: visible; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12)); }
.sub-plus { font-family: var(--mono); font-size: 18px; font-weight: 500; color: rgba(20, 24, 31, 0.42); }
.sub-ring {
  position: absolute; left: 50%; top: 54%; z-index: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; border: 3px solid var(--accent); opacity: 0; pointer-events: none;
}

/* ---------- Textos ---------- */
.sub-view { padding: 0 clamp(12px, 2.6vw, 20px); }
.sub-view[hidden] { display: none; }
.sub-view--form { margin-top: 24px; }
.sub-k { margin-bottom: 12px; }
.sub-title { font-size: clamp(23px, 3.3vw, 29px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; color: var(--fg); }
.sub-title:focus { outline: none; }
.sub-l { display: block; }
.sub-l--2 { color: rgba(20, 24, 31, 0.46); }
.sub-text { margin-top: 12px; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); }
.sub-text b { color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Formulario ---------- */
.sub-form { display: grid; gap: 14px; margin-top: 20px; }
.sub-row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 12px; }
.sub-fld { display: grid; gap: 7px; align-content: start; min-width: 0; }
.sub-lbl { font-size: 12.5px; font-weight: 600; color: var(--fg-1); }
.sub-opt { margin-left: 6px; font-family: var(--mono); font-size: 9px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-4); }
.sub-ctl input, .sub-more textarea {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid rgba(15, 20, 30, 0.14); color: var(--fg); caret-color: var(--fg);
  box-shadow: 0 1px 2px rgba(60, 50, 35, 0.04), inset 0 1px 0 #fff; font-size: 15px; outline: none;
  -webkit-appearance: none; appearance: none; transition: border-color 0.25s ease, box-shadow 0.35s ease, background 0.25s ease;
}
.sub-more textarea { height: auto; min-height: 84px; padding: 13px 16px; line-height: 1.5; resize: vertical; font-size: 14.5px; }
.sub-ctl input::placeholder, .sub-more textarea::placeholder { color: rgba(20, 24, 31, 0.5); opacity: 1; }
@media (hover: hover) { .sub-ctl input:hover, .sub-more textarea:hover { border-color: var(--line-3); } }
.sub-ctl input:focus, .sub-more textarea:focus { background: #fff; border-color: rgba(20, 24, 31, 0.7); box-shadow: 0 0 0 4px rgba(20, 24, 31, 0.08), 0 10px 26px rgba(60, 50, 35, 0.08); }
.sub-ctl input:-webkit-autofill, .sub-ctl input:-webkit-autofill:hover, .sub-ctl input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--fg); -webkit-box-shadow: 0 0 0 1000px #ffffff inset; box-shadow: 0 0 0 1000px #ffffff inset; transition: background-color 600000s 0s, color 600000s 0s;
}
.sub-err { display: none; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.45; color: var(--fg); }
.sub-err::before, .sub-formerr::before {
  content: '!'; flex: none; display: grid; place-items: center; width: 15px; height: 15px; margin-top: 1px; border-radius: 50%;
  background: var(--fg); color: var(--bg); font-family: var(--font); font-size: 10px; font-weight: 800; line-height: 1;
}
.sub-err.is-on { display: flex; animation: sub-in 0.4s var(--ease-out); }
.sub-fld.is-err .sub-ctl input { border-color: rgba(20, 24, 31, 0.78); box-shadow: 0 0 0 3px rgba(20, 24, 31, 0.07); }
@keyframes sub-in { from { opacity: 0; translate: 0 -4px; } }

/* franja de inversión (paso 1): mismas píldoras que el paso 2 */
.sub-budget .sub-chips { margin-top: 2px; }
.sub-budget.is-err .sub-chip span { border-color: rgba(20, 24, 31, 0.6); }
.sub-checks { gap: 8px; }
.sub-check { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; cursor: pointer; }
.sub-check input { position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin: 0; opacity: 0; cursor: pointer; }
.sub-cb { position: relative; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid rgba(15, 20, 30, 0.3); background: #ffffff; transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.3s ease, scale 0.3s var(--ease); }
.sub-cb::after { content: ''; position: absolute; left: 6.5px; top: 2.5px; width: 5px; height: 10px; border-right: 2px solid var(--inv-fg); border-bottom: 2px solid var(--inv-fg); transform: rotate(45deg) scale(0); transition: transform 0.35s var(--ease) 0.05s; }
.sub-check input:checked + .sub-cb { background: var(--inv-bg); border-color: var(--inv-bg); }
.sub-check input:checked + .sub-cb::after { transform: rotate(45deg) scale(1); }
.sub-check input:focus-visible + .sub-cb { outline: 2px solid rgba(20, 24, 31, 0.8); outline-offset: 2px; }
.sub-check:active .sub-cb { scale: 0.9; }
@media (hover: hover) { .sub-check:hover .sub-cb { border-color: rgba(20, 24, 31, 0.55); } }
.sub-ct { font-size: 13px; line-height: 1.55; color: var(--fg-2); padding-top: 1px; }
.sub-ct a, .sub-legal a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(20, 24, 31, 0.4); }
.sub-checks.is-err .sub-cb { border-color: var(--fg); box-shadow: 0 0 0 4px rgba(20, 24, 31, 0.08); }
.sub-hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.sub-submit { width: 100%; margin-top: 2px; }
.sub-spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(20, 24, 31, 0.25); border-top-color: currentColor; animation: sub-rot 0.8s linear infinite; }
.btn-primary .sub-spin { border-color: rgba(247, 246, 243, 0.3); border-top-color: var(--inv-fg); }
.is-busy .sub-spin { display: inline-block; }
.is-busy > .arrow { display: none; }
.is-busy { pointer-events: none; }
@keyframes sub-rot { to { rotate: 360deg; } }
.sub-formerr { display: flex; align-items: flex-start; gap: 8px; padding: 11px 13px; border-radius: 12px; background: rgba(244, 242, 238, 0.9); border: 1px solid rgba(15, 20, 30, 0.14); font-size: 13px; line-height: 1.5; color: var(--fg); }
.sub-formerr[hidden] { display: none; }
.sub-micro { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); }
.sub-micro span { display: inline-flex; align-items: center; gap: 7px; }
.sub-micro span::before { content: ''; width: 9px; height: 5px; margin-top: -3px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: -45deg; }
.sub-legal { font-size: 11px; line-height: 1.6; color: var(--fg-3); }
.sub-legal b { font-weight: 600; color: var(--fg-2); }

/* ---------- Éxito y paso 2 ---------- */
.sub-view--ok, .sub-view--end { margin-top: 24px; }
.sub-okmark { width: 56px; height: 56px; margin-bottom: 16px; overflow: visible; filter: drop-shadow(0 14px 26px rgba(40, 30, 15, 0.18)); }
.sub-okmark-c { fill: var(--inv-bg); }
.sub-okmark-p { fill: none; stroke: var(--accent); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.sub-want { display: grid; gap: 14px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.sub-fs { margin: 0; padding: 0; border: 0; min-width: 0; }
.sub-q { padding: 0; font-size: 14px; font-weight: 650; line-height: 1.45; color: var(--fg); letter-spacing: -0.01em; }
.sub-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sub-chip { position: relative; cursor: pointer; }
.sub-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sub-chip span {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(15, 20, 30, 0.14); color: var(--fg-1);
  font-size: 13px; font-weight: 550; letter-spacing: -0.005em; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(60, 50, 35, 0.04);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, scale 0.3s var(--ease), box-shadow 0.3s ease;
}
@media (hover: hover) { .sub-chip:hover span { border-color: var(--line-3); box-shadow: 0 6px 16px rgba(60, 50, 35, 0.08); } }
.sub-chip:active span { scale: 0.96; }
.sub-chip input:checked + span { background: var(--inv-bg); border-color: var(--inv-bg); color: var(--inv-fg); box-shadow: 0 8px 20px rgba(20, 24, 31, 0.18); }
.sub-chip input:focus-visible + span { outline: 2px solid rgba(20, 24, 31, 0.8); outline-offset: 2px; }
.sub-more[hidden] { display: none; }
.sub-more { overflow: hidden; }
.sub-want-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.sub-skip { font-size: 13px; font-weight: 550; color: var(--fg-3); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(20, 24, 31, 0.3); transition: color 0.2s ease; }
@media (hover: hover) { .sub-skip:hover { color: var(--fg); } }
.sub-end-btn { margin-top: 22px; }

/* ---------- Móvil ---------- */
@media (max-width: 560px) {
  #swModal.is-sub { padding: 12px; }
  #swModal .modal-panel.modal-panel--sub { border-radius: 24px; max-height: calc(100svh - 24px); }
  .sub-art { height: 142px; border-radius: 16px; }
  .sub-tiles, .sub-ring { top: 62%; }
  .sub-badge { left: 10px; top: 10px; padding: 6px 10px 6px 9px; font-size: 9px; letter-spacing: 0.12em; }
  .sub-tile { width: 70px; height: 70px; }
  .sub-tile-f { border-radius: 22px; }
  .sub-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .sub-view--form { margin-top: 18px; }
  .sub-want-send, .sub-end-btn { width: 100%; }
  .sub-want-row { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .sub-badge i::after { animation: none; } .sub-spin { animation-duration: 2.4s; } }
