/* Modales, formularios y cards de planes (extraído del landing). */
.btn-tab-emerald {
  border-color: #047857;
  background: linear-gradient(135deg, #d1fae5 0%, #ffffff 45%, #ecfdf5 100%);
  box-shadow:
    0 8px 30px -8px rgba(5, 150, 105, 0.42),
    0 4px 12px -4px rgba(15, 23, 42, 0.12),
    0 0 0 3px rgb(5 150 105 / 0.32);
}
.btn-tab-emerald:hover {
  border-color: #065f46;
  box-shadow:
    0 14px 40px -10px rgba(5, 150, 105, 0.52),
    0 6px 16px -6px rgba(15, 23, 42, 0.14),
    0 0 0 3px rgb(5 150 105 / 0.38);
}
#modal-formulario-contacto:not(.modal-formulario-contacto--abierto) {
  display: none;
}
#modal-formulario-contacto.modal-formulario-contacto--abierto {
  display: flex;
}
#modal-solicitud-plan:not(.modal-solicitud-plan--abierto) {
  display: none;
}
#modal-solicitud-plan.modal-solicitud-plan--abierto {
  display: flex;
}
.bernorix-field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
}
.bernorix-input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #0f172a;
  box-shadow: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
@media (max-width: 639px) {
  .bernorix-input,
  select.bernorix-input,
  textarea.bernorix-input {
    font-size: 1rem;
    line-height: 1.35;
  }
  #modal-solicitud-plan .solicitud-plan-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.625rem;
  }
  #modal-solicitud-plan .solicitud-plan-field-full {
    grid-column: 1 / -1;
  }
  #modal-solicitud-plan .bernorix-field-label {
    font-size: 0.75rem;
    line-height: 1.2;
  }
  #modal-solicitud-plan .bernorix-input {
    margin-top: 0.125rem;
    padding: 0.4rem 0.6rem;
  }
  #modal-solicitud-plan #solicitud-comentarios {
    min-height: 2.25rem;
  }
  #modal-solicitud-plan #btn-enviar-solicitud-plan {
    margin-top: 0.25rem;
    min-height: 2.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}
.solicitud-plan-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1rem;
}
.bernorix-form-spacer {
  display: none;
}
@media (min-width: 640px) {
  .solicitud-plan-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .solicitud-plan-field-full {
    grid-column: 1 / -1;
  }
  .bernorix-form-spacer {
    display: block;
  }
  /* Enterprise agrega campos extra: se ensancha a 3 columnas para caber sin scroll. */
  #modal-solicitud-plan.modal-solicitud-plan--enterprise .solicitud-plan-panel {
    max-width: 60rem;
    max-height: 92dvh;
  }
  #modal-solicitud-plan.modal-solicitud-plan--enterprise .solicitud-plan-form-grid,
  #modal-solicitud-plan.modal-solicitud-plan--enterprise #solicitud-plan-enterprise-campos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #modal-solicitud-plan.modal-solicitud-plan--enterprise .bernorix-form-spacer {
    display: none;
  }
}
.bernorix-input:focus {
  outline: none;
  border-color: #0069c9;
  box-shadow: 0 0 0 3px rgb(0 105 201 / 0.18);
}
/* Listbox compacto al abrir (desktop): scroll en lugar de desplegar las 32 opciones. */
.bernorix-select-scroll-wrap {
  position: relative;
}
select.bernorix-select-scroll.bernorix-select-scroll--abierto {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 40;
  height: auto;
  max-height: 13.5rem;
  overflow-y: auto;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  box-shadow:
    0 12px 28px -8px rgb(15 23 42 / 0.28),
    0 4px 10px -4px rgb(15 23 42 / 0.12);
}
html.dark select.bernorix-select-scroll.bernorix-select-scroll--abierto {
  box-shadow:
    0 12px 28px -8px rgb(0 0 0 / 0.55),
    0 4px 10px -4px rgb(0 0 0 / 0.35);
}
.bernorix-input--error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgb(239 68 68 / 0.12);
}
.bernorix-field-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #dc2626;
}
html.dark .bernorix-field-label {
  color: #e2e8f0;
}
html.dark .bernorix-input {
  border-color: #475569;
  background: #0f172a;
  color: #f8fafc;
}
html.dark .bernorix-input:focus {
  border-color: #36a3f5;
  box-shadow: 0 0 0 3px rgb(54 163 245 / 0.2);
}
html.dark .bernorix-input--error {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgb(248 113 113 / 0.15);
}
html.dark .bernorix-field-error {
  color: #fca5a5;
}
.solicitud-plan-color--esencial {
  color: #475569;
}
html.dark .solicitud-plan-color--esencial {
  color: #94a3b8;
}
.solicitud-plan-color--profesional {
  color: #0069c9;
}
html.dark .solicitud-plan-color--profesional {
  color: #36a3f5;
}
.solicitud-plan-color--avanzado {
  color: #059669;
}
html.dark .solicitud-plan-color--avanzado {
  color: #34d399;
}
.solicitud-plan-color--enterprise {
  color: #c9a227;
}
html.dark #solicitud-plan-alerta-exito {
  border-color: #065f46;
  background: rgb(6 78 59 / 0.35);
  color: #d1fae5;
}
html.dark #formulario-contacto-alerta-exito {
  border-color: #065f46;
  background: rgb(6 78 59 / 0.35);
  color: #d1fae5;
}
html.dark #solicitud-plan-alerta-error,
html.dark #formulario-contacto-alerta-error {
  border-color: #991b1b;
  background: rgb(127 29 29 / 0.35);
  color: #fecaca;
}
.cmms-plan-check {
  flex-shrink: 0;
  margin-top: 0.125rem;
}
#cmms-planes .cmms-plan-check {
  color: #059669;
}
html.dark #cmms-planes .cmms-plan-check {
  color: #34d399;
}
#cmms-planes .cmms-plan-funciones-label {
  margin: 1.15rem 0 0.75rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
html.dark #cmms-planes .cmms-plan-funciones-label {
  color: #94a3b8;
}
#cmms-planes .cmms-plan-modulos-btn {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: #047857;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
  touch-action: manipulation;
}
#cmms-planes .cmms-plan-modulos-btn:hover {
  color: #065f46;
}
#cmms-planes .cmms-plan-modulos-btn:focus {
  outline: none;
}
#cmms-planes .cmms-plan-modulos-btn:focus-visible {
  border-radius: 0.25rem;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #10b981;
}
html.dark #cmms-planes .cmms-plan-modulos-btn {
  color: #34d399;
}
html.dark #cmms-planes .cmms-plan-modulos-btn:hover {
  color: #6ee7b7;
}

#modal-modulos-incluidos:not(.modal-modulos-incluidos--abierto) {
  display: none;
}
#modal-modulos-incluidos.modal-modulos-incluidos--abierto {
  display: flex;
}
#modal-modulos-incluidos > .modal-modulos-incluidos-panel {
  width: 100%;
  max-width: 36rem;
}
.modulos-acordeon {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.modulos-acordeon-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden;
}
.modulos-acordeon-item--open {
  border-color: #a7f3d0;
  background: #f0fdf4;
}
.modulos-acordeon-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.75rem 0.9rem;
  border: 0;
  background: transparent;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.modulos-acordeon-trigger:focus {
  outline: none;
}
.modulos-acordeon-trigger:focus-visible {
  box-shadow: inset 0 0 0 2px #10b981;
}
.modulos-acordeon-chevron {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.15s ease;
}
.modulos-acordeon-item--open .modulos-acordeon-chevron {
  transform: rotate(180deg);
  color: #059669;
}
.modulos-acordeon-panel {
  padding: 0 0.9rem 0.9rem;
}
.modulos-acordeon-panel p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #475569;
}
.modulos-acordeon-link {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #047857;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.modulos-acordeon-link:hover {
  color: #065f46;
}
html.dark #modal-modulos-incluidos .modal-modulos-incluidos-panel {
  border-color: #334155;
  background: #0f172a;
}
html.dark #modal-modulos-incluidos h2 {
  color: #f8fafc;
}
html.dark #modal-modulos-incluidos .modal-modulos-incluidos-panel > p {
  color: #94a3b8;
}
html.dark .modulos-acordeon-item {
  border-color: #334155;
  background: #1e293b;
}
html.dark .modulos-acordeon-item--open {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(6, 78, 59, 0.35);
}
html.dark .modulos-acordeon-trigger {
  color: #f1f5f9;
}
html.dark .modulos-acordeon-panel p {
  color: #cbd5e1;
}
html.dark .modulos-acordeon-link {
  color: #34d399;
}
html.dark .modulos-acordeon-link:hover {
  color: #6ee7b7;
}

/* Planes: tarjeta Pro destacada sin desalinear el grid */
.plan-pro-badge {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
}
@media (max-width: 1023px) {
  .cmms-planes-grid > article {
    position: relative;
    box-shadow:
      0 4px 6px -1px rgb(15 23 42 / 0.06),
      0 12px 32px -10px rgb(15 23 42 / 0.14);
  }
  .cmms-plan-pro {
    z-index: 2;
    box-shadow:
      0 10px 15px -3px rgb(15 23 42 / 0.08),
      0 0 0 2px rgb(5 150 105 / 0.38),
      0 22px 50px -14px rgb(5 150 105 / 0.2);
  }
}
@media (min-width: 1024px) {
  .cmms-planes-grid {
    align-items: stretch;
  }
  .cmms-plan-pro {
    position: relative;
    z-index: 2;
    box-shadow:
      0 10px 15px -3px rgb(15 23 42 / 0.08),
      0 0 0 2px rgb(5 150 105 / 0.38),
      0 22px 50px -14px rgb(5 150 105 / 0.2);
  }
}

.text-enterprise {
  color: #c9a227;
}

/* Honeypot anti-spam: oculto para humanos, visible para bots básicos */
.bernorix-hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html.dark .btn-tab-emerald {
  background: linear-gradient(to bottom right, rgb(6 78 59 / 0.4), rgb(15 23 42), rgb(30 41 59));
  border-color: rgb(5 150 105);
  box-shadow:
    0 8px 30px -8px rgba(5, 150, 105, 0.32),
    0 4px 12px -4px rgba(0, 0, 0, 0.35);
}
html.dark .btn-tab-emerald:hover {
  border-color: rgb(16 185 129);
}
