/*
Theme Name: EnergyCRM Pro
Theme URI: https://energycrm.pro
Author: ASTRAL ENERGY
Description: Tema de bloques para la web de producto de EnergyCRM. Tipografías autoalojadas, sin dependencias externas y sin constructor.
Version: 1.0.20
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: energycrm-pro
Tags: block-patterns, full-site-editing, one-column, custom-colors, custom-menu
*/

/* -------------------------------------------------------------------------
   Lo que theme.json no puede expresar. Todo lo demás (color, tipografía,
   espaciado) vive en theme.json y se edita desde el editor del sitio.
   ------------------------------------------------------------------------- */

/* Cabecera fija */
.ecrm-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--wp--preset--color--line-soft);
}
.admin-bar .ecrm-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ecrm-header { top: 46px; } }

/* Antetítulo de sección: mono en versalitas con una raya de latón delante.
   Es la referencia de una factura, y es lo que da carácter a la página. */
.ecrm-eyebrow {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wp--preset--color--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}
.ecrm-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  flex: none;
  background: var(--wp--preset--color--volt);
}

/* Dato en monoespaciada: CUPS, tarifas, importes */
.ecrm-code {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.79rem;
  color: var(--wp--preset--color--muted);
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 5px;
  padding: 5px 10px;
  display: inline-block;
}
.ecrm-code strong { color: var(--wp--preset--color--volt); font-weight: 500; }

/* El recuadro de datos (CUPS, tarifas) cuando va suelto en el contenido.
   Es inline-block para ajustarse a su texto, pero un inline-block no se centra
   con los margenes automaticos de WordPress: se quedaba pegado al borde
   izquierdo de la pantalla, fuera de la columna. Como bloque de ancho ajustado
   si obedece. */
.wp-block-post-content > .ecrm-code {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}


/* Marco de captura */
.ecrm-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 8px;
  box-shadow: var(--wp--preset--shadow--card);
}
.ecrm-shot figcaption {
  font-size: 0.82rem;
  color: var(--wp--preset--color--muted);
  margin-top: 10px;
}

/* Etiqueta de estado de un add-on */
.ecrm-tag {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 100px;
  border: 1px solid var(--wp--preset--color--volt);
  color: var(--wp--preset--color--volt);
  background: var(--wp--preset--color--volt-soft);
  display: inline-block;
}
.ecrm-tag.is-ready {
  border-color: var(--wp--preset--color--ok);
  color: var(--wp--preset--color--ok);
  background: transparent;
}

/* Tabla de precios: cabecera pegada, números alineados y scroll propio.
   La tabla es ancha; que se desplace ella y no la página entera. */
.ecrm-pricing { overflow-x: auto; }
.ecrm-pricing table {
  border-collapse: collapse;
  width: 100%;
  min-width: 700px;
  font-variant-numeric: tabular-nums;
}
.ecrm-pricing th,
.ecrm-pricing td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--wp--preset--color--line-soft);
  text-align: center;
}
.ecrm-pricing thead th {
  font-family: var(--wp--preset--font-family--display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wp--preset--color--muted);
  background: var(--wp--preset--color--paper);
}
.ecrm-pricing tbody th {
  text-align: left;
  font-weight: 500;
  color: var(--wp--preset--color--ink);
}
.ecrm-pricing .is-featured { background: var(--wp--preset--color--volt-soft); }
.ecrm-pricing .price {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.45rem;
  font-weight: 700;
  display: block;
}
.ecrm-pricing .price small {
  display: block;
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--wp--preset--color--muted);
}
.ecrm-pricing .yes { color: var(--wp--preset--color--ok); font-weight: 600; }
/* El precio del add-on, en la misma celda que su nombre: quien compara planes
   quiere saber cuanto cuesta «Opcional» sin irse a otra pagina. */
.ecrm-pricing tbody th small {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--wp--preset--color--muted);
}
.ecrm-pricing .no  { color: var(--wp--preset--color--muted); }

/* Cadena de comisiones */
.ecrm-chain {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.88rem;
}
.ecrm-chain .row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--wp--preset--color--line-soft);
}
.ecrm-chain .row:last-of-type { border-bottom: 0; }
.ecrm-chain .lvl  { color: var(--wp--preset--color--volt); width: 14px; }
.ecrm-chain .role { flex: 1; }
.ecrm-chain .pct  { color: var(--wp--preset--color--muted); font-size: 0.78rem; width: 56px; text-align: right; }
.ecrm-chain .amt  { font-variant-numeric: tabular-nums; font-weight: 500; width: 78px; text-align: right; }
.ecrm-chain .tot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--wp--preset--color--line);
  font-weight: 500;
}
.ecrm-chain .tot .amt { color: var(--wp--preset--color--volt); }

/* Preguntas frecuentes con <details> nativo, sin JavaScript */
.ecrm-faq details {
  border-bottom: 1px solid var(--wp--preset--color--line-soft);
  padding: 16px 0;
}
.ecrm-faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
}
.ecrm-faq summary::-webkit-details-marker { display: none; }
.ecrm-faq summary::after {
  content: "+";
  color: var(--wp--preset--color--volt);
  font-family: var(--wp--preset--font-family--mono);
  font-size: 1.2rem;
  line-height: 1;
}
.ecrm-faq details[open] summary::after { content: "\2013"; }
.ecrm-faq details > p { margin-top: 10px; color: var(--wp--preset--color--muted); }

/* Accesibilidad */
:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.skip-link:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--wp--preset--color--surface);
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Tarjeta genérica (estilo de bloque "Tarjeta") */
.ecrm-card {
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 10px;
  padding: 24px;
}

/* Texto sólo para lectores de pantalla */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  position: fixed;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Selector de idioma (Bogo). Banderas pequeñas, sin bullets y alineadas
   con el resto de la cabecera. */
.bogo-language-switcher ul,
ul.bogo-language-switcher {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.bogo-language-switcher li { margin: 0; }
.bogo-language-switcher a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--wp--preset--color--muted);
  padding: 4px 6px;
  border-radius: 4px;
}
.bogo-language-switcher a:hover { color: var(--wp--preset--color--ink); }
.bogo-language-switcher .current a,
.bogo-language-switcher a.current {
  color: var(--wp--preset--color--ink);
  font-weight: 600;
}
.bogo-language-switcher img { display: block; }

/* -------------------------------------------------------------------------
   Banderas del selector de idioma.

   Bogo las pinta con emoji Unicode (símbolos indicadores regionales), y
   Windows no tiene glifos de bandera: ahí salen como dos letras sueltas.
   Como el público de esta web es mayoritariamente Windows, se dibujan en SVG
   incrustado, que se ve igual en todos los sistemas.
   ------------------------------------------------------------------------- */
.bogo-language-switcher .bogoflags::before,
.bogo-language-switcher .bogoflags-before::before { content: "" !important; }

.bogo-language-switcher .bogoflags {
  width: 20px !important;
  height: 14px !important;
  margin: 0 !important;
  border-radius: 2px;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: center !important;
  box-shadow: 0 0 0 1px rgba(17,26,36,.14) inset;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}

.bogo-language-switcher .bogoflags-es {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Crect width='30' height='20' fill='%23AA151B'/%3E%3Crect y='5' width='30' height='10' fill='%23F1BF00'/%3E%3C/svg%3E") !important;
}

.bogo-language-switcher .bogoflags-us,
.bogo-language-switcher .bogoflags-gb {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect width='60' height='30' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 V30 M0,15 H60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E") !important;
}

/* El nombre del idioma se deja para lectores de pantalla: en la cabecera
   ocupa demasiado y la bandera ya identifica el idioma. */
.bogo-language-switcher .bogo-language-name {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.bogo-language-switcher a { padding: 4px; }
.bogo-language-switcher .current a { box-shadow: 0 0 0 2px var(--wp--preset--color--accent); border-radius: 4px; }

/* La tabla de precios no debe partir un importe en dos líneas */

/* El idioma va dentro de la cabecera, detrás del nombre del sitio. Antes vivía
   en una barra propia encima de todo y se veía postizo, despegado del resto.
   La línea vertical lo separa del nombre sin pedir atención. */
.ecrm-header .bogo-language-switcher {
  gap: 4px;
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--wp--preset--color--line-soft);
}
.ecrm-header .bogo-language-switcher a { padding: 3px; opacity: .55; }
.ecrm-header .bogo-language-switcher a:hover { opacity: 1; }
.ecrm-header .bogo-language-switcher .current a { opacity: 1; box-shadow: none; }
.ecrm-header .bogo-language-switcher .current .bogoflags { box-shadow: 0 0 0 1px var(--wp--preset--color--ink) inset; }

/* En pantallas estrechas la línea separadora estorba: las banderas se quedan,
   pero sin adorno. */
@media (max-width: 600px) {
  .ecrm-header .bogo-language-switcher { padding-left: 8px; border-left: 0; }
}

/* «Acceder» para quien ya es cliente. Va al lado del botón de alta, pero en
   texto: el botón que debe destacar es el de empezar, no el de entrar. */
.ecrm-acceder a {
  color: var(--wp--preset--color--muted);
  text-decoration: none;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  white-space: nowrap;
}
.ecrm-acceder a:hover { color: var(--wp--preset--color--ink); text-decoration: underline; }

/* La tabla de precios cabe en pantalla. Si aun así hay que desplazarla en un
   móvil, la primera columna se queda fija: una tabla comparativa en la que se
   pierde de vista qué fila estás leyendo no compara nada. */
.ecrm-pricing table { min-width: 560px; }
.ecrm-pricing .price { white-space: nowrap; font-size: 1.25rem; }
.ecrm-pricing th, .ecrm-pricing td { padding: 11px 12px; }

.ecrm-pricing thead th:first-child,
.ecrm-pricing tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  white-space: normal;
  min-width: 11rem;
  background: var(--wp--preset--color--surface);
}
.ecrm-pricing thead th:first-child { background: var(--wp--preset--color--paper); }
/* Sombra sólo cuando la tabla está desplazada, para que se note el corte */
.ecrm-pricing tbody th::after,
.ecrm-pricing thead th:first-child::after {
  content: "";
  position: absolute;
  top: 0; right: -8px; bottom: -1px;
  width: 8px;
  background: linear-gradient(to right, rgba(17,26,36,.07), transparent);
  pointer-events: none;
}

/* Filas de add-ons: la aclaración va bajo el nombre, más pequeña */
.ecrm-pricing .rowhint {
  display: block;
  font-weight: 400;
  font-size: .76rem;
  color: var(--wp--preset--color--muted);
  margin-top: 3px;
  line-height: 1.35;
}
.ecrm-pricing .opt  { color: var(--wp--preset--color--muted); }
.ecrm-pricing .soon { color: var(--wp--preset--color--volt); font-size: .8rem; }

/* Ajuste de la tabla al ancho disponible.
   El error anterior era poner nowrap en todas las celdas: «Prioritario y
   teléfono» ensanchaba la tabla y se salía la última columna. Sólo el importe
   necesita no partirse. */
.ecrm-pricing tbody td { white-space: normal; }
.ecrm-pricing table { min-width: 0; width: 100%; }
.ecrm-pricing tbody th { min-width: 0; width: 30%; }
.ecrm-pricing thead th:not(:first-child),
.ecrm-pricing tbody td { width: 17.5%; }

@media (max-width: 900px) {
  .ecrm-pricing table { min-width: 620px; }
  .ecrm-pricing th, .ecrm-pricing td { padding: 9px 10px; font-size: .86rem; }
  .ecrm-pricing .price { font-size: 1.05rem; }
  .ecrm-pricing tbody th { min-width: 9.5rem; }
  .ecrm-pricing .rowhint { display: none; }
}

@media (max-width: 600px) {
  .ecrm-pricing table { min-width: 520px; }
  .ecrm-pricing thead th { font-size: .7rem; }
  .ecrm-pricing tbody th { min-width: 8rem; font-size: .8rem; }
}

/* -------------------------------------------------------------------------
   Planes en tarjetas.

   Sustituye a la comparativa de 15x5, que no cabía bien en ninguna pantalla:
   en monitor grande obligaba a desplazar y en móvil era ilegible. Cada plan
   dice a quién va dirigido y qué añade sobre el anterior, que es como se
   elige de verdad. La comparativa completa queda debajo, plegada.
   ------------------------------------------------------------------------- */
.ecrm-plans {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 1000px) { .ecrm-plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .ecrm-plans { grid-template-columns: 1fr; } }

.ecrm-plans .plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 12px;
  padding: 24px 20px 20px;
}
.ecrm-plans .plan.featured {
  border-color: var(--wp--preset--color--volt);
  box-shadow: var(--wp--preset--shadow--card);
}
.ecrm-plans .badge {
  position: absolute;
  top: -10px; left: 20px;
  font-family: var(--wp--preset--font-family--mono);
  font-size: .66rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--wp--preset--color--volt);
  padding: 3px 9px;
  border-radius: 100px;
}
.ecrm-plans h3 {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.ecrm-plans .who {
  font-size: .82rem;
  color: var(--wp--preset--color--muted);
  margin: 4px 0 0;
  min-height: 2.6em;
}
.ecrm-plans .amount {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -.03em;
  margin: 14px 0 0;
  white-space: nowrap;
}
.ecrm-plans .amount span {
  font-size: .9rem;
  font-weight: 500;
  color: var(--wp--preset--color--muted);
}
.ecrm-plans .amount-note {
  font-size: .74rem;
  color: var(--wp--preset--color--muted);
  margin: 2px 0 0;
}
.ecrm-plans .plus {
  font-size: .78rem;
  color: var(--wp--preset--color--muted);
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--wp--preset--color--line-soft);
}
.ecrm-plans ul {
  list-style: none;
  margin: 12px 0 20px;
  padding: 0;
  display: grid;
  gap: 8px;
  flex: 1;
}
.ecrm-plans li {
  position: relative;
  padding-left: 20px;
  font-size: .86rem;
  line-height: 1.45;
}
.ecrm-plans li::before {
  content: "";
  position: absolute;
  left: 2px; top: .45em;
  width: 9px; height: 5px;
  border-left: 2px solid var(--wp--preset--color--ok);
  border-bottom: 2px solid var(--wp--preset--color--ok);
  transform: rotate(-45deg);
}
.ecrm-plans .plan-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: .88rem;
  padding: 11px 14px;
  border-radius: 6px;
  margin-top: auto;
}
.ecrm-plans .plan-cta.solid {
  background: var(--wp--preset--color--accent);
  color: #fff;
}
.ecrm-plans .plan-cta.solid:hover { background: var(--wp--preset--color--accent-ink); }
.ecrm-plans .plan-cta.ghost {
  border: 1px solid var(--wp--preset--color--line);
  color: var(--wp--preset--color--ink);
}
.ecrm-plans .plan-cta.ghost:hover { border-color: var(--wp--preset--color--muted); }

/* Comparativa completa, plegada */
.ecrm-compare { margin-top: var(--wp--preset--spacing--40); }
.ecrm-compare summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: .9rem;
  color: var(--wp--preset--color--accent);
  padding: 12px 0;
}
.ecrm-compare summary::-webkit-details-marker { display: none; }
.ecrm-compare summary::before { content: "+ "; font-family: var(--wp--preset--font-family--mono); }
.ecrm-compare[open] summary::before { content: "\2013 "; }
.ecrm-compare .ecrm-pricing { margin-top: 10px; }

/* Logo y nombre juntos en la cabecera */
.ecrm-header .wp-block-site-logo { line-height: 0; }
.ecrm-header .wp-block-site-logo img { border-radius: 6px; }

/* -------------------------------------------------------------------------
   Pestañas sin JavaScript, con radios ocultos. El orden del marcado importa:
   primero los inputs, luego las etiquetas, luego los paneles.
   ------------------------------------------------------------------------- */
.ecrm-tabs { margin-top: var(--wp--preset--spacing--30); }
.ecrm-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.ecrm-tabs .tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--wp--preset--color--line);
  padding-bottom: 10px;
  margin-bottom: 18px;
}
.ecrm-tabs .tabs-nav label {
  cursor: pointer;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: .82rem;
  padding: 7px 13px;
  border-radius: 100px;
  color: var(--wp--preset--color--muted);
  border: 1px solid transparent;
  white-space: nowrap;
}
.ecrm-tabs .tabs-nav label:hover { color: var(--wp--preset--color--ink); }
.ecrm-tabs .panel { display: none; }
.ecrm-tabs .panel figcaption,
.ecrm-tabs .panel > p {
  font-size: .88rem;
  color: var(--wp--preset--color--muted);
  margin-top: 12px;
  max-width: 68ch;
}
.ecrm-tabs .panel img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 8px;
  box-shadow: var(--wp--preset--shadow--card);
}
#t1:checked ~ .tabs-nav label[for="t1"],
#t2:checked ~ .tabs-nav label[for="t2"],
#t3:checked ~ .tabs-nav label[for="t3"],
#t4:checked ~ .tabs-nav label[for="t4"],
#t5:checked ~ .tabs-nav label[for="t5"] {
  color: #fff;
  background: var(--wp--preset--color--ink);
}
#t1:checked ~ .panels .p1,
#t2:checked ~ .panels .p2,
#t3:checked ~ .panels .p3,
#t4:checked ~ .panels .p4,
#t5:checked ~ .panels .p5 { display: block; }
.ecrm-tabs > input:focus-visible + .tabs-nav label { outline: 2px solid var(--wp--preset--color--accent); }
@media (max-width: 600px) {
  .ecrm-tabs .tabs-nav { overflow-x: auto; flex-wrap: nowrap; }
}

/* ---------------------------------------------------------------- ciclo de pago
   Mensual o anual, sin JavaScript: dos radios y selectores de hermano. Si el
   CSS no llega a pintarse se ven los dos precios: feo, pero nunca enganoso. */

.ecrm-ciclo > input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.ecrm-ciclo > label {
  display: inline-block; cursor: pointer; user-select: none;
  padding: 8px 18px; margin-bottom: 22px; font-size: .9rem; font-weight: 600;
  color: var(--wp--preset--color--muted);
  border: 1px solid var(--wp--preset--color--line, rgba(0,0,0,.12));
}
.ecrm-ciclo > label[for="ecrm-ciclo-ano"] { border-radius: 999px 0 0 999px; border-right: 0; }
.ecrm-ciclo > label[for="ecrm-ciclo-mes"] { border-radius: 0 999px 999px 0; }
.ecrm-ciclo > label b { font-weight: 700; color: var(--wp--preset--color--accent); }

.ecrm-ciclo > #ecrm-ciclo-ano:checked ~ label[for="ecrm-ciclo-ano"],
.ecrm-ciclo > #ecrm-ciclo-mes:checked ~ label[for="ecrm-ciclo-mes"] {
  background: var(--wp--preset--color--ink); color: #fff; border-color: var(--wp--preset--color--ink);
}
.ecrm-ciclo > #ecrm-ciclo-ano:checked ~ label[for="ecrm-ciclo-ano"] b { color: var(--wp--preset--color--paper, #fff); }

.ecrm-ciclo > input:focus-visible + label { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* Lo que ensena cada postura. */
.ecrm-ciclo > #ecrm-ciclo-ano:checked ~ .ecrm-plans .es-mes { display: none; }
.ecrm-ciclo > #ecrm-ciclo-mes:checked ~ .ecrm-plans .es-ano { display: none; }

@media (max-width: 600px) {
  .ecrm-ciclo > label { padding: 8px 12px; font-size: .82rem; }
}

/* ---------------------------------------------------------------- el alta
   Formulario de contratación. Pensado primero para el móvil: es donde va a
   llegar la mitad de la gente desde un QR o un enlace de WhatsApp, y donde un
   campo pequeño se convierte en un abandono. */

.ecrm-alta {
  max-width: 30rem;
  margin: 0;
}

.ecrm-alta > p,
.ecrm-alta > fieldset {
  margin: 0 0 22px;
}

.ecrm-alta label {
  display: block;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: .95rem;
  color: var(--wp--preset--color--ink);
  margin-bottom: 6px;
}

.ecrm-alta input[type="text"],
.ecrm-alta input[type="email"],
.ecrm-alta select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  /* 16px justos: por debajo de eso, Safari en iPhone hace zoom al enfocar y
     el formulario se sale de la pantalla. */
  font-size: 16px;
  font-family: inherit;
  color: var(--wp--preset--color--ink);
  background: var(--wp--preset--color--paper);
  padding: 12px 14px;
  min-height: 48px;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 8px;
  appearance: none;
}

.ecrm-alta input:focus,
.ecrm-alta select:focus {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 1px;
  border-color: var(--wp--preset--color--accent);
}

.ecrm-alta input::placeholder { color: var(--wp--preset--color--muted); opacity: .65; }

.ecrm-alta small {
  display: block;
  margin-top: 6px;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--wp--preset--color--muted);
}

/* La dirección: el campo y el dominio, en la misma línea y sin desbordar. */
.ecrm-alta__dominio {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ecrm-alta__dominio input { flex: 1 1 auto; min-width: 0; }
.ecrm-alta__dominio code {
  flex: 0 0 auto;
  font-size: .9rem;
  color: var(--wp--preset--color--muted);
  white-space: nowrap;
}

/* Las dos formas de pago, como tarjetas que se pueden tocar con el pulgar. */
.ecrm-alta fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}
.ecrm-alta legend {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: .95rem;
  color: var(--wp--preset--color--ink);
  padding: 0;
  margin-bottom: 8px;
}
.ecrm-alta fieldset label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  font-family: inherit;
  padding: 13px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 8px;
  cursor: pointer;
}
.ecrm-alta fieldset label:has(input:checked) {
  border-color: var(--wp--preset--color--accent);
  background: var(--wp--preset--color--surface);
}
.ecrm-alta fieldset input[type="radio"] { margin: 2px 0 0; flex: 0 0 auto; }
.ecrm-alta fieldset strong { color: var(--wp--preset--color--accent); }

.ecrm-alta button {
  display: block;
  width: 100%;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: var(--wp--preset--color--accent);
  border: 0;
  border-radius: 8px;
  padding: 15px 18px;
  min-height: 52px;
  cursor: pointer;
}
.ecrm-alta button:hover { background: var(--wp--preset--color--accent-ink); }
.ecrm-alta button:focus-visible { outline: 2px solid var(--wp--preset--color--ink); outline-offset: 2px; }

.ecrm-alta > small {
  margin-top: 12px;
  text-align: center;
}

.ecrm-alta__error {
  padding: 12px 14px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid #e2a0a0;
  background: #fdf2f2;
  color: #8a2020;
}

@media (min-width: 600px) {
  .ecrm-alta button { width: auto; min-width: 15rem; }
}
