/* ════════════════════════════════════════════════════════════
   PLANES — fuente única de verdad
   Usado por:
     - /index.html  (sección de planes en el landing público)
     - /planes.html (pantalla post-login / suscripción / trial vencido)
   ════════════════════════════════════════════════════════════ */

/* ── Sección ── */
.planes-section {
  padding: 32px 24px 80px;
  text-align: center;
}
.planes-titulo {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #0f3d3e;
}
.planes-subtitulo {
  font-size: 15px;
  color: #555;
  margin-bottom: 28px;
}

/* ── Toggle Mensual / Anual ── */
.toggle-periodo {
  display: inline-flex;
  background: #e4e7f1;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 36px;
}
.toggle-periodo button {
  border: none;
  background: transparent;
  padding: 9px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: #555;
  transition: all 0.2s;
  font-family: inherit;
}
.toggle-periodo button.activo {
  background: #0f3d3e;
  color: white;
  box-shadow: 0 4px 12px rgba(26, 26, 46, 0.25);
}
.descuento-badge {
  display: inline-block;
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

/* ── Grid y tarjetas ── */
.planes-grid {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
}
.plan-card {
  background: white;
  border-radius: 16px;
  padding: 32px 28px;
  width: 320px;
  border: 2px solid #e8eaf0;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.10);
}
.plan-card.popular {
  border-color: #0f3d3e;
  box-shadow: 0 14px 40px rgba(15, 61, 62, 0.18);
}
.plan-card.actual {
  border-color: #2e7d32;
  background: linear-gradient(180deg, #f1f9f3 0%, #ffffff 60%);
}
.badge-popular {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #0f3d3e, #145c5e);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(15, 61, 62, 0.35);
}
.badge-actual {
  position: absolute;
  top: -14px;
  right: 16px;
  background: #2e7d32;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.plan-nombre {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #0f3d3e;
}
.plan-descripcion {
  font-size: 13px;
  color: #777;
  margin-bottom: 22px;
  min-height: 36px;
}
.plan-precio { margin-bottom: 8px; }
.plan-precio .valor {
  font-size: 38px;
  font-weight: 800;
  color: #0f3d3e;
}
.plan-precio .periodo-label {
  font-size: 14px;
  color: #888;
  margin-left: 4px;
}
.plan-precio .iva-nota {
  font-size: 11px;
  color: #aaa;
  display: block;
  margin-top: 2px;
}
.plan-ahorro {
  font-size: 12px;
  color: #2e7d32;
  font-weight: 600;
  margin-bottom: 20px;
  min-height: 18px;
}
.plan-features {
  list-style: none;
  margin-bottom: 26px;
  flex-grow: 1;
  padding: 0;
}
.plan-features li {
  font-size: 13px;
  color: #444;
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.plan-features li::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background-color: #0f3d3e;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 8l3 3 5-5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* ── Feature con sub-items (título + sub-lista indentada) ── */
.plan-features li.feat-grupo {
  flex-wrap: wrap;
  font-weight: 600;
  color: #2b2b2b;
}
/* Módulos que destacan al plan (CRM, Finanzas): mismo check/viñetas,
   solo se resaltan con color de marca y un fondo suave. */
.plan-features li.feat-destacado,
.plan-features li.feat-destacado-simple {
  color: #0f3d3e;
  font-weight: 700;
  background: rgba(200, 155, 60, 0.10);
  border-left: 3px solid #c89b3c;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 4px;
}
.plan-features .plan-features-sub {
  list-style: none;
  flex-basis: 100%;          /* fuerza la sub-lista a su propia línea */
  margin: 4px 0 2px 24px;    /* indentación bajo el título (tras el check) */
  padding: 0;
}
.plan-features .plan-features-sub li {
  font-size: 12px;           /* más pequeña que la feature principal (13px) */
  color: #6b7280;            /* atenuada: visualmente subordinada */
  font-weight: 400;
  padding: 3px 0;
  gap: 7px;
  align-items: center;
}
.plan-features .plan-features-sub li::before {
  /* viñeta pequeña distinta (punto), no el checkmark de la feature padre */
  width: 5px;
  height: 5px;
  min-width: 5px;
  margin-top: 0;
  background-color: #9aa6a0;
  background-image: none;
}

/* ── Botón "Empezar con X" (modo público, sin login) ── */
.btn-plan {
  display: block;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0f3d3e, #145c5e);
  border: 2px solid transparent;
  color: white;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.18s;
  font-family: inherit;
  box-shadow: 0 8px 18px rgba(15, 61, 62, 0.28);
}
.btn-plan:hover {
  background: linear-gradient(135deg, #7376f2, #5b54e8);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(115, 118, 242, 0.38);
}
.btn-plan[disabled] {
  background: #94a3b8;
  cursor: default;
  box-shadow: none;
  transform: none;
}

/* Botón "ghost" para tarjetas no destacadas en el landing público */
.plan-card:not(.popular):not(.actual) .btn-plan {
  background: transparent;
  color: #0f3d3e;
  border-color: #d8dbe6;
  box-shadow: none;
}
.plan-card:not(.popular):not(.actual) .btn-plan:hover {
  background: #f5f5fb;
  border-color: #0f3d3e;
  color: #0f3d3e;
}

/* Botón especial del Plan Básico (único con trial gratis) */
.btn-plan.btn-plan-basico,
.plan-card:not(.popular):not(.actual) .btn-plan.btn-plan-basico {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.32);
}
.btn-plan.btn-plan-basico:hover,
.plan-card:not(.popular):not(.actual) .btn-plan.btn-plan-basico:hover {
  background: linear-gradient(135deg, #1e40af, #1d4ed8);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.42);
}

.btn-plan-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* ── Bloque de métodos de pago (modo logueado) ── */
.plan-pagos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.plan-pagos .pp-paypal-slot { min-height: 50px; }

.plan-desglose-cambio {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12px;
  color: #0c4a6e;
  line-height: 1.55;
  margin-bottom: 10px;
}
.plan-desglose-cambio strong {
  color: #075985;
  font-size: 13px;
}
.plan-cta-label {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}
.plan-card.actual .plan-cta-label { color: #0f3d3e; }
.btn-metodo {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}
.btn-metodo:hover { transform: translateY(-1px); }

.btn-transferencia {
  background: #fff;
  color: #0f3d3e;
  border-color: #0f3d3e;
}
.btn-transferencia:hover {
  background: #e8f1ec;
}

/* ── Estado / mensaje ── */
.plan-msg {
  font-size: 12.5px;
  text-align: center;
  margin-top: 6px;
  min-height: 16px;
}
.plan-msg.ok   { color: #15803d; }
.plan-msg.err  { color: #b91c1c; }
.plan-msg.warn { color: #92400e; }

/* ── Banner trial vencido / aviso ── */
.planes-aviso {
  max-width: 760px;
  margin: 0 auto 24px;
  padding: 16px 22px;
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
  display: none;
}
.planes-aviso.warn {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  display: block;
}
.planes-aviso.info {
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  color: #075985;
  display: block;
}
.planes-aviso strong { display: block; margin-bottom: 4px; }

/* ════════════════════════════════════════════════════════════
   MODAL TRANSFERENCIA
   ════════════════════════════════════════════════════════════ */
.tr-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 36px 16px;
}
.tr-overlay.open { display: flex; }

.tr-modal {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  flex-shrink: 0;
}
.tr-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 14px; margin-bottom: 16px;
}
.tr-head h3 {
  font-size: 20px; font-weight: 800; color: #0f3d3e; margin: 0 0 4px;
}
.tr-head p { font-size: 13px; color: #64748b; margin: 0; }
.tr-close {
  background: #f1f5f9; border: none; width: 34px; height: 34px;
  border-radius: 50%; font-size: 18px; cursor: pointer; color: #475569;
}
.tr-close:hover { background: #e2e8f0; }

.tr-desglose {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.tr-dline {
  display: flex; justify-content: space-between;
  padding: 3px 0; font-size: 13px; color: #475569;
}
.tr-dline strong { color: #0f172a; font-weight: 700; }
.tr-dline.final {
  border-top: 1px solid #e2e8f0;
  margin-top: 6px; padding-top: 8px;
  font-size: 15px;
}
.tr-dline.final strong { color: #0f3d3e; font-size: 18px; font-weight: 800; }

.tr-banco {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px;
}
.tr-banco h4 {
  grid-column: 1 / -1; margin: 0 0 4px; font-size: 14px;
  font-weight: 700; color: #0f3d3e;
}
.tr-banco .lbl {
  font-size: 10px; color: #64748b; text-transform: uppercase;
  font-weight: 700; letter-spacing: .04em;
}
.tr-banco .val { font-size: 13px; font-weight: 600; color: #0f172a; word-break: break-all; }

.tr-correo {
  background: #ecfdf5; border: 1px solid #bbf7d0;
  border-radius: 10px; padding: 10px 14px; margin: 6px 0 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.tr-correo .lbl {
  font-size: 10px; color: #15803d; text-transform: uppercase;
  font-weight: 700; letter-spacing: .04em;
}
.tr-correo a {
  font-size: 14px; font-weight: 700; color: #15803d;
  text-decoration: none; word-break: break-all;
}
.tr-correo a:hover { text-decoration: underline; }

.tr-form-row { margin-bottom: 12px; }
.tr-form-row label {
  display: block; font-size: 11px; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.tr-form-row input[type="text"],
.tr-form-row input[type="number"],
.tr-form-row input[type="file"] {
  width: 100%; padding: 10px 12px; border: 1.5px solid #d1d5db;
  border-radius: 9px; font-size: 13px; outline: none;
  font-family: inherit; background: #fff; color: #0f172a;
  transition: border-color 0.15s;
}
.tr-form-row input:focus { border-color: #0f3d3e; }
.tr-form-row input[readonly] { background: #f1f5f9; color: #475569; }
.tr-readonly-note { font-size: 11px; color: #64748b; margin-top: 4px; }

.tr-submit {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, #0f3d3e, #145c5e);
  color: white; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: opacity 0.15s;
}
.tr-submit:hover { opacity: 0.9; }
.tr-submit[disabled] { opacity: 0.55; cursor: not-allowed; }

.tr-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.tr-msg.ok   { color: #15803d; }
.tr-msg.err  { color: #b91c1c; }
.tr-msg.warn { color: #92400e; }

/* Spinner pequeño para PayPal en carga */
.pp-spinner-mini {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #d4e8df; border-top-color: #0f3d3e;
  border-radius: 50%;
  animation: pp-spin 0.8s linear infinite;
}
@keyframes pp-spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .planes-grid { gap: 16px; }
  .plan-card { width: 100%; max-width: 360px; }
  .tr-modal { padding: 18px 18px; }
  .tr-banco { grid-template-columns: 1fr; }
}
