/* =====================================================================
   BINER STUDIO — Formulario inteligente de proyectos
   ===================================================================== */
.muted { color: var(--text-3); }
.link { color: var(--blue-300); text-decoration: underline; text-underline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-shell { position: relative; min-height: 100svh; padding: calc(var(--header-h) + 40px) 0 80px; overflow: hidden; overflow: clip; }
.form-layout > * { min-width: 0; }
.form-layout { position: relative; z-index: 1; display: grid; grid-template-columns: 320px 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }

/* Lateral */
.form-aside { position: sticky; top: calc(var(--header-h) + 32px); }
.form-aside h1 { font-size: clamp(30px, 3.4vw, 42px); margin-bottom: 12px; }
.context-chip { margin-top: 20px; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 14px; background: rgba(47,123,255,.12); border: 1px solid rgba(111,177,255,.35); font-size: 14px; }
.context-chip b { color: #fff; }
.context-chip button { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255,255,255,.06); color: var(--text-2); display: grid; place-items: center; flex: none; }
.context-chip button svg { width: 14px; height: 14px; }
.stepper { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.stepper li { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 12px; color: var(--text-3); font-size: 15px; position: relative; }
.stepper li .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--line-2); flex: none; transition: all .3s; }
.stepper li.done { color: var(--text-2); cursor: pointer; }
.stepper li.done:hover { background: rgba(255,255,255,.03); }
.stepper li.done .n { background: rgba(61,220,151,.12); border-color: rgba(61,220,151,.45); color: var(--ok); }
.stepper li.current { color: #fff; background: rgba(47,123,255,.1); }
.stepper li.current .n { background: var(--blue-500); border-color: var(--blue-500); color: #fff; box-shadow: 0 0 20px -2px rgba(47,123,255,.7); }
.autosave { margin-top: 24px; display: flex; gap: 10px; font-size: 13px; color: var(--text-3); }
.autosave svg { width: 16px; height: 16px; color: var(--ok); flex: none; margin-top: 2px; }

/* Panel principal */
.wizard { padding: clamp(22px, 4vw, 44px); overflow: hidden; overflow: clip; }
.progress { position: absolute; left: 0; top: 0; right: 0; height: 3px; background: rgba(255,255,255,.05); }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue-600), var(--cyan)); transition: width .5s var(--ease); box-shadow: 0 0 12px rgba(70,214,255,.6); }
.step-head { margin-bottom: 28px; }
.step-head .kicker { font-family: var(--font-mono); font-size: 12px; color: var(--blue-300); letter-spacing: .14em; text-transform: uppercase; }
.step-head h2 { font-size: clamp(24px, 2.8vw, 32px); margin-top: 10px; }
.step-head p { color: var(--text-2); margin-top: 8px; }
.step-anim { animation: stepIn .45s var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; }
.fields .full { grid-column: 1 / -1; }
.fields-sub { grid-column: 1 / -1; margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }

/* Tarjetas de tipo de solicitud */
.type-cards { display: grid; gap: 14px; }
.type-card { position: relative; display: flex; align-items: center; gap: 18px; padding: 22px; border-radius: 18px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); cursor: pointer; transition: all .25s var(--ease); }
.type-card:hover { border-color: rgba(111,177,255,.5); background: rgba(47,123,255,.05); }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card .icon-tile { flex: none; }
.type-card b { display: block; font-family: var(--font-display); font-size: 18px; }
.type-card small { display: block; color: var(--text-2); font-size: 14px; margin-top: 4px; }
.type-card .radio { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; transition: all .2s; }
.type-card:has(input:checked) { border-color: var(--blue-400); background: linear-gradient(140deg, rgba(47,123,255,.2), rgba(47,123,255,.04)); box-shadow: var(--shadow-glow); }
.type-card:has(input:checked) .radio { border-color: var(--blue-400); background: var(--blue-500); box-shadow: inset 0 0 0 4px var(--bg-2); }
.type-card:has(input:focus-visible) { outline: 2px solid var(--blue-400); outline-offset: 3px; }

/* Opciones: cards, pills, chips, yesno */
.opt-group { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-group.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); color: var(--text-2); font-size: 14px; font-weight: 600; text-align: center; transition: all .2s; }
.opt-group.cards .opt span { min-height: 58px; border-radius: 14px; }
.opt:hover span { border-color: rgba(111,177,255,.5); color: #fff; }
.opt input:checked + span { background: rgba(47,123,255,.18); border-color: var(--blue-400); color: #fff; }
.opt input:focus-visible + span { outline: 2px solid var(--blue-400); outline-offset: 2px; }
.opt-group.chips .opt input:checked + span::before { content: "✓"; font-size: 12px; color: var(--blue-200); }
.field.invalid .opt span { border-color: rgba(255,107,125,.55); }
.type-cards.invalid .type-card { border-color: rgba(255,107,125,.55); }
.type-error { display: none; color: var(--err); font-size: 14px; margin-top: 10px; }
.type-cards.invalid + .type-error { display: block; }

/* Navegación */
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.wizard-nav .btn { min-width: 150px; }
.wizard-nav[hidden] { display: none; }
#btn-prev[hidden] { display: inline-flex; visibility: hidden; }

/* Revisión */
.review { display: flex; flex-direction: column; gap: 14px; }
.review-block { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.review-block header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: rgba(255,255,255,.025); border-bottom: 1px solid var(--line); }
.review-block h3 { font-size: 15px; font-family: var(--font-display); }
.review-block header button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--blue-300); font-size: 13px; font-weight: 600; padding: 6px 8px; border-radius: 8px; }
.review-block header button:hover { background: rgba(47,123,255,.1); }
.review-block header button svg { width: 14px; height: 14px; }
.review-block dl { margin: 0; padding: 6px 18px 14px; display: grid; grid-template-columns: minmax(140px, 34%) 1fr; gap: 0 16px; }
.review-block dt, .review-block dd { padding: 9px 0; border-bottom: 1px dashed rgba(120,160,255,.1); font-size: 14px; }
.review-block dt { color: var(--text-3); }
.review-block dd { margin: 0; color: var(--text); word-break: break-word; white-space: pre-line; }
.review-block dt:nth-last-of-type(1), .review-block dd:last-of-type { border-bottom: 0; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.consent input { margin-top: 2px; width: 20px; height: 20px; accent-color: var(--blue-500); flex: none; }
.consent.invalid { border-color: rgba(255,107,125,.55); color: var(--err); }
.submit-status { margin-top: 4px; }
.submit-status:empty { display: none; }
.fallback-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
#turnstile-box:empty { display: none; }

/* Confirmación */
.success { text-align: center; padding: 20px 0 8px; }
.success-icon { width: 84px; height: 84px; margin: 0 auto 26px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(61,220,151,.25), rgba(61,220,151,.05)); border: 1px solid rgba(61,220,151,.5); color: var(--ok); box-shadow: 0 0 50px -10px rgba(61,220,151,.6); animation: pop .6s var(--ease); }
.success-icon svg { width: 40px; height: 40px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.success h2 { font-size: clamp(26px, 3vw, 34px); }
.success p { color: var(--text-2); margin: 14px auto 0; max-width: 520px; }
.ref-code { display: inline-block; margin-top: 22px; padding: 10px 18px; border-radius: 12px; font-family: var(--font-mono); background: rgba(47,123,255,.1); border: 1px solid rgba(111,177,255,.3); color: var(--blue-200); letter-spacing: .08em; }
.next-steps { text-align: left; max-width: 460px; margin: 32px auto 0; display: flex; flex-direction: column; gap: 12px; }
.next-steps li { display: flex; gap: 12px; color: var(--text-2); font-size: 15px; }
.next-steps li b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(47,123,255,.15); color: var(--blue-200); font-family: var(--font-mono); font-size: 12px; }
.success .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

@media (max-width: 980px) {
  .form-layout { grid-template-columns: 1fr; }
  .form-aside { position: static; }
  .stepper { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; margin-top: 20px; }
  .stepper::-webkit-scrollbar { display: none; }
  .stepper li { flex: none; padding: 8px 12px 8px 8px; font-size: 13px; border: 1px solid var(--line); }
  .stepper li .n { width: 24px; height: 24px; font-size: 11px; }
  .autosave { display: none; }
}
@media (max-width: 640px) {
  .form-shell { padding-top: calc(var(--header-h) + 24px); }
  .form-back-home { padding: 0 12px; }
  .form-aside > p.muted { font-size: 15px; }
  .fields { grid-template-columns: 1fr; }
  .wizard { padding: 22px 16px; border-radius: 20px; }
  .wizard-nav { position: sticky; bottom: 0; margin: 28px -16px -22px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(5,11,26,.95); backdrop-filter: blur(12px); }
  .wizard-nav .btn { min-width: 0; flex: 1; }
  .type-card { padding: 16px; gap: 14px; }
  .type-card .icon-tile { width: 42px; height: 42px; }
  .review-block dl { grid-template-columns: 1fr; }
  .review-block dt { padding-bottom: 0; border-bottom: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
  .review-block dd { padding-top: 4px; }
  .opt-group.cards { grid-template-columns: 1fr 1fr; }
}
.form-page .wa-float { bottom: 96px; }
@media (min-width: 641px) { .form-page .wa-float { bottom: 20px; } }
