/* Estilos propios de la versión web (se cargan después de /ui/styles.css, compartido con la app de escritorio) */

a { color: var(--green-2); }
.brand { text-decoration: none; color: inherit; }
.disclaimer a { color: var(--text-3); }
.disclaimer a:hover { color: var(--green-2); }
a.cta { text-decoration: none; }

/* Cupo de análisis gratis */
.engine-chip.empty .dot { background: var(--amber); }
.engine-chip.byok .dot { background: var(--navy); }

/* ---------- Clave API ---------- */
.key-wrap { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .45s var(--ease), opacity .3s, margin .45s var(--ease); margin-top: 0; }
.key-wrap > div { overflow: hidden; min-height: 0; }
.key-wrap.show { grid-template-rows: 1fr; opacity: 1; margin-top: 16px; }
.key-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 2px; }
.key-input { flex: 1 1 360px; position: relative; }
.key-input input { padding-left: 40px; font-family: var(--mono); font-size: 13.5px; }
.key-input input.masked { -webkit-text-security: disc; }
.key-ic { position: absolute; left: 13px; top: 12px; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.key-input.ok .key-ic { color: var(--green); }
.key-input.bad input { border-color: var(--red); }
.key-note {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 999px; border: 0;
  background: var(--green-soft); color: var(--green-2); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: transform .25s var(--ease);
}
.key-note:hover { transform: translateY(-1px); }
.key-note svg { width: 16px; height: 16px; stroke-width: 2; }
.key-wrap .field-note { margin: 8px 4px 0; }

/* ---------- Huecos de anuncios (discretos, siempre etiquetados) ---------- */
.ad-slot { position: relative; display: none; border-radius: 16px; overflow: hidden; }
.ad-slot.on { display: block; }
.ad-slot::before {
  content: attr(data-label); position: absolute; top: 6px; right: 10px; z-index: 1;
  font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
}
.ad-wide { margin-top: 20px; min-height: 90px; }
.ad-box { min-height: 250px; }
.ad-slot ins { display: block; }
.ad-placeholder {
  height: 100%; min-height: inherit; display: grid; place-items: center; text-align: center; padding: 22px 18px;
  border: 1.5px dashed var(--line-2); border-radius: 16px; background: var(--inset); color: var(--text-3); font-size: 13px;
}
.ad-placeholder b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 2px; }

/* ---------- Ventanas modales ---------- */
.modal {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px;
  background: var(--backdrop); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card {
  width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--drawer); border-radius: 24px; padding: 26px 28px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
  transform: translateY(18px) scale(.97); transition: transform .45s var(--spring);
}
.modal.open .modal-card { transform: none; }

/* Anuncio de vídeo (nombres neutros: los bloqueadores ocultan las clases «ad-…») */
.im-card { width: min(720px, 100%); }
.im-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.im-head h2 { margin-top: 4px; }
.im-status { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; color: var(--text-2); }
.im-status i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
.im-status.ready { color: var(--green-2); font-weight: 600; }
.im-status.ready i { background: var(--green); animation: none; }
.im-timer { position: relative; width: 64px; height: 64px; flex: none; }
.im-timer svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.im-timer circle { stroke-width: 5; }
.im-timer .ring-fg { transition: stroke-dashoffset 1s linear; }
.im-timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.im-video { position: relative; margin-top: 18px; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0B1530; box-shadow: 0 0 0 1px var(--line); }
.im-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.im-badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 6px; background: rgba(0, 0, 0, .55);
  color: #FFFFFF; font-size: 12px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.im-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .18); }
.im-progress span { display: block; height: 100%; width: 0; background: #F2C230; transition: width 1s linear; }
.im-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.im-foot .cta:disabled { opacity: .55; }

/* Anuncio de demostración, con aspecto de vídeo (hasta que haya Google Ad Manager) */
.im-demo { width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 26px; color: #FFFFFF; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 0%, rgba(24, 170, 123, .45), transparent 60%), radial-gradient(100% 80% at 100% 100%, rgba(60, 100, 200, .5), transparent 60%), #0B1530; }
.im-demo .tag { margin-bottom: 12px; background: rgba(255, 255, 255, .14); color: #FFFFFF; }
.im-demo h3 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.im-demo p { color: rgba(255, 255, 255, .78); margin-top: 6px; max-width: 420px; }
.im-bars { display: flex; gap: 8px; align-items: flex-end; height: 70px; margin: 18px auto 0; justify-content: center; }
.im-bars i { width: 14px; height: 55%; border-radius: 4px 4px 2px 2px; background: #3DD2A0; animation: bars 1.6s var(--ease) infinite alternate; }
.im-bars i:nth-child(3n) { height: 85%; }
.im-bars i:nth-child(4n+1) { height: 35%; }
.im-bars i:nth-child(2n) { background: #8FB2FF; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes bars { from { height: 20%; } to { height: 100%; } }

/* Aviso de la clave */
.key-card { text-align: center; width: min(560px, 100%); }
.key-shield { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; background: var(--green-soft); color: var(--green-2); animation: bump .6s var(--spring); }
.key-shield svg { width: 32px; height: 32px; stroke-width: 2; }
.kd-list { list-style: none; margin: 16px 0 22px; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.kd-list li { padding: 12px 14px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--text-2); }
.kd-list b { color: var(--text); }

/* «Ver PDF» es un enlace con aspecto de botón */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--text); }

/* Informes guardados en este navegador */
.recent li.expired { opacity: .55; }
.recent li.expired .pdf-ic { background: var(--field); }

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .layout { padding: 10px 16px 36px; }
  .composer-row { flex-direction: column; }
  .composer-row .cta { width: 100%; }
  .engine-chip, .tagline { display: none; }
  .stepper .step { flex-basis: 110px; }
  .step-sub { display: none; }
  .run-grid, .result-grid, .keys { grid-template-columns: 1fr; }
  .result-head { flex-wrap: wrap; }
  .result-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .result-actions > * { min-width: 0; padding: 0 12px; }
  .result-actions #downloadPdf { grid-column: 1 / -1; }
  .im-foot .cta { width: 100%; }
  .im-demo { padding: 40px 18px 18px; }
  .im-demo .tag, .im-bars { display: none; }
  .im-demo h3 { font-size: 20px; }
  .im-demo p { font-size: 13px; }
  .modal-card { padding: 22px 20px; }
}
@media (max-width: 520px) {
  .wordmark { display: none; }  /* en móvil basta el logo: deja sitio al idioma y al tema */
  .brand-logo { height: 40px; }
}
