/* Popup «Solicita una DEMO»: panel dividido con borde neón y ruta de hitos.
   Se carga aparte (el popup aparece a los 7 s) y va después de ramo.min.css, por eso gana en la cascada. */
@property --dm-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes dm-rot { to { --dm-a: 360deg; } }
/* Entrada propia: ramo.css define dos «pop-in» y la segunda (tarjetas del mapa) hacía entrar el popup desde arriba y a la izquierda */
@keyframes dm-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

.demo-modal { background: rgba(2, 3, 1, .78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.demo-modal .demo-nw {
  position: relative; width: min(860px, 100%); padding: 2px; border-radius: 28px;
  background: conic-gradient(from var(--dm-a), #9BE916, #0a0a0a 25%, #9BE916 50%, #0a0a0a 75%, #9BE916);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .5), 0 0 80px rgba(155, 233, 22, .28);
  animation: dm-rot 5s linear infinite, dm-in .4s var(--ease) both;
}
.demo-modal .demo-box {
  width: auto; display: grid; grid-template-columns: .95fr 1.05fr; overflow: visible;
  background: #fff; border-radius: 26px; box-shadow: none; animation: none;
}
/* Las listas cerradas no ocupan espacio (si no, generan scroll dentro del popup) */
.demo-modal .dd:not(.open) .dd-list { display: none; }

/* Panel izquierdo */
.demo-side { border-radius: 26px 0 0 26px; background: linear-gradient(160deg, #162a02, #050505); color: #fff; padding: 30px 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.demo-ey { color: var(--lime); font-size: .74rem; letter-spacing: .1em; font-weight: 500; }
.demo-h3 { margin: 0; font-size: 1.45rem; line-height: 1.15; font-weight: 600; color: #fff; }
.demo-h3 em { font-style: normal; color: var(--lime); }
.demo-side ul { list-style: none; padding: 0; margin: 2px 0; }
.demo-side li { position: relative; padding-left: 26px; margin: 6px 0; font-size: .86rem; color: #d4dad0; }
.demo-side li::before { content: "✓"; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--lime); color: #000; font-size: .7rem; display: grid; place-items: center; }
.demo-chart { flex: 1; min-height: 190px; margin-top: 6px; }
.demo-chart svg { width: 100%; height: 100%; min-height: 190px; display: block; overflow: visible; }
.dm-dr { stroke-dasharray: 420; stroke-dashoffset: 420; animation: dm-dr 1.9s .3s cubic-bezier(.55, 0, .25, 1) forwards; }
@keyframes dm-dr { to { stroke-dashoffset: 0; } }
.dm-ah, .dm-pop { opacity: 0; animation: dm-sh .35s forwards; }
.dm-ah { animation-delay: 2.05s; }
@keyframes dm-sh { to { opacity: 1; } }

/* Panel derecho */
.demo-modal .demo-form { position: relative; padding: 34px 30px 30px; color: #0e1109; }
.demo-modal .demo-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: #eef0e8; color: #000; transition: background .2s, transform .2s; }
.demo-modal .demo-close:hover { background: var(--lime); transform: rotate(90deg); }
.demo-eb { font-family: ui-monospace, Menlo, monospace; font-size: .72rem; letter-spacing: .06em; color: #4a8200; margin: 0 0 8px; }
.demo-modal .demo-form h2 { text-align: left; font-size: 1.55rem; font-weight: 600; letter-spacing: -.015em; color: #0e1109; margin: 0 0 4px; padding-right: 34px; }
.demo-modal .demo-sub { text-align: left; color: #6a7160; font-size: .92rem; margin: 0 0 18px; }
.demo-modal .form.light .fl input, .demo-modal .form.light .dd-btn { background-color: #f3f5ee; border-color: #e0e5d3; }
.demo-modal .form.light .fl input:focus, .demo-modal .form.light .dd.open .dd-btn { box-shadow: 0 0 0 4px rgba(155, 233, 22, .22); }
.demo-modal [data-demo-form] .field:has(#pd-nombre), .demo-modal [data-demo-form] .field:has(#pd-email) { grid-column: 1 / -1; }
.demo-modal .demo-form .form-btn { width: 100%; justify-self: stretch; height: 52px; border-radius: 14px; font-weight: 600; justify-content: center; }

/* Confirmación */
.demo-ok { text-align: center; padding: 26px 4px 10px; }
.demo-ck { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: var(--lime); color: #000; display: grid; place-items: center; box-shadow: 0 0 0 0 rgba(155, 233, 22, .6), 0 0 44px rgba(155, 233, 22, .55); animation: dm-pop .55s cubic-bezier(.3, 1.6, .5, 1), dm-ring 1.8s .5s ease-out infinite; }
.demo-ck svg { width: 46px; height: 46px; }
.demo-ck circle { display: none; }
.demo-ck path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: dm-check .5s .35s ease-out forwards; }
@keyframes dm-pop { from { transform: scale(0); } }
@keyframes dm-ring { to { box-shadow: 0 0 0 26px rgba(155, 233, 22, 0), 0 0 44px rgba(155, 233, 22, .55); } }
@keyframes dm-check { to { stroke-dashoffset: 0; } }
.demo-ok .demo-okt { text-align: center; margin: 0 0 8px; font-size: 1.55rem; font-weight: 600; letter-spacing: -.015em; color: #0e1109; }
.demo-ok p { margin: 0 auto 18px; max-width: 32ch; color: #4a5142; }
.demo-bar { height: 4px; border-radius: 9px; background: #e5e9da; overflow: hidden; max-width: 220px; margin: 0 auto 8px; }
.demo-bar i { display: block; height: 100%; width: 0; background: var(--lime); animation: dm-bar 2.2s linear forwards; }
@keyframes dm-bar { to { width: 100%; } }
.demo-ok small { color: #6a7160; }

/* Móvil: un campo por fila, letras cómodas de leer y todo cabe en la pantalla sin hacer scroll */
@media (max-width: 760px) {
  .demo-modal { padding: 10px; align-items: center; }
  .demo-modal .demo-nw { border-radius: 22px; }
  .demo-modal .demo-box { grid-template-columns: 1fr; border-radius: 20px; }
  .demo-side { display: none; }
  .demo-modal .demo-form { padding: 18px 16px 16px; }
  .demo-modal .demo-close { top: 8px; right: 8px; width: 44px; height: 44px; }
  .demo-eb { font-size: .72rem; margin: 0 0 4px; }
  .demo-modal .demo-form h2 { font-size: 1.5rem; line-height: 1.15; padding-right: 48px; margin-bottom: 4px; }
  .demo-modal .demo-sub { font-size: .95rem; line-height: 1.35; margin: 0 0 12px; }
  .demo-modal [data-demo-form] { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .demo-modal .demo-form .fl input, .demo-modal .demo-form .dd-btn, .demo-modal .demo-form .fl .dd { height: 54px; }
  /* 16 px mínimo: con menos, iPhone amplía la página al tocar un campo y el popup se distorsiona */
  .demo-modal .demo-form .fl input, .demo-modal .demo-form .fl select, .demo-modal .demo-form .dd-btn { padding-top: 22px; font-size: 17px; }
  .demo-modal .demo-form .fl label { top: 17px; font-size: 15px; max-width: calc(100% - 34px); }
  .demo-modal .demo-form .fl:focus-within label, .demo-modal .demo-form .fl.is-filled label, .demo-modal .demo-form .fl.dd-open label, .demo-modal .demo-form .field.phone .fl label { top: 7px; font-size: 12.5px; }
  .demo-modal .demo-form .fl .iti__country-container { top: 20px; bottom: 4px; }
  .demo-modal .demo-form .field.check { margin-top: 2px; }
  .demo-modal .demo-form .field.check label { font-size: 13.5px; line-height: 1.4; gap: 11px; padding: 4px 0; }
  .demo-modal .demo-form .field.check input { width: 22px; height: 22px; flex: none; }
  .demo-modal .demo-form .form-btn { height: 54px; margin-top: 4px; font-size: 1.05rem; }
  .demo-modal .demo-form .dd-list li { font-size: 16px; padding: 12px 14px; }
  .demo-ok { padding: 14px 4px 6px; }
  .demo-ck { width: 72px; height: 72px; margin-bottom: 12px; }
  .demo-ck svg { width: 40px; height: 40px; }
  .demo-modal .demo-ok .demo-okt { font-size: 1.5rem; }
  .demo-ok p { font-size: 1rem; }
}
/* Pantallas de poca altura (≤ 650 px): algo más compacto para que siga cabiendo sin scroll */
@media (max-width: 760px) and (max-height: 650px) {
  .demo-modal .demo-form { padding: 14px 14px 12px; }
  .demo-modal .demo-sub { display: none; }
  .demo-eb { display: none; }
  .demo-modal .demo-form h2 { font-size: 1.35rem; }
  .demo-modal [data-demo-form] { gap: 7px; }
  .demo-modal .demo-form .fl input, .demo-modal .demo-form .dd-btn, .demo-modal .demo-form .fl .dd { height: 48px; }
  .demo-modal .demo-form .fl input, .demo-modal .demo-form .fl select, .demo-modal .demo-form .dd-btn { padding-top: 20px; font-size: 16px; }
  .demo-modal .demo-form .fl label { top: 14px; font-size: 14.5px; }
  .demo-modal .demo-form .fl:focus-within label, .demo-modal .demo-form .fl.is-filled label, .demo-modal .demo-form .fl.dd-open label, .demo-modal .demo-form .field.phone .fl label { top: 6px; font-size: 12px; }
  .demo-modal .demo-form .fl .iti__country-container { top: 17px; }
  .demo-modal .demo-form .field.check label { font-size: 12.5px; padding: 2px 0; }
  .demo-modal .demo-form .form-btn { height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-modal .demo-nw, .demo-ck { animation: none; }
  .dm-dr { animation: none; stroke-dashoffset: 0; }
  .dm-ah, .dm-pop { animation: none; opacity: 1; }
  .demo-bar i { animation: none; width: 100%; }
}

/* Lo que el script marca como oculto debe quedar oculto (el formulario, al mostrar la confirmación) */
.demo-modal [hidden] { display: none !important; }

/* Móvil y pantallas táctiles: estabilidad (sin desenfoque pesado ni animación de borde, que en Safari/iOS pueden deformar el popup) */
@media (max-width: 760px), (pointer: coarse) {
  .demo-modal { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(2, 3, 1, .86); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .demo-modal .demo-nw { animation: dm-in .4s var(--ease) both; background: linear-gradient(135deg, #9BE916, #0a0a0a 45%, #9BE916); }
  .demo-modal .demo-form .fl input, .demo-modal .demo-form .fl select, .demo-modal .demo-form .dd-btn { font-size: 16px; }
}
/* Cualquier campo de formulario del sitio en pantallas táctiles: 16 px para evitar el zoom automático de iOS */
@media (hover: none) and (pointer: coarse) {
  .fl input, .fl select, .fl textarea, .dd-btn { font-size: 16px; }
}
