/* =========================================================
   cotizador.css
   El cotizador guiado del inicio (sección #cotizar), el botón
   "Cotiza tu proyecto" de la barra y el de la sección principal.
   Usa los colores y letras de inicio.css, así que funciona en
   los dos temas sin tocar nada.
   ========================================================= */

:root, :root[data-theme="dark"] { --q-error: #ff8f8f; --q-ok: #3fd8f6; --q-field-bg: rgba(5, 9, 26, .55); }
:root[data-theme="light"] { --q-error: #b42318; --q-ok: #1652ee; --q-field-bg: #fff; }
:root { --q-ease: cubic-bezier(.23, 1, .32, 1); }

/* ---------- Botón grande (sección principal y cotizador) ---------- */
.btn--lg { min-height: 52px; padding: 14px 24px; font-size: 1rem; font-weight: 700; border-radius: 14px; justify-content: center; }
.btn:active { transform: scale(.97); transition-duration: .1s; }
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* ---------- Sección principal ---------- */
.hero__cta { margin-top: 30px; opacity: 0; transform: translateY(18px); animation: rise .9s var(--ease) var(--d, 0s) forwards; }
.hero__cta + .hero__now { margin-top: 28px; }

/* ---------- Barra: "Cotiza tu proyecto" ---------- */
.nav__links a.nav__cta { margin-left: 4px; padding: 7px 14px; border-radius: 10px; border: 1.5px solid var(--cyan); color: var(--ink); font-weight: 600; white-space: nowrap; transition: background .2s, color .2s; }
.nav__links a.nav__cta::after { display: none; }
.nav__cta-short { display: none; }
@media (hover: hover) and (pointer: fine) { .nav__links a.nav__cta:hover { background: var(--cyan); color: var(--bg); } }
@media (max-width: 900px) { .nav__cta-long { display: none; } .nav__cta-short { display: inline; } }
@media (max-width: 720px) { .nav__links a.nav__cta { padding: 6px 10px; margin-left: 2px; } }
@media (max-width: 430px) { .nav__links a[href="#sobre-mi"] { display: none; } }

/* ---------- Tarjeta del cotizador ---------- */
.quote { margin-top: clamp(32px, 5vw, 52px); max-width: 860px; padding: clamp(20px, 4vw, 40px); border: 1px solid var(--line); border-radius: 26px; background: var(--surface); }
.quote__head { display: grid; gap: 12px; margin-bottom: clamp(22px, 3vw, 32px); }
.quote__count { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.quote__count strong { color: var(--ink); font-weight: 600; }
.quote__bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.quote__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transform: scaleX(var(--p, .2)); transform-origin: left; transition: transform .35s var(--q-ease); }

/* ---------- Pasos ---------- */
.q-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.q-step:not([hidden]) { animation: q-in .24s var(--q-ease); }
.q-step legend { padding: 0; }
.q-step__title { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.35rem, 1.1rem + 1.2vw, 2rem); line-height: 1.15; letter-spacing: -.02em; }
.q-step__title:focus { outline: none; }
.q-step__title:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.q-step__hint { margin-top: 6px; color: var(--ink-2); font-size: .98rem; }
@keyframes q-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Opciones (tarjetas que se tocan) ---------- */
.q-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; margin-top: 20px; }
.q-options--4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.q-options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 380px) { .q-options--3 { grid-template-columns: 1fr; } }

.q-opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--chip-bg); cursor: pointer; line-height: 1.3; font-weight: 500; -webkit-tap-highlight-color: transparent; user-select: none; transition: border-color .15s ease, background .15s ease, transform .12s var(--q-ease); }
.q-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
/* El indicador: círculo (una opción) o cuadro (varias) */
.q-opt::before { content: ""; flex: none; width: 20px; height: 20px; border: 2px solid var(--line-strong); border-radius: 50%; background: transparent center / 12px no-repeat; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.q-opt--check::before { border-radius: 6px; }
.q-opt:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .q-opt:hover { border-color: var(--blue-2); } }
.q-opt:has(input:checked) { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 12%, var(--chip-bg)); }
.q-opt:has(input:checked)::before { border-color: var(--cyan); background-color: var(--cyan); box-shadow: inset 0 0 0 3px var(--bg); }
.q-opt--check:has(input:checked)::before { box-shadow: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%2305091a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.q-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.q-opt.is-invalid, .q-options.is-invalid .q-opt { border-color: var(--q-error); }

/* ---------- Campos de texto ---------- */
.q-field { display: grid; gap: 8px; margin-top: 20px; }
.q-field > label { font-weight: 600; font-size: .98rem; }
.q-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 16px; }
.q-input { width: 100%; min-height: 52px; padding: 13px 15px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--q-field-bg); color: var(--ink); font: inherit; font-size: max(16px, 1rem); line-height: 1.4; transition: border-color .15s ease; }
textarea.q-input { resize: vertical; min-height: 110px; }
.q-input::placeholder { color: var(--muted); opacity: 1; }
.q-input:focus { border-color: var(--cyan); }
.q-input[aria-invalid="true"] { border-color: var(--q-error); }
.q-optional { color: var(--muted); font-weight: 400; }
.q-req { color: var(--q-error); }
.q-sub { margin: 22px 0 0; padding: 0; border: 0; min-width: 0; }
.q-sub > legend { padding: 0; font-weight: 600; font-size: .98rem; }
.q-sub .q-options { margin-top: 10px; }

/* ---------- Errores ---------- */
.q-error { margin-top: 12px; color: var(--q-error); font-weight: 600; font-size: .95rem; }
.q-error:empty { display: none; }
.q-error::before { content: "! "; font-family: var(--font-mono); }
.q-field .q-error { margin-top: 0; }

/* ---------- Resumen ---------- */
.q-summary { display: grid; margin-top: 22px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.q-summary__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.q-summary__row:last-child { border-bottom: 0; }
.q-summary dt { grid-column: 1; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.q-summary dd { grid-column: 1; overflow-wrap: anywhere; white-space: pre-line; }
.q-summary dd + dd { color: var(--ink-2); font-size: .95rem; }
.q-summary__edit { grid-column: 2; grid-row: 1 / span 3; align-self: center; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: transparent; font-weight: 600; font-size: .9rem; transition: border-color .15s ease, transform .12s var(--q-ease); }
.q-summary__edit:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .q-summary__edit:hover { border-color: var(--cyan); } }

.q-send { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.q-send__wa { background: #15803d; } /* verde oscuro: el texto blanco se lee bien (contraste AA) */
.q-send__wa:hover { filter: brightness(1.06); }

/* ---------- Atrás / Siguiente ---------- */
.quote__nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.quote__nav [data-q-next] { margin-left: auto; }
.quote__nav:has([data-q-next][hidden]) { justify-content: flex-start; }

.quote__note { margin-top: 22px; color: var(--ink-2); font-size: .98rem; }

/* ---------- Celular: botones a lo ancho, nada se sale ---------- */
@media (max-width: 520px) {
  .quote { border-radius: 20px; }
  .q-send > .btn { flex: 1 1 100%; }
  .quote__nav > .btn { flex: 1 1 0; padding-inline: 14px; }
  .q-summary__row { grid-template-columns: 1fr; padding: 14px; }
  .q-summary__edit { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* ---------- Menos movimiento: solo se desvanece, sin desplazarse ---------- */
@media (prefers-reduced-motion: reduce) {
  .q-step:not([hidden]) { animation: none; }
  .quote__bar span { transition: none; }
  .btn:active, .q-opt:active, .q-summary__edit:active { transform: none; }
}
