.af-planes { margin: 1.5rem 0; }

.af-planes-done {
  margin: 0 0 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.10);
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 560px){
  .af-planes-done { justify-content: stretch; }
  .af-planes-done .button { width: 100%; text-align: center; }
}

.af-planes-legal-note{
  margin: 18px 0 0;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.08);
  color: #0b2537;
}
.af-planes-legal-note__title{
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 700;
}
.af-planes-legal-note__lead,
.af-planes-legal-note__foot{
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #1f2937;
}
.af-planes-legal-note__lead{ margin-bottom: 8px; }
.af-planes-legal-note__foot{ margin-top: 10px; }
.af-planes-legal-note__list{
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  color: #1f2937;
}
.af-planes-legal-note__list li{ margin: 6px 0; }
.af-planes-legal-note__list strong{ font-weight: 700; }

/* Pestañas (mismo estilo que af-web-registro) */
.af-tabs { display: flex; width: 100%; gap: 0; margin: 0 0 12px; }
.af-tab { appearance: none; -webkit-appearance: none; border: 1px solid #e5e7eb; background: #e5e7eb; color: #111827; padding: 16px 20px; cursor: pointer; border-radius: 0; margin: 0; flex: 1 1 50%; width: 50%; text-align: center; }
.af-tab.is-active { background: var(--ast-global-color-0, #2271b1); color: #fff; }
.af-tab:not(.is-active){ background: #e5e7eb; color: #111827; }
.af-tab:focus { outline: 2px solid rgba(34,113,177,.3); outline-offset: 2px; }

/* Grid de planes */
.plan-grid { display: grid; grid-template-columns: repeat(1, minmax(0,1fr)); gap: 16px; }
@media (min-width: 720px){ .plan-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px){ .plan-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
/* Asesoría: 50% de ancho en pantallas medianas+ (2 columnas) */
@media (min-width: 720px){
  .af-plan-section[data-section="asesoria"] .plan-grid { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}
@media (min-width: 900px){
  .af-plan-section[data-section="asesoria"] .plan-grid { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
}

/* Card de plan - inspirado en Office 365 */
.plan-card { position: relative; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.06); overflow: hidden; display: flex; flex-direction: column; min-height: 520px; }
.plan-card.is-disabled { opacity: .6; filter: grayscale(10%); }
.plan-card__header { padding: 14px 16px; background: #f3f4f6; }
.plan-card__header--dark { background: #0b2537; color: #fff; }
.plan-card__header--dark .plan-card__title { color: #fff; }
.plan-card__title { margin: 0; font-size: 16px; font-weight: 600; }
.plan-card__body { padding: 18px 16px 8px; }
.plan-card__name { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.plan-card__price { font-size: 32px; font-weight: 700; line-height: 1; margin: 8px 0 10px; }
.plan-card__price .old { font-size: 18px; font-weight: 600; color: #9ca3af; text-decoration: line-through; margin-right: 8px; }
.plan-card__price .per { font-size: 14px; font-weight: 500; color: #6b7280; margin-left: 4px; }
.plan-card__price .amount--free { font-size: 28px; font-weight: 800; color: #111827; }
.plan-card__desc { color: #374151; margin: 6px 0; }
.plan-card__note { color: #0b2537; font-weight: 600; margin: 6px 0; }
.plan-card__footer { padding: 14px 16px 16px; margin-top: auto; }
.plan-card .button { display: inline-block; padding: 10px 14px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; color: #111827; text-decoration: none; }
.plan-card .button:hover { background: #f9fafb; }
.plan-card .button.button-primary { background: #0b2537; color: #fff; border-color: #0b2537; }
.plan-card .button.disabled { pointer-events: none; opacity: .6; }
.af-plan-cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.af-plan-cta__form { margin: 0; display: inline-flex; }
.af-plan-cta .button { flex: 1 1 auto; text-align: center; }
@media (max-width: 560px){
  .af-plan-cta { flex-direction: column; gap: 8px; }
  .af-plan-cta__form { width: 100%; }
  .af-plan-cta .button { width: 100%; justify-content: center; }
}
.plan-badge { position: absolute; top: 8px; right: 8px; background: #0b2537; color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.plan-badge--muted { background: #e5e7eb; color: #111827; }
.plan-badge--yearonly{ display:none; right: auto; left: 8px; background: rgba(16, 185, 129, 0.18); border: 1px solid rgba(16, 185, 129, 0.30); color: #065f46; }
.af-plan-section.is-billing-year .plan-badge--yearonly{ display:inline-block; }
/* En cards activas (header oscuro), hacer legible el badge en anual */
.af-plan-section.is-billing-year .plan-card.is-active .plan-badge--yearonly{ color:#fff; }

/* Evitar solape de badges con el título en modo anual */
.af-plan-section.is-billing-year .plan-card__header{ padding-top: 44px; }
.plan-card__features { margin: 12px 0; padding-left: 20px; color: #374151; line-height: 1.6; }
.plan-card__features li { margin-bottom: 6px; }

/* Toggle mensual/anual (estilo "switch") */
.af-billing{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin: 6px 0 14px;
}
.af-billing__label{
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}
.af-billing__save{
  display:inline-block;
  margin-left:6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #065f46;
  font-weight: 800;
  font-size: 12px;
}
.af-switch{ display:inline-flex; align-items:center; }
.af-switch__input{
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
}
.af-switch__track{
  width: 44px;
  height: 24px;
  background:#e5e7eb;
  border:1px solid #d1d5db;
  border-radius:999px;
  position:relative;
  cursor:pointer;
  transition: background .15s ease, border-color .15s ease;
}
.af-switch__track::after{
  content:"";
  position:absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  background:#fff;
  border-radius:999px;
  transform: translateY(-50%);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .15s ease;
}
.af-switch__input:focus + .af-switch__track{
  outline: 2px solid rgba(34,113,177,.3);
  outline-offset: 2px;
}
.af-switch__input:checked + .af-switch__track{
  background:#0b2537;
  border-color:#0b2537;
}
.af-switch__input:checked + .af-switch__track::after{
  transform: translate(20px,-50%);
}

/* Mostrar/ocultar precios según periodo */
.plan-price--year{ display:none; }
.af-plan-section.is-billing-year .plan-price--month{ display:none; }
.af-plan-section.is-billing-year .plan-price--year{ display:inline; }

/* Notas dependientes de periodo */
.plan-card__note--year{ display:none; }
.af-plan-section.is-billing-year .plan-card__note--month{ display:none; }
.af-plan-section.is-billing-year .plan-card__note--year{ display:block; }

/* ── Modal de cambio de plan ── */
body.af-modal-open{ overflow:hidden; }

.af-modal-overlay{
  position:fixed; inset:0; z-index:99999;
  background:rgba(0,0,0,.45);
  display:flex; align-items:center; justify-content:center;
  padding:16px;
}
.af-modal{
  background:#fff; border-radius:14px;
  max-width:520px; width:100%;
  padding:28px 24px 22px;
  box-shadow:0 8px 32px rgba(0,0,0,.18);
  max-height:90vh; overflow-y:auto;
}
.af-modal__title{
  margin:0 0 14px; font-size:18px; font-weight:700; color:#0b2537;
}
.af-modal__body{ font-size:14px; line-height:1.55; color:#334155; }
.af-modal__body p{ margin:0 0 10px; }
.af-modal__body strong{ color:#0b2537; }

.af-modal-coupon-warn{
  margin:12px 0; padding:10px 14px; border-radius:8px;
  border:1px solid rgba(234,88,12,.35);
  background:rgba(234,88,12,.08);
  color:#7c2d12; font-size:13px; line-height:1.5;
}

.af-modal-accept{
  margin:16px 0 0; padding:12px 14px; border-radius:8px;
  background:#f1f5f9; font-size:13px; line-height:1.5;
}
.af-modal-accept label{
  display:flex; align-items:flex-start; gap:8px; cursor:pointer;
}
.af-modal-accept__check{ margin-top:3px; flex-shrink:0; }
.af-modal-accept a{ color:#2563eb; text-decoration:underline; }

.af-modal__actions{
  margin-top:18px; display:flex; gap:10px; justify-content:flex-end;
}
.af-modal__confirm:disabled{
  opacity:.45; cursor:not-allowed;
}

@media(max-width:480px){
  .af-modal{ padding:20px 16px 18px; }
  .af-modal__actions{ flex-direction:column-reverse; }
  .af-modal__actions .button{ width:100%; text-align:center; }
}
