/* ============================================================================
   PUENTE v4 · COMPONENTES — las mismas piezas que Kuak Studio, con las mismas
   clases y las mismas medidas. Un botón de esta web y un botón de la app son
   el mismo botón: 32/40/48 de alto, radio 8, peso 500, base «vidrio».
   ========================================================================== */

/* ── Botones ──────────────────────────────────────────────────────────────
   Base = vidrio (blanco/negro al 5 %), sin borde. Las variantes se declaran
   con doble clase `.btn.btn--x` por la misma razón que en Studio: la base
   también aplica a `a.btn`/`button.btn` (0,1,1) y aplastaría a una variante
   de una sola clase. */
.btn,
a.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 40px;
  padding: 0 var(--space-xl);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  background: var(--bg-pill);
  color: var(--text-primary);
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-instant) var(--ease-out);
}
.btn:hover { background: var(--bg-pill-hover); }
.btn:active { transform: scale(.98); }
/* Deshabilitado a la manera de Cosmos: relleno sólido y texto terciario, sin
   `opacity` (un botón medio transparente sigue pareciendo pulsable). */
.btn:disabled,
.btn[disabled],
.btn[aria-disabled="true"] {
  background: var(--surface-3);
  color: var(--text-tertiary);
  cursor: not-allowed;
  transform: none;
}

.btn.btn--primary {
  background: var(--accent-blue);
  color: var(--text-on-accent);
}
.btn.btn--primary:hover { background: var(--accent-blue-hover); }
.btn.btn--primary:disabled,
.btn.btn--primary[disabled] { background: var(--surface-3); color: var(--text-tertiary); }

.btn.btn--outline {
  background: transparent;
  border-color: color-mix(in srgb, var(--text-primary) 20%, transparent);
}
.btn.btn--outline:hover {
  background: var(--bg-pill);
  border-color: color-mix(in srgb, var(--text-primary) 35%, transparent);
}

.btn.btn--ghost { background: transparent; }
.btn.btn--ghost:hover { background: var(--bg-pill-hover); }

/* Tinta: el botón «negro» de la cabecera (blanco sobre negro en el tema
   oscuro). Es el CTA de navegación de las webs del sector; el azul se guarda
   para la acción del producto («Generar», «Elegir Pro»). */
.btn.btn--ink { background: var(--page-ink); color: var(--page-bg); }
.btn.btn--ink:hover { background: color-mix(in srgb, var(--page-ink) 85%, var(--accent-blue)); }

.btn.btn--sm  { min-height: 34px; padding: 0 var(--space-lg); font-size: var(--text-xs); }
.btn.btn--lg  { min-height: 50px; padding: 0 var(--space-2xl); font-size: var(--text-base); font-weight: 600; }
.btn.btn--full { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* ── Tarjeta ──────────────────────────────────────────────────────────────
   Vive DENTRO de un panel y se separa de él con un escalón de la rampa
   (--bg-elev) más un hairline. Sin sombra en reposo: la sombra es la
   respuesta al puntero, no un adorno permanente. */
.card {
  background: var(--bg-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-card);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-card);
}
@media (hover: hover) {
  .card--hover {
    transition:
      transform var(--dur-normal) var(--ease-out),
      box-shadow var(--dur-normal) var(--ease-out),
      border-color var(--dur-normal) var(--ease-out);
  }
  .card--hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--divider);
  }
}

/* ── Píldoras, chips y distintivos ───────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 30px;
  padding: 4px 12px;
  background: var(--bg-pill);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.pill:hover { background: var(--bg-pill-hover); color: var(--text-primary); }
.pill.is-active {
  background: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--tint-blue);
  color: var(--accent-blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge--neutral { background: var(--tint-neutral); color: var(--text-secondary); }
.badge--green   { background: var(--tint-green);   color: var(--accent-green); }

/* ── Aviso (.kn) ──────────────────────────────────────────────────────────
   Receta de Studio: el color vive en el glifo y en el filo izquierdo, nunca
   en un fondo saturado que se coma el texto. */
.kn {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--divider);
  border-left: 3px solid var(--text-tertiary);
  border-radius: var(--radius-notice);
  background: var(--bg-elev);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.kn strong { color: var(--text-primary); font-weight: 600; }
.kn--ok    { border-left-color: var(--accent-green); }
.kn--warn  { border-left-color: var(--color-warning); }
.kn--error { border-left-color: var(--color-error); }

/* ── Campo de texto ───────────────────────────────────────────────────────
   Input «vidrio» al 5 %, sin borde en reposo: el borde aparece al enfocar.
   Solo `.field__input`: el formulario de contacto se retiró en la 4.2 y con él
   el `<textarea>`, el `<select>`, la etiqueta y la ayuda. Lo que queda lo usan
   el buscador del blog y el del 404. */
.field__input {
  width: 100%;
  min-height: 44px;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-pill);
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.field__input::placeholder { color: var(--text-tertiary); }
.field__input:focus {
  outline: none;
  background: var(--bg-pill-hover);
  border-color: var(--focus-border);
}

/* ── Avatar ─────────────────────────────── 32 px, igual que la topbar de Studio */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: var(--bg-pill);
  border: 1px solid var(--divider);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 700;
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), transform var(--dur-instant) var(--ease-out);
}
.avatar:hover {
  background: var(--bg-active);
  border-color: color-mix(in srgb, var(--accent-blue) 55%, var(--divider));
}
.avatar:active { transform: scale(.94); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Menú desplegable ─────────────────────────────────────────────────────
   Es de las pocas piezas con sombra: flota de verdad sobre el contenido. */
.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-dropdown);
  min-width: 232px;
  padding: var(--space-sm);
  background: var(--bg-modal);
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  transform-origin: top right;
}
.menu[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .menu { animation: menu-in var(--dur-fast) var(--ease-out) both; }
  @keyframes menu-in {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to   { opacity: 1; transform: none; }
  }
}
.menu__head {
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-sm);
}
.menu__name  { font-size: var(--text-sm); font-weight: 600; }
.menu__mail  {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  min-height: 36px;
  padding: 0 var(--space-lg);
  border-radius: var(--radius-button);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.menu__item:hover { background: var(--bg-pill); color: var(--text-primary); }
.menu__item svg { width: 16px; height: 16px; flex: 0 0 auto; opacity: .7; }

/* ── Panel deslizante (drawer) ────────────────────────────────────────────
   Lo usa el panel de compra. En escritorio entra desde la derecha; en móvil
   sube desde abajo, que es donde está el pulgar. */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  /* Velo SÓLIDO (sin `backdrop-filter`): sobre un lienzo con capas fijas,
     WebKit deja una capa fantasma que sobrevive al cierre. En Studio la
     solución fue exactamente esta (`.modal-backdrop--solid`). */
  background: var(--overlay);
}
@media (prefers-reduced-motion: no-preference) {
  .drawer-backdrop { animation: fade-in var(--dur-fast) var(--ease-out) both; }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
}

.drawer {
  position: fixed;
  z-index: var(--z-modal);
  inset: var(--gap-shell) var(--gap-shell) var(--gap-shell) auto;
  width: min(468px, calc(100vw - var(--gap-shell) * 2));
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .drawer { animation: drawer-in var(--dur-normal) var(--ease-out) both; }
  @keyframes drawer-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: none; }
  }
}
.drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-2xl) var(--space-2xl) var(--space-lg);
  flex: 0 0 auto;
}
.drawer__title { font-size: var(--text-xl); font-weight: 700; letter-spacing: -.01em; }
.drawer__sub   { margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--text-secondary); }
.drawer__close {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  flex: 0 0 auto;
  border-radius: var(--radius-button);
  color: var(--text-secondary);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.drawer__close:hover { background: var(--bg-pill); color: var(--text-primary); }
.drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 var(--space-2xl) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}
.drawer__foot {
  flex: 0 0 auto;
  padding: var(--space-lg) var(--space-2xl) var(--space-2xl);
  border-top: 1px solid var(--hairline);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-align: center;
}
.drawer__foot a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 560px) {
  .drawer {
    inset: auto 0 0 0;
    width: 100%;
    max-height: 92svh;
    border-radius: var(--radius-hero) var(--radius-hero) 0 0;
  }
  @media (prefers-reduced-motion: no-preference) {
    .drawer { animation-name: drawer-up; }
    @keyframes drawer-up {
      from { opacity: 0; transform: translateY(28px); }
      to   { opacity: 1; transform: none; }
    }
  }
}

/* ── Estado vacío ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
  padding: var(--space-4xl) var(--space-2xl);
  border: 1px dashed var(--divider);
  border-radius: var(--radius-card);
}
.empty-state h2 { font-size: var(--text-xl); font-weight: 600; }
.empty-state p  { color: var(--text-secondary); font-size: var(--text-sm); max-width: 44ch; }

/* ── Botón de proveedor (Google) ──────────────────────────────────────────
   Copia exacta del `.au__provider` del login de Studio: 52 px, borde visible,
   etiqueta a la izquierda. Quien lo ve en /precios/ reconoce el mismo botón
   con el que entra en la app. */
.provider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  min-height: 52px;
  padding: 0 var(--space-lg);
  border: 1px solid var(--divider);
  border-radius: var(--radius-button);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-instant) var(--ease-out);
}
.provider:hover {
  background: var(--bg-pill);
  border-color: color-mix(in srgb, var(--text-secondary) 50%, transparent);
}
.provider:active { transform: scale(.99); }
.provider__label { flex: 1; text-align: left; }
.provider svg { width: 18px; height: 18px; }

/* ── Cargando ─────────────────────────────────────────────────────────────
   Un aro, no un texto que parpadea. Se detiene con «reducir movimiento». */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--divider);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--divider); }
}

/* ── Pregunta desplegable ─────────────────────────────────────────────────
   `<details>` nativo: funciona sin JavaScript y es accesible de fábrica. */
.qa {
  border-bottom: 1px solid var(--hairline);
}
.qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--accent-blue); }
.qa summary::after {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  opacity: .5;
  transition: transform var(--dur-fast) var(--ease-out);
}
.qa[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.qa__body {
  padding: 0 0 var(--space-xl);
  max-width: 68ch;
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}
@media (prefers-reduced-motion: no-preference) {
  .qa[open] .qa__body { animation: rise var(--dur-fast) var(--ease-out) both; }
}

/* ── Ventana de navegador (maqueta) ────────────────────────────────────────
   Enseña DÓNDE vive una extensión: una ventana esquemática de la web anfitriona
   con el panel de la extensión acoplado. La usan la sección de extensiones de la
   portada y el hero de cada ficha; por eso vive aquí y no en una hoja de página. */
.win {
  border: 1px solid var(--divider);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-elev);
}
.win__bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 36px;
  padding-inline: var(--space-lg);
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-card);
}
.win__dots { display: flex; gap: 5px; }
.win__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.win__url {
  flex: 1 1 auto;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-pill);
  color: var(--text-tertiary);
  font-size: var(--text-2xs);
  font-weight: 600;
  text-align: center;
}
.win__body { display: grid; grid-template-columns: 1fr 176px; gap: var(--space-lg); padding: var(--space-lg); min-height: 236px; }
.win__page { display: flex; flex-direction: column; gap: var(--space-md); }
.win__block { height: 96px; border-radius: var(--radius-notice); }
.win__block--a { background: var(--tile-a); }
.win__block--b { background: var(--tile-b); }
.win__block--c { background: var(--tile-c); }
.win__block--d { background: var(--tile-d); }
.win__block--e { background: var(--tile-e); }
.win__block--f { background: var(--tile-f); }
.win__line { height: 9px; width: var(--w); border-radius: 5px; background: var(--bg-pill); }
.win__dock {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-notice);
}
.win__dockhead { display: flex; align-items: center; gap: var(--space-sm); }
.win__dockhead img { border-radius: 6px; }
.win__dockhead strong { display: block; font-size: var(--text-xs); }
.win__dockhead span { font-size: 10px; color: var(--text-tertiary); }
.win__field { height: 30px; border-radius: var(--radius-sm); background: var(--bg-pill); }
.win__field--tall { flex: 1 1 auto; min-height: 56px; }
.win__go {
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-button);
  background: var(--accent-blue);
  color: var(--text-on-accent);
  font-size: var(--text-2xs);
  font-weight: 600;
}

@media (max-width: 900px) { .win__body { grid-template-columns: 1fr; } }

/* Marca tipográfica para las extensiones que no tienen logo propio (Inspector,
   Recorder): la inicial sobre el acento. La usan portada, hub y fichas. */
.exts__mark {
  display: grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 5px;
  background: var(--grad);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.exts__mark--lg { width: 26px; height: 26px; border-radius: 7px; font-size: 13px; }
