/* ct-formulario — brief de 3 pasos (/contacto/#formulario). Fondo blanco; formulario en tarjeta crema,
   resumen en vivo en tarjeta noche (fija a la derecha en escritorio, barra plegable arriba en celular).
   Seleccionado = tinta con texto blanco (también en hover); foco = anillo naranja. */

.ctf { --ctf-borde: #ECE5DD; --ctf-gris: #5F595B; --ctf-crema: #FBF8F4; --ctf-naranja-txt: #C8410F; position: relative; background: #fff; color: var(--ink); }
.ctf [hidden] { display: none !important; }
.ctf__in { max-width: 1240px; margin: 0 auto; padding: clamp(56px, 7vw, 112px) var(--m); }

/* ── Cabecera ── */
.ctf__cab { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; gap: 12px 48px; margin-bottom: clamp(28px, 3.4vw, 48px); }
.ctf__cab > :not(:last-child) { grid-column: 1; }
.ctf__cab > p:last-child { grid-column: 2; grid-row: 1 / span 2; color: var(--ctf-gris); font-size: clamp(16px, 1.3vw, 18px); line-height: 1.55; }
.ctf__ceja { justify-self: start; display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 10px; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px var(--ctf-borde), 0 6px 16px -10px rgba(18, 16, 17, .25); font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.ctf__ceja::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--lima); box-shadow: 0 0 0 3px rgba(210, 251, 140, .45); }
.ctf h2 { font-size: clamp(32px, 4.2vw, 60px); }

/* ── Distribución ── */
.ctf__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.ctf__form { min-width: 0; scroll-margin-top: 130px; padding: clamp(20px, 3vw, 44px); border-radius: clamp(22px, 2.4vw, 32px); background: var(--ctf-crema); box-shadow: inset 0 0 0 1px #F0EAE3; }

/* ── Progreso ── */
.ctf__prog { margin-bottom: clamp(22px, 2.6vw, 32px); }
.ctf__prog ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ctf__prog li { display: flex; align-items: center; gap: 10px; color: var(--ctf-gris); font-size: 14px; font-weight: 500; transition: color .3s; }
.ctf__prog li span { display: grid; flex: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px var(--ctf-borde); font-size: 13px; font-weight: 700; transition: background-color .3s, color .3s, box-shadow .3s; }
.ctf__prog li[aria-current] { color: var(--ink); font-weight: 600; }
.ctf__prog li[aria-current] span { background: var(--accent); color: #fff; box-shadow: none; }
.ctf__prog li.is-hecho span { background: var(--noche); color: var(--lima); box-shadow: none; }
.ctf__barra { height: 4px; overflow: hidden; border-radius: 4px; background: var(--ctf-borde); }
.ctf__barra i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform: scaleX(var(--p, .333)); transform-origin: left; transition: transform .6s var(--ease); }

/* ── Pasos ── */
.ctf__paso + .ctf__paso { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--ctf-borde); }
.ctf.is-js .ctf__paso:not(.is-on) { display: none; }
.ctf.is-js .ctf__paso + .ctf__paso { margin-top: 0; padding-top: 0; border-top: 0; }
.ctf.is-js .ctf__paso.is-on { animation: ctf-entra .5s var(--ease) both; }
@keyframes ctf-entra { from { opacity: 0; transform: translateY(10px); } }
.ctf__paso h3 { margin-bottom: 20px; font-size: clamp(24px, 2.2vw, 32px); line-height: 1.15; scroll-margin-top: 120px; }
.ctf__paso h3:focus { outline: none; }
.ctf__paso h3:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.ctf__paso h3 small { display: block; margin-bottom: 6px; color: var(--ctf-naranja-txt); font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.ctf__grupo { min-width: 0; margin: 0 0 22px; padding: 0; border: 0; }
.ctf__grupo legend, .ctf__campo label { display: block; margin-bottom: 10px; padding: 0; font-size: 15px; font-weight: 600; }
.ctf__grupo legend em, .ctf__campo label em { margin-left: 6px; color: var(--ctf-gris); font-size: 13.5px; font-style: normal; font-weight: 400; }
.ctf__nota { margin-top: 8px; color: var(--ctf-gris); font-size: 13.5px; line-height: 1.45; }

/* ── Tarjetas de servicio (checkbox) ── */
.ctf__cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ctf__card, .ctf__chip, .ctf__opt { position: relative; cursor: pointer; }
.ctf__card input, .ctf__chip input, .ctf__opt input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ctf__card-in { position: relative; display: grid; align-content: start; gap: 6px; height: 100%; min-height: 138px; padding: 18px; border-radius: 20px; background: #fff; box-shadow: inset 0 0 0 1px var(--ctf-borde); transition: background-color .3s var(--ease), color .3s, box-shadow .3s, transform .35s var(--ease); }
.ctf__card-in::after { content: ""; position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #D6CEC5; transition: background-color .25s, box-shadow .25s, transform .35s var(--ease); }
.ctf__card-in i { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 14px; background: #FFF1E9; color: var(--accent); transition: background-color .3s, color .3s; }
.ctf__card-in b { font-size: 16.5px; font-weight: 600; line-height: 1.25; }
.ctf__card-in small { color: var(--ctf-gris); font-size: 14px; line-height: 1.4; transition: color .3s; }
.ctf__card:hover .ctf__card-in { box-shadow: inset 0 0 0 1.5px var(--noche); transform: translateY(-2px); }
.ctf__card input:checked + .ctf__card-in { background: var(--noche); color: #fff; box-shadow: 0 18px 34px -22px rgba(18, 16, 17, .7); }
.ctf__card input:checked + .ctf__card-in small { color: rgba(255, 255, 255, .72); }
.ctf__card input:checked + .ctf__card-in i { background: var(--lima); color: var(--noche); }
.ctf__card input:checked + .ctf__card-in::after { background: var(--lima) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121011' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") 50% 50% / 13px no-repeat; box-shadow: none; transform: scale(1.08); }
.ctf__card:hover input:checked + .ctf__card-in { background: #000; color: #fff; }
.ctf__card input:focus-visible + .ctf__card-in { outline: 3px solid var(--accent); outline-offset: 3px; }
.ctf__grupo.is-error .ctf__card-in { box-shadow: inset 0 0 0 1.5px var(--ctf-naranja-txt); }

/* ── Chips (radio) ── */
.ctf__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ctf__chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--ctf-borde); font-size: 15px; font-weight: 500; white-space: nowrap; transition: background-color .25s, color .25s, box-shadow .25s; }
.ctf__chip:hover span { box-shadow: inset 0 0 0 1px var(--noche); }
.ctf__chip input:checked + span, .ctf__chip:hover input:checked + span { background: var(--noche); color: #fff; box-shadow: none; }

/* ── Control segmentado (radio) ── */
.ctf__seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 4px; border-radius: 999px; background: #F1EBE4; }
.ctf__seg--dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ctf__opt span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border-radius: 999px; color: var(--ctf-gris); font-size: 14.5px; font-weight: 600; text-align: center; line-height: 1.15; transition: background-color .3s, color .3s, box-shadow .3s; }
.ctf__opt:hover span { color: var(--ink); background: rgba(255, 255, 255, .55); }
.ctf__opt input:checked + span, .ctf__opt:hover input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(18, 16, 17, .08), 0 6px 14px -8px rgba(18, 16, 17, .35); }
.ctf__chip input:focus-visible + span, .ctf__opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── Campos de texto ── */
.ctf__campo { margin-bottom: 22px; }
.ctf__dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.ctf__campo--ancho { grid-column: 1 / -1; }
.ctf__campo input, .ctf__campo textarea { display: block; width: 100%; min-height: 52px; padding: 0 16px; border: 1px solid #E2D9CF; border-radius: 14px; background: #fff; color: var(--ink); font: 400 16px/1.4 var(--f); scroll-margin-top: 140px; transition: border-color .2s, box-shadow .2s; }
.ctf__campo textarea { min-height: 112px; padding: 14px 16px; resize: vertical; }
.ctf__campo input::placeholder, .ctf__campo textarea::placeholder { color: #8F8A86; }
.ctf__campo input:hover, .ctf__campo textarea:hover { border-color: #BFB5AB; }
.ctf__campo input:focus, .ctf__campo textarea:focus { outline: none; border-color: var(--noche); box-shadow: 0 0 0 4px rgba(255, 91, 35, .2); }
.ctf__campo [aria-invalid="true"] { border-color: var(--ctf-naranja-txt); }
.ctf__cuenta { margin-top: 6px; color: var(--ctf-gris); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.ctf__cuenta.is-cerca { color: var(--ctf-naranja-txt); }
.ctf__err { color: var(--ctf-naranja-txt); font-size: 14px; font-weight: 500; line-height: 1.35; }
.ctf__err:not(:empty) { margin-top: 8px; }
.ctf__err:not(:empty)::before { content: "! "; font-weight: 800; }
.ctf__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Navegación y avisos ── */
.ctf__nav { display: flex; align-items: center; justify-content: flex-end; gap: 12px 20px; margin-top: 8px; }
.ctf__atras { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-right: auto; padding: 0 6px; border: 0; background: none; color: var(--ink); font: 600 15.5px/1 var(--f); cursor: pointer; transition: color .2s; }
.ctf__atras::before { content: "←"; transition: transform .3s var(--ease); }
.ctf__atras:hover { color: var(--ctf-naranja-txt); }
.ctf__atras:hover::before { transform: translateX(-3px); }
.ctf__nav .boton { border: 0; cursor: pointer; }
.ctf__nav .boton[aria-busy="true"] { opacity: .7; pointer-events: none; }
.ctf__aviso:not(:empty) { margin: 6px 0 10px; color: var(--ctf-naranja-txt); font-size: 14.5px; font-weight: 500; }
.ctf__priv { margin-top: 18px; color: var(--ctf-gris); font-size: 13.5px; }
.ctf__priv a { display: inline-block; padding: 12px 0; color: var(--ink); text-underline-offset: 3px; }
.ctf__priv a:hover { color: var(--ctf-naranja-txt); }
.ctf__fallo { display: grid; justify-items: start; gap: 14px; margin-bottom: 22px; padding: 20px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--accent); }
.ctf__fallo p { font-size: 15.5px; line-height: 1.5; }

/* ── Resumen en vivo ── */
.ctf__res { position: sticky; top: 136px; min-width: 0; }
.ctf__res details { overflow: hidden; border-radius: clamp(22px, 2.4vw, 28px); background: var(--noche); color: #fff; box-shadow: 0 30px 60px -36px rgba(18, 16, 17, .6); }
.ctf__res summary { display: flex; align-items: center; gap: 10px; padding: 24px 26px 0; list-style: none; cursor: default; }
.ctf__res summary::-webkit-details-marker { display: none; }
.ctf__res-eti { flex: none; white-space: nowrap; color: var(--lima); font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.ctf__res summary b { display: none; }
.ctf__res-pct { flex: none; margin-left: auto; white-space: nowrap; color: rgba(255, 255, 255, .72); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ctf__res-cuerpo { padding: 14px 26px 26px; }
.ctf__medidor { height: 4px; margin-bottom: 22px; overflow: hidden; border-radius: 4px; background: rgba(255, 255, 255, .12); }
.ctf__medidor i { display: block; height: 100%; background: var(--lima); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .6s var(--ease); }
.ctf__frase { margin-bottom: 18px; font-family: 'Instrument Serif', Georgia, serif; font-size: clamp(22px, 1.9vw, 27px); font-style: italic; line-height: 1.28; color: rgba(255, 255, 255, .78); }
.ctf__frase b { color: var(--lima); font-weight: 400; }
.ctf__frase em { color: #fff; font-style: italic; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ctf__res dl { display: grid; margin: 0; }
.ctf__res dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .1); animation: ctf-entra .45s var(--ease) both; }
.ctf__res dt { padding-top: 2px; color: rgba(255, 255, 255, .6); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.ctf__res dd { margin: 0; font-size: 15.5px; line-height: 1.4; overflow-wrap: anywhere; }
.ctf__res-pie { margin-top: 16px; color: rgba(255, 255, 255, .6); font-size: 13.5px; }

/* ── Confirmación ── */
.ctf__ok { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: center; gap: clamp(24px, 4vw, 64px); padding: clamp(24px, 4vw, 56px); border-radius: clamp(22px, 2.4vw, 32px); background: var(--ctf-crema); box-shadow: inset 0 0 0 1px #F0EAE3; animation: ctf-entra .6s var(--ease) both; }
.ctf__ok-fig { position: relative; justify-self: center; width: min(100%, 300px); }
.ctf__ok-fig::before { content: ""; position: absolute; left: 6%; right: 6%; bottom: 2%; z-index: 0; aspect-ratio: 1; border-radius: 50%; background: var(--lima); }
.ctf__ok-fig img { position: relative; z-index: 1; width: 100%; height: auto; animation: ctf-hola .9s var(--ease) both; }
@keyframes ctf-hola { from { opacity: 0; transform: translateY(24px) scale(.94); } }
.ctf__ok-fig i { position: absolute; z-index: 2; left: 50%; top: 45%; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); opacity: 0; animation: ctf-chispa 1.1s .25s cubic-bezier(.2, .8, .3, 1) both; }
.ctf__ok-fig i:nth-child(odd) { background: var(--noche); border-radius: 50%; }
.ctf__ok-fig i:nth-child(3n) { background: var(--lima); box-shadow: inset 0 0 0 1.5px var(--noche); }
.ctf__ok-fig i:nth-child(2) { --x: -150px; --y: -120px; --r: 120deg; }
.ctf__ok-fig i:nth-child(3) { --x: 140px; --y: -140px; --r: -90deg; }
.ctf__ok-fig i:nth-child(4) { --x: -170px; --y: 10px; --r: 200deg; }
.ctf__ok-fig i:nth-child(5) { --x: 165px; --y: -20px; --r: 60deg; }
.ctf__ok-fig i:nth-child(6) { --x: -110px; --y: 130px; --r: -150deg; }
.ctf__ok-fig i:nth-child(7) { --x: 120px; --y: 120px; --r: 90deg; }
.ctf__ok-fig i:nth-child(8) { --x: -20px; --y: -180px; --r: 45deg; }
.ctf__ok-fig i:nth-child(9) { --x: 30px; --y: 170px; --r: -60deg; }
@keyframes ctf-chispa { 0% { opacity: 1; transform: translate(-50%, -50%) scale(.4); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1); } }
.ctf__ok-txt { display: grid; justify-items: start; gap: 14px; }
.ctf__ok-txt h3 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.08; }
.ctf__ok-txt h3:focus { outline: none; }
.ctf__ok-txt p { max-width: 46ch; color: var(--ctf-gris); font-size: clamp(16px, 1.3vw, 18px); line-height: 1.55; }
.ctf__ok-txt .ctf__ok-mas { margin-top: 8px; color: var(--ink); font-weight: 600; }

/* ── Tablet ── */
@media (max-width: 960px) {
	.ctf__cab { grid-template-columns: minmax(0, 1fr); }
	.ctf__cab > p:last-child { grid-column: 1; grid-row: auto; }
	.ctf__grid { grid-template-columns: minmax(0, 1fr); }
	/* el resumen pasa arriba como barra plegable que acompaña al bajar */
	.ctf__res { order: -1; top: 76px; z-index: 5; }
	.ctf__form { scroll-margin-top: 140px; }
	.ctf__res details { border-radius: 18px; }
	.ctf__res summary { min-height: 56px; padding: 0 16px; cursor: pointer; }
	.ctf__res summary b { display: block; min-width: 0; overflow: hidden; font-size: 14.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
	.ctf__res-pct { display: inline-flex; align-items: center; gap: 8px; }
	.ctf__res-pct::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .3s var(--ease); }
	.ctf__res details[open] .ctf__res-pct::after { transform: translateY(2px) rotate(-135deg); }
	.ctf__res-cuerpo { max-height: 55vh; overflow: auto; padding: 4px 16px 18px; }
	.ctf__medidor { margin-bottom: 14px; }
	.ctf__frase { margin-bottom: 10px; font-size: 21px; }
	.ctf__ok { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
	.ctf__ok-txt { justify-items: center; }
	.ctf__ok-fig { width: 200px; }
}

/* ── Celular: tarjetas 2×3 compactas, chips en fila deslizable ── */
@media (max-width: 600px) {
	.ctf__in { padding-top: 44px; padding-bottom: 44px; }
	.ctf__cab { margin-bottom: 20px; }
	.ctf__cab > p:last-child { font-size: 15.5px; }
	.ctf__form { padding: 20px 16px; border-radius: 22px; }
	.ctf__prog li { gap: 6px; font-size: 12px; line-height: 1.15; }
	.ctf__prog li span { width: 24px; height: 24px; font-size: 12px; }
	.ctf__paso h3 { margin-bottom: 16px; font-size: 23px; }
	.ctf__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.ctf__card-in { min-height: 0; gap: 2px; padding: 14px 12px; border-radius: 16px; }
	.ctf__card-in::after { top: 10px; right: 10px; width: 20px; height: 20px; }
	.ctf__card-in i { width: 38px; height: 38px; margin-bottom: 6px; border-radius: 12px; }
	.ctf__card-in b { font-size: 15px; }
	.ctf__card-in small { display: none; }
	.ctf__grupo, .ctf__campo { margin-bottom: 18px; }
	.ctf__chips { flex-wrap: nowrap; margin-right: -16px; padding-right: 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
	.ctf__chips::-webkit-scrollbar { display: none; }
	.ctf__chip { flex: none; scroll-snap-align: start; }
	.ctf__chip span { padding: 0 14px; font-size: 14.5px; }
	.ctf__opt span { padding: 0 6px; font-size: 13.5px; }
	.ctf__dos { grid-template-columns: minmax(0, 1fr); }
	.ctf__nav .boton { flex: 1; }
	.ctf__ok { padding: 28px 18px; }
	.ctf__ok-fig { width: 170px; }
	.ctf__ok .boton { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.ctf *, .ctf *::before, .ctf *::after { animation: none !important; transition-duration: .01ms !important; }
	.ctf__ok-fig i { display: none; }
}
