/*
 * Embudo de contratación (`templates/web/checkout/**`) — rediseño F.
 * Maqueta: `F-contratar.dc.html`. Sistema: `../f.css` y
 * `docs/20-modules/web/f-sistema.md`.
 *
 * Prefijo `f-co-*`. Sólo tokens del sistema (claro y oscuro salen solos).
 * Movimiento: sólo transform / opacity; el estado BASE de todo lo animado
 * es el final legible y `prefers-reduced-motion` lo apaga desde `f.css`.
 * El H1 y el párrafo citable no se animan nunca.
 */

/* ------------------------------------------------------------------ Barra de fases */
.f-co-steps { border-bottom: 1px solid var(--f-line); background: var(--f-bg); }
.f-co-steps__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; padding-block: 6px; }
.f-co-steps__item { display: flex; }
.f-co-steps__link {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 12px;
  font-family: var(--f-font-mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px;
  color: var(--f-grey);
}
a.f-co-steps__link:hover { color: var(--f-sig); }
.f-co-steps__dot { width: 6px; height: 6px; flex: none; border: 1px solid var(--f-line2); }
.f-co-steps__item[data-estado='hecho'] .f-co-steps__link { color: var(--f-ink2); }
.f-co-steps__item[data-estado='actual'] .f-co-steps__link { color: var(--f-ink); }
.f-co-steps__item[data-estado='hecho'] .f-co-steps__dot,
.f-co-steps__item[data-estado='actual'] .f-co-steps__dot { background: var(--f-sig); border-color: var(--f-sig); }
/* Móvil: sólo el rótulo de la fase actual; las demás, número y punto. */
@media (max-width: 719px) {
  .f-co-steps__list { justify-content: space-between; }
  .f-co-steps__link { padding: 0 6px; }
  .f-co-steps__item:not([data-estado='actual']) .f-co-steps__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.f-co-bar { height: 2px; background: var(--f-line); overflow: hidden; }
.f-co-bar__fill {
  display: block; height: 100%; background: var(--f-sig);
  transform-origin: left; transform: scaleX(0.2);
  transition: transform 0.5s var(--f-ease);
}
.f-co-bar__fill--2 { transform: scaleX(0.4); }
.f-co-bar__fill--3 { transform: scaleX(0.6); }
.f-co-bar__fill--4 { transform: scaleX(0.8); }
.f-co-bar__fill--5 { transform: scaleX(1); }

/* ------------------------------------------------------------------ Página */
.f-co-page { padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 96px); }
.f-co-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: start; }
@media (min-width: 1024px) {
  .f-co-layout--aside { grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 56px; }
}
.f-co-main { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.f-co-head { display: flex; flex-direction: column; gap: 14px; }
.f-co-h { font-size: clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.f-co-head .f-lead { max-width: 640px; }

/* Entrada del cuerpo: sólo desplazamiento (nunca opacidad), CSS puro y
   termina siempre. El titular y el párrafo citable quedan fuera. */
.f-co-body { display: flex; flex-direction: column; gap: 32px; min-width: 0; animation: f-co-in 0.5s var(--f-ease) both; }
@keyframes f-co-in { from { transform: translateY(10px); } to { transform: none; } }

.f-co-block { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.f-co-legend { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; width: 100%; padding: 0; margin-bottom: 14px; }
.f-co-note, .f-co-hint { font-size: 13.5px; line-height: 1.5; color: var(--f-grey); }
.f-co-hint { display: block; margin-top: 6px; }

.f-co-pie { padding-block: 24px 40px; display: flex; justify-content: center; text-align: center; }
.f-co-pie .f-link { align-self: center; }

/* ------------------------------------------------------------------ Formularios */
.f-co-form { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.f-co-form--narrow { max-width: 560px; }
.f-co-input { width: 100%; flex: none; height: 50px; }
.f-co-check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; font-size: 14.5px; line-height: 1.5; color: var(--f-ink2); cursor: pointer; }
.f-co-check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--f-sig); }
.f-co-check a { color: var(--f-ink); border-bottom: 1px solid var(--f-line2); }
.f-co-check a:hover { border-color: var(--f-sig); }

.f-co-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  border-top: 1px solid var(--f-line); padding-top: 24px;
}
.f-co-actions > .f-btn:only-child, .f-co-actions > button:last-child { margin-inline-start: auto; }
.f-co-actions--start { justify-content: flex-start; border-top: 0; padding-top: 0; }
.f-co-actions--start > .f-btn:only-child, .f-co-actions--start > button:last-child { margin-inline-start: 0; }
@media (max-width: 479px) {
  .f-co-actions .f-btn--l { width: 100%; justify-content: space-between; }
}

/* Avisos */
.f-co-alert {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; border: 1px solid var(--f-line2); border-inline-start: 3px solid var(--f-sig);
  background: var(--f-bg); font-size: 14.5px; line-height: 1.5; color: var(--f-ink2);
}
.f-co-alert--bad { border-inline-start-color: var(--f-bad); }
.f-co-alert--warn { border-inline-start-color: var(--f-warn); }
.f-co-alert--ok { border-inline-start-color: var(--f-ok); }
.f-co-alert__t { color: var(--f-ink); }
.f-co-alert__list { display: flex; flex-direction: column; gap: 4px; padding-inline-start: 18px; list-style: square; }

/* ------------------------------------------------------------------ ¿Qué quieres resolver? */
.f-co-opts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  border-top: 1px solid var(--f-line2); border-inline-start: 1px solid var(--f-line2);
}
.f-co-opt {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  min-height: 200px; padding: 24px;
  border-inline-end: 1px solid var(--f-line2); border-bottom: 1px solid var(--f-line2);
  background: var(--f-bg); transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.f-co-opt:hover { box-shadow: inset 0 0 0 1px var(--f-ink); }
.f-co-opt[aria-current='true'] { background: var(--f-sigsoft); box-shadow: inset 0 0 0 1px var(--f-sig); }
@media (max-width: 639px) { .f-co-opt { min-height: 0; padding: 20px; } }
.f-co-opt__t { font-size: 24px; letter-spacing: -0.04em; line-height: 1.15; }
.f-co-opt__d { font-size: 14.5px; line-height: 1.5; color: var(--f-ink2); }
.f-co-opt__go { margin-top: auto; color: var(--f-sig); transition: transform 0.25s ease; }
.f-co-opt:hover .f-co-opt__go { transform: translateX(4px); }

/* ------------------------------------------------------------------ Periodo (radios reales) */
.f-co-seg { position: relative; display: inline-flex; align-self: flex-start; flex-wrap: wrap; margin: 0; padding: 0; border: 1px solid var(--f-line2); }
.f-co-seg__radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.f-co-seg__opt {
  display: flex; align-items: center; min-height: 44px; padding: 0 16px; cursor: pointer;
  font-family: var(--f-font-mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px;
  color: var(--f-ink2); transition: background-color 0.2s ease, color 0.2s ease;
}
.f-co-seg__radio:checked + .f-co-seg__opt { background: var(--f-inv); color: var(--f-invink); }
.f-co-seg__radio:focus-visible + .f-co-seg__opt { outline: 2px solid var(--f-sig); outline-offset: -2px; }

/* ------------------------------------------------------------------ Módulos con interruptor */
.f-co-mods {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  border-top: 1px solid var(--f-line2); border-inline-start: 1px solid var(--f-line2);
}
.f-co-mod {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; cursor: pointer;
  border-inline-end: 1px solid var(--f-line2); border-bottom: 1px solid var(--f-line2);
  background: var(--f-bg); transition: background-color 0.2s ease;
}
.f-co-mod:hover { background: var(--f-stone); }
.f-co-mod:has(.f-co-mod__check:checked) { background: var(--f-sigsoft); }
.f-co-mod__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 28px; }
.f-co-mod__check { position: absolute; opacity: 0; width: 1px; height: 1px; }
.f-co-mod__name { font-size: 17px; letter-spacing: -0.02em; }
.f-co-mod__d { font-size: 13.5px; line-height: 1.45; color: var(--f-ink2); }
.f-co-mod__req { font-family: var(--f-font-mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; color: var(--f-sig); }
.f-co-mod--premium .f-co-mod__name { font-weight: 500; }

/* Interruptor: pista + mando (sólo `transform` se anima). */
.f-co-switch { position: relative; flex: none; width: 32px; height: 18px; border: 1px solid var(--f-line2); background: var(--f-bg); transition: background-color 0.2s ease, border-color 0.2s ease; }
.f-co-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 10px; height: 10px;
  background: var(--f-line2); transition: transform 0.25s var(--f-ease), background-color 0.2s ease;
}
.f-co-mod__check:checked + .f-co-switch { background: var(--f-sig); border-color: var(--f-sig); }
.f-co-mod__check:checked + .f-co-switch::after { transform: translateX(14px); background: var(--f-on-sig); }
.f-co-mod__check:focus-visible + .f-co-switch { outline: 2px solid var(--f-sig); outline-offset: 2px; }
.f-co-mod.is-locked { cursor: not-allowed; }

/* ------------------------------------------------------------------ Usuarios */
.f-co-users {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px;
  padding: 18px; border: 1px solid var(--f-line2); background: var(--f-bg);
}
.f-co-users__l { display: flex; flex-direction: column; gap: 4px; font-size: 16px; }
.f-co-stepper { display: flex; align-items: center; gap: 8px; }
.f-co-stepper__b {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--f-line2); background: transparent; color: var(--f-ink); font-size: 20px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.f-co-stepper__b:hover { border-color: var(--f-sig); color: var(--f-sig); }
.f-js .f-co-stepper__b { display: flex; }
.f-co-stepper__n {
  width: 84px; height: 44px; padding: 0 8px; text-align: center; font-size: 22px;
  border: 1px solid var(--f-line2); background: var(--f-bg); color: var(--f-ink); border-radius: 0;
  -moz-appearance: textfield; appearance: textfield;
}
.f-co-stepper__n::-webkit-outer-spin-button, .f-co-stepper__n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.f-co-stepper__n:focus { outline: none; border-color: var(--f-sig); }

/* ------------------------------------------------------------------ Resumen «Tu iERP» */
.f-co-aside { min-width: 0; }
@media (min-width: 1024px) {
  .f-co-aside { position: sticky; top: calc(var(--f-nav-h) + 20px); }
}
.f-co-sum { display: flex; flex-direction: column; border: 1px solid var(--f-line2); background: var(--f-stone); }
.f-co-sum__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--f-line2); }
.f-co-sum__head .f-eyebrow { font-size: 10.5px; }
.f-co-sum__rows { display: flex; flex-direction: column; }
.f-co-sum__row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--f-line); font-size: 14.5px; }
.f-co-sum__row[hidden], .f-co-sum [hidden] { display: none; }
.f-co-sum__row--desc .f-co-sum__i { color: var(--f-ok); }
.f-co-sum__c { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.f-co-sum__d { font-size: 12.5px; color: var(--f-grey); }
.f-co-sum__i { white-space: nowrap; }
.f-co-sum__vacio { color: var(--f-grey); }
.f-co-sum__total { display: flex; flex-direction: column; gap: 6px; padding: 22px; }
.f-co-sum__big { display: flex; align-items: baseline; gap: 8px; }
.f-co-sum__n { font-size: clamp(3rem, 2.4rem + 2vw, 4rem); font-weight: 300; letter-spacing: -0.06em; line-height: 0.95; }
.f-co-sum__nota { font-size: 13px; color: var(--f-grey); }
.f-co-sum__aviso { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--f-ink2); }
/* El total «late» un instante al recalcular (clase que pone checkout.js). */
.f-co-sum__n.is-bump { animation: f-co-bump 0.45s var(--f-ease); }
@keyframes f-co-bump { 0% { transform: translateY(-4px); opacity: 0.6; } 100% { transform: none; opacity: 1; } }

/* Barra fija con el total en móvil/tableta (sólo en «Arma tu iERP»). */
.f-co-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--f-gutter); padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--f-bg); border-top: 1px solid var(--f-line2);
}
.f-co-dock__t { display: flex; align-items: baseline; gap: 6px; font-size: 26px; font-weight: 300; letter-spacing: -0.04em; }
.f-co:has(.f-co-dock) .f-foot { padding-bottom: 72px; }
@media (min-width: 1024px) {
  .f-co-dock { display: none; }
  .f-co:has(.f-co-dock) .f-foot { padding-bottom: 0; }
}

/* ------------------------------------------------------------------ Cuenta: qué viene después */
.f-co-next { display: flex; flex-direction: column; border: 1px solid var(--f-line2); background: var(--f-stone); }
.f-co-next .f-eyebrow { padding: 16px 20px; border-bottom: 1px solid var(--f-line2); font-size: 10.5px; }
.f-co-next__list { display: flex; flex-direction: column; }
.f-co-next__item { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--f-line); font-size: 15px; line-height: 1.45; }
.f-co-next__item:last-child { border-bottom: 0; }
.f-co-next__n { color: var(--f-grey); font-size: 11px; padding-top: 3px; }
.f-co-next__bar { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--f-sig); }

/* ------------------------------------------------------------------ Código del espacio */
.f-co-slug { display: flex; min-width: 0; border: 1px solid var(--f-line2); background: var(--f-bg); }
.f-co-slug:focus-within { border-color: var(--f-sig); }
.f-co-slug__prefix { display: flex; align-items: center; padding: 0 12px; background: var(--f-stone); border-inline-end: 1px solid var(--f-line2); color: var(--f-grey); white-space: nowrap; }
.f-co-slug__input { flex: 1; min-width: 0; height: 50px; padding: 0 14px; border: 0; background: transparent; color: var(--f-ink); font-size: 15px; outline: none; }
.f-co-slug__estado { min-height: 20px; margin-top: 6px; font-family: var(--f-font-mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; color: var(--f-grey); }
.f-co-slug__estado[data-estado='libre'] { color: var(--f-ok); }
.f-co-slug__estado[data-estado='ocupado'], .f-co-slug__estado[data-estado='invalido'] { color: var(--f-bad); }

/* ------------------------------------------------------------------ Condiciones y pago simulado */
.f-co-legal { max-height: 240px; overflow: auto; padding: 14px 16px; border: 1px solid var(--f-line2); background: var(--f-bg); font-size: 14px; line-height: 1.55; color: var(--f-ink2); }
.f-co-legal > * + * { margin-top: 8px; }
.f-co-sim { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px dashed var(--f-line2); background: var(--f-stone); }
.f-co-sim__t { display: flex; align-items: center; gap: 8px; font-family: var(--f-font-mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; color: var(--f-ink); }
.f-co-sim__d { font-size: 14px; line-height: 1.5; color: var(--f-ink2); }
.f-co-sim__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 14px; }
.f-co-sim__wide { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ Resumen de confirmación */
.f-co-dl { border-top: 1px solid var(--f-ink); }
.f-co-dl__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--f-line);
}
.f-co-dl__row dt { grid-column: 1 / -1; font-family: var(--f-font-mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; color: var(--f-grey); }
.f-co-dl__row dd { margin: 0; font-size: 15.5px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.f-co-dl__edit { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--f-font-mono); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; color: var(--f-ink2); }
.f-co-dl__edit:hover { color: var(--f-sig); }
@media (min-width: 640px) {
  .f-co-dl__row { grid-template-columns: 160px minmax(0, 1fr) auto; }
  .f-co-dl__row dt { grid-column: auto; }
}

/* ------------------------------------------------------------------ Revisa tu correo */
.f-co-tasks { border: 1px solid var(--f-line2); background: var(--f-bg); max-width: 620px; }
.f-co-tasks__bar { height: 2px; background: var(--f-line); overflow: hidden; }
.f-co-tasks__fill { display: block; height: 100%; background: var(--f-sig); --f-cycle: 6s; }
.f-co-tasks__list { display: flex; flex-direction: column; }
.f-co-task { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--f-line); font-size: 15px; }
.f-co-task:last-child { border-bottom: 0; }
.f-co-task__t { flex: 1; min-width: 0; }
.f-co-task:not(.is-done) .f-co-task__t { color: var(--f-ink2); }
.f-co-task__wait { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; border: 1px solid var(--f-line2); }
.f-co-tick { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; background: var(--f-sig); color: var(--f-on-sig); }
/* Las marcas se vuelven a poner en bucle; base = marcada. */
.f-co-tick { animation: f-co-tick 6s var(--f-ease) var(--f-dl, 0s) infinite; }
@keyframes f-co-tick {
  0%, 4% { opacity: 0; transform: scale(0.6); }
  12%, 100% { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ Conecta tu IA */
.f-co-url { display: flex; flex-wrap: wrap; min-width: 0; border: 1px solid var(--f-line2); }
.f-co-url__v { flex: 1 1 260px; min-width: 0; padding: 14px 16px; font-size: 14px; overflow-wrap: anywhere; background: var(--f-stone); user-select: all; }
.f-co-url__b { border: 0; border-inline-start: 1px solid var(--f-line2); min-height: 48px; }
.f-co-url__b[hidden] { display: none; }
.f-co-first { gap: 10px; padding: 20px; }
.f-co-first__q { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.25rem); letter-spacing: -0.02em; line-height: 1.4; }
@media (max-width: 479px) {
  .f-co-url__b { flex: 1 1 100%; border-inline-start: 0; border-top: 1px solid var(--f-line2); }
}
