/* Flujo de creación (/crear) y página de estado (/estado). Usa los tokens y componentes de styles.css. */

.flow-page { background: var(--tint); min-height: 100vh; }
.flow-page .top { background: rgba(240, 242, 251, .9); border-bottom-color: var(--line); }
.top-actions { display: flex; align-items: center; gap: 22px; font-weight: 600; font-size: .95rem; }
.top-actions a { color: var(--ink-soft); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.top-actions a:hover { color: var(--brand); }
@media (max-width: 520px) { .top-actions .help { display: none; } }

.flow-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; padding-block: clamp(20px, 4vw, 40px) 80px; }
@media (max-width: 980px) { .flow-grid { grid-template-columns: 1fr; } .flow-side { display: none; } }

/* Tarjeta principal */
.flow-main { background: var(--surface); border-radius: var(--radius-l); box-shadow: var(--shadow); border: 1px solid var(--line); padding: clamp(22px, 4vw, 44px); min-width: 0; }
.flow-progress { display: grid; gap: 14px; margin-bottom: clamp(24px, 4vw, 36px); }
.flow-count { font: 700 .85rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.flow-count b { color: var(--brand); }
.stepper { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.stepper li { flex: 1; min-width: 0; }
.stepper button { width: 100%; border: 0; background: none; padding: 0; text-align: left; display: grid; gap: 8px; color: var(--muted); font: 600 .85rem var(--font-body); }
.stepper button:disabled { cursor: default; }
.stepper .seg { height: 6px; border-radius: 99px; background: var(--line); transition: background .25s; }
.stepper .on .seg, .stepper .done .seg { background: var(--brand); }
.stepper .on { color: var(--ink); }
.stepper .done { color: var(--brand); }
.stepper .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .stepper .label { display: none; } .stepper { gap: 6px; } }

.step-title { font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.4rem); letter-spacing: -.035em; margin-bottom: 10px; outline: none; }
.step-sub { color: var(--muted); font-size: 1.05rem; max-width: 34em; margin-bottom: 28px; }
.step[hidden] { display: none; }

/* Tarjetas de elección con imagen */
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; border: 0; padding: 0; margin: 0; min-width: 0; }
.pick { position: relative; display: block; min-width: 0; }
.pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.pick-card { display: flex; flex-direction: column; height: 100%; border: 2px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); transition: border-color .15s, box-shadow .15s, transform .15s; }
.pick:hover .pick-card { border-color: #b8c1f2; transform: translateY(-2px); }
.pick input:checked + .pick-card { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(42, 68, 224, .14); }
.pick input:focus-visible + .pick-card { outline: 3px solid var(--brand); outline-offset: 3px; }
.pick-card img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--tint); }
.pick-body { padding: 14px 16px 16px; display: grid; gap: 3px; }
.pick-body b { font: 800 1.05rem/1.2 var(--font-display); letter-spacing: -.02em; }
.pick-body small { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.pick-check { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; z-index: 1; }
.pick-check .icon { width: 18px; height: 18px; stroke-width: 3; }
.pick input:checked ~ .pick-check { opacity: 1; transform: none; }
@media (max-width: 420px) { .pick-grid { gap: 10px; } .pick-body { padding: 11px 12px 13px; } .pick-body b { font-size: .98rem; } .pick-body small { font-size: .83rem; } }

/* Campos */
.field { display: grid; gap: 8px; margin-bottom: 24px; min-width: 0; }
.field > label:not(.drop):not(.consent), .field > legend, .legend { font: 700 .98rem var(--font-body); color: var(--ink); padding: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.field .opt { font-weight: 500; color: var(--muted); font-size: .88rem; }
.hint { color: var(--muted); font-size: .9rem; margin: -2px 0 0; }
fieldset.field { border: 0; margin: 0 0 24px; padding: 0; }
input[type="text"], input[type="email"], select, textarea { width: 100%; min-height: 54px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 1.05rem; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235a6285' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 46px; }
input::placeholder, textarea::placeholder { color: #98a0bd; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(42, 68, 224, .14); }
.field.invalid input, .field.invalid select, .field.invalid textarea, .field.invalid .drop { border-color: var(--bad); }
.field-error { color: var(--bad); font-weight: 600; font-size: .92rem; display: none; gap: 8px; }
.field.invalid .field-error, .field-error.show { display: flex; }
.counter { text-align: right; color: var(--muted); font-size: .85rem; margin-top: -4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }

/* Fichas de opción corta (edad, género, sugerencias) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 52px; padding: 0 18px; border: 2px solid var(--line); border-radius: 14px; font-weight: 700; font-size: 1.05rem; background: var(--surface); transition: border-color .15s, background .15s, color .15s; }
.chip:hover span { border-color: #b8c1f2; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 3px; }
.chips.ages .chip span { min-width: 56px; padding: 0; }
.chips.wide .chip span { padding: 0 22px; }
@media (max-width: 560px) {
  .chips.ages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .chips.ages .chip span { min-width: 0; width: 100%; }
  .chips.wide { gap: 8px; }
  .chips.wide .chip span { padding: 0 14px; }
}
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 40px; padding: 0 16px; font-weight: 600; font-size: .95rem; color: var(--ink-soft); transition: all .15s; }
.suggest button:hover { border-color: var(--brand); color: var(--brand); }
.suggest button[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* Foto */
.drop { display: block; border: 2px dashed #b4bde9; border-radius: 20px; background: #f7f8ff; padding: 26px 20px; cursor: pointer; transition: border-color .15s, background .15s; text-align: center; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.photo input:focus-visible + .drop { outline: 3px solid var(--brand); outline-offset: 3px; }
.drop-empty { display: grid; gap: 6px; justify-items: center; }
.drop-empty .badge { width: 56px; height: 56px; border-radius: 18px; background: var(--brand); color: #fff; display: grid; place-items: center; margin-bottom: 6px; }
.drop-empty .badge .icon { width: 26px; height: 26px; }
.drop-empty strong { font: 800 1.1rem var(--font-display); letter-spacing: -.02em; }
.drop-empty small { color: var(--muted); }
.drop-filled { display: flex; align-items: center; gap: 18px; text-align: left; }
.drop-filled img { width: 96px; height: 96px; border-radius: 18px; object-fit: cover; flex: none; box-shadow: var(--shadow-s); }
.drop-filled b { display: block; font-size: 1.05rem; }
.drop-filled u { color: var(--brand); font-weight: 600; }
.tips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: .95rem; }
.tips li { display: flex; gap: 10px; align-items: flex-start; }
.tips .icon { color: var(--ok); margin-top: 3px; stroke-width: 2.6; }
.privacy-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--sun-soft); color: var(--ink); font-size: .95rem; }
.privacy-note .icon { margin-top: 2px; flex: none; }
@media (max-width: 560px) { .tips { grid-template-columns: 1fr; } }

/* Resumen */
.summary { list-style: none; margin: 0 0 26px; padding: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.summary li { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.summary li:last-child { border-bottom: 0; }
.summary .k { color: var(--muted); font-size: .92rem; font-weight: 600; }
.summary .v { font-weight: 700; overflow-wrap: anywhere; display: flex; align-items: center; gap: 12px; }
.summary .v img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.summary .v .none { color: var(--muted); font-weight: 500; }
.summary button { border: 0; background: none; color: var(--brand); font-weight: 700; font-size: .92rem; padding: 6px 4px; }
.summary button:hover { text-decoration: underline; }
@media (max-width: 520px) { .summary li { grid-template-columns: 1fr auto; } .summary .k { grid-column: 1 / -1; margin-bottom: -8px; } }
.next-steps { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; counter-reset: n; }
.next-steps li { display: flex; gap: 14px; align-items: flex-start; color: var(--ink-soft); counter-increment: n; }
.next-steps li::before { content: counter(n); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font: 800 .9rem var(--font-display); display: grid; place-items: center; }
.consent { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--ink-soft); font-size: .95rem; }
.consent input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--brand); }
.field.invalid .consent { border-color: var(--bad); }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 0 4px; font-weight: 700; }
.total strong { font: 800 2rem var(--font-display); letter-spacing: -.04em; }
.form-error { display: none; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: #fdecea; color: var(--bad); font-weight: 600; }
.form-error.show { display: flex; }

/* Acciones */
.flow-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.flow-actions .spacer { flex: 1; }
.skip-link { border: 0; background: none; color: var(--muted); font-weight: 700; padding: 10px 14px; }
.skip-link:hover { color: var(--brand); }
@media (max-width: 640px) {
  .flow-actions { position: sticky; bottom: 0; margin: 28px calc(var(--gutter) * -1) calc(clamp(22px, 4vw, 44px) * -1); padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom, 0px)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-radius: 0 0 var(--radius-l) var(--radius-l); }
  .flow-actions .btn.primary { flex: 1; }
}

/* Vista previa lateral */
.flow-side { position: sticky; top: calc(var(--header-h) + 20px); }
.preview { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px; box-shadow: var(--shadow-s); display: grid; gap: 18px; }
.side-label { font: 700 .78rem var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.cover { position: relative; aspect-ratio: 1; border-radius: 4px 14px 14px 4px; overflow: hidden; box-shadow: 8px 14px 30px rgba(18, 24, 58, .22); border-left: 8px solid var(--brand); background: var(--tint); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-title { position: absolute; left: 6%; right: 6%; bottom: 5%; background: rgba(255, 255, 255, .93); border-radius: 12px; padding: 10px 12px; text-align: center; }
.cover-title small { display: block; font: 700 .62rem var(--font-body); letter-spacing: .14em; color: var(--muted); }
.cover-title strong { display: block; font: 800 1.35rem/1.15 var(--font-display); letter-spacing: -.03em; color: var(--brand); overflow-wrap: anywhere; }
.side-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.side-facts li { background: var(--tint); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .88rem; color: var(--ink-soft); }
.side-note { color: var(--muted); font-size: .88rem; line-height: 1.45; }

/* Estado del pedido */
.status-wrap { max-width: 720px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) var(--gutter) 96px; }
.status-card { background: var(--surface); border-radius: var(--radius-l); border: 1px solid var(--line); box-shadow: var(--shadow); padding: clamp(26px, 5vw, 48px); display: grid; gap: 22px; justify-items: center; text-align: center; }
.status-card h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.6rem); }
.status-card p { color: var(--muted); max-width: 32em; }
.status-card .eyebrow { justify-content: center; }
.status-cover { width: min(320px, 78%); }
.status-cover .cover { box-shadow: 10px 18px 36px rgba(18, 24, 58, .25); }
.status-icon { width: 76px; height: 76px; border-radius: 24px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.status-icon.warm { background: var(--sun-soft); color: var(--ink); }
.status-icon .icon { width: 36px; height: 36px; }
.progress-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; width: min(380px, 100%); text-align: left; }
.progress-list li { display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: center; padding: 10px 0; color: var(--muted); font-weight: 600; position: relative; }
.progress-list li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); justify-self: center; background: var(--surface); position: relative; z-index: 1; }
.progress-list li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 32px; bottom: -10px; width: 2px; background: var(--line); }
.progress-list li.done { color: var(--ink); }
.progress-list li.done::before { background: var(--ok); border-color: var(--ok); }
.progress-list li.done::after { background: var(--ok); }
.progress-list li.now { color: var(--ink); }
.progress-list li.now::before { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 5px rgba(42, 68, 224, .18); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(42, 68, 224, .06); } }
@media (prefers-reduced-motion: reduce) { .progress-list li.now::before { animation: none; } }
.status-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.status-note { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 14px 16px; border-radius: 14px; background: var(--tint); color: var(--ink-soft); font-size: .95rem; max-width: 34em; }
.status-note .icon { color: var(--brand); margin-top: 2px; flex: none; }
