/* ============================================================================
   Onboarding de transportistas — design system (fintech, móvil-first)
   ============================================================================ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("vendor/inter-var.woff2") format("woff2");
}
:root {
  --ink: #0b1220;
  --ink-soft: #334155;
  --muted: #6b7688;
  --line: #e7ecf3;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --brand: #E9511D;
  --brand-press: #C9430F;
  --brand-soft: #FCEBE2;
  --brand-ink: #7A2E0E;
  --danger: #e23d5b;
  --danger-soft: #fdecef;
  --warn: #b8860b;
  --ok: #E9511D;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(11,18,32,.06), 0 1px 3px rgba(11,18,32,.05);
  --shadow: 0 4px 14px rgba(11,18,32,.07), 0 20px 40px rgba(11,18,32,.06);
  --shadow-lg: 0 10px 30px rgba(11,18,32,.12), 0 30px 60px rgba(11,18,32,.10);
  --ring: 0 0 0 4px rgba(233,81,29,.16);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, #fdeee6 0%, transparent 55%),
    radial-gradient(1000px 500px at -10% 0%, #fdf3ec 0%, transparent 50%),
    linear-gradient(180deg, #f7f7f8 0%, #eef0f3 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Layout ---------- */
.shell { max-width: 480px; margin: 0 auto; padding: 18px 16px 56px; min-height: 100dvh; }
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px 18px;
}
.logo {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), #F47A3E);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 6px 16px rgba(233,81,29,.32);
}
.brand-name { font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand-tag { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.brandbar { display: flex; justify-content: center; padding: 8px 0 16px; }
.brandlogo { height: 52px; width: auto; display: block; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 24px;
}
.card + .card { margin-top: 14px; }

h1 { font-size: clamp(24px, 6vw, 30px); line-height: 1.12; letter-spacing: -.03em; margin: 0 0 10px; }
h2 { font-size: 21px; letter-spacing: -.02em; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 0; }
.lead { color: var(--muted); margin: 0 0 20px; font-size: 15px; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 10px; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--brand); --fg: #fff;
  appearance: none; border: 0; cursor: pointer; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 18px; font: inherit; font-weight: 700; font-size: 16px;
  background: var(--bg); color: var(--fg); border-radius: 14px;
  box-shadow: 0 8px 20px rgba(233,81,29,.28); transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
}
.btn:hover { background: var(--brand-press); box-shadow: 0 10px 26px rgba(233,81,29,.34); }
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.secondary { --bg: transparent; --fg: var(--ink); box-shadow: none; border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { --bg: transparent; --fg: var(--brand); box-shadow: none; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { width: auto; padding: 9px 14px; font-size: 14px; border-radius: 11px; box-shadow: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }

.link { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.center { text-align: center; }

/* ---------- Inputs ---------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .prefix { position: absolute; left: 14px; color: var(--muted); font-weight: 600; font-size: 15px; pointer-events: none; }
.input {
  width: 100%; padding: 14px 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.input.has-prefix { padding-left: 42px; }
.input::placeholder { color: #aab3c0; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 7px; }

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 6px; margin: 2px 0 20px; }
.stepper .seg { height: 6px; flex: 1; border-radius: 99px; background: var(--line); overflow: hidden; }
.stepper .seg > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #F47A3E); border-radius: 99px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.stepper .seg.done > i { width: 100%; }
.stepper .seg.active > i { width: 55%; }

/* ---------- Doc checklist (landing) ---------- */
.req-list { list-style: none; margin: 0 0 22px; padding: 0; }
.req-list li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); }
.req-list li:first-child { border-top: 0; }
.req-list .ic { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-size: 15px; }
.req-list .t { font-weight: 600; font-size: 14.5px; }
.req-list .s { color: var(--muted); font-size: 13px; }

/* ---------- Upload tiles ---------- */
.tile {
  border: 1.5px dashed #cfd8e3; border-radius: var(--r); padding: 16px;
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
  background: var(--surface); transition: border-color .2s, background .2s, box-shadow .2s; position: relative;
}
.tile.drag { border-color: var(--brand); background: var(--brand-soft); }
.tile.done { border-style: solid; border-color: #f6cbb4; background: #fdf5f0; }
.tile.busy { opacity: .85; }
.tile .badge {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-soft); font-size: 19px; transition: background .2s, color .2s;
}
.tile.done .badge { background: var(--brand); color: #fff; }
.tile .meta { min-width: 0; flex: 1; }
.tile .meta .t { font-weight: 700; font-size: 14.5px; }
.tile .meta .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.done .meta .s { color: var(--brand-ink); font-weight: 600; }
.tile .act { flex: 0 0 auto; }
.tile .spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.callout { display: flex; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 14px; font-size: 13.5px; color: var(--ink-soft); margin: 4px 0 18px; }
.callout .ic { color: var(--brand); flex: 0 0 auto; }

/* ---------- Folio / acceso ---------- */
.folio-box { background: linear-gradient(135deg, #0b1220, #16243a); color: #fff; border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.folio-box .lbl { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #9fb0c4; }
.folio-box .code { font-size: 28px; font-weight: 800; letter-spacing: .04em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.copy-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.copy-row .u { flex: 1; min-width: 0; font-size: 12.5px; color: #b9c6d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(255,255,255,.07); padding: 9px 11px; border-radius: 10px; }
.copy-row .cbtn { flex: 0 0 auto; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.copy-row .cbtn:hover { background: rgba(255,255,255,.2); }

/* ---------- Summary (review) ---------- */
.summary { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 18px; }
.summary .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-top: 1px solid var(--line); }
.summary .row:first-child { border-top: 0; }
.summary .k { color: var(--muted); font-size: 13.5px; }
.summary .v { font-weight: 600; font-size: 14px; text-align: right; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; }
.pill.ok { background: var(--brand-soft); color: var(--brand-ink); }
.pill.no { background: var(--danger-soft); color: var(--danger); }

/* ---------- Timeline (status) ---------- */
.timeline { position: relative; margin: 6px 0 4px; padding-left: 6px; }
.tl { display: flex; gap: 14px; padding-bottom: 22px; position: relative; }
.tl:last-child { padding-bottom: 0; }
.tl .dot { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 13px; z-index: 1; }
.tl:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.tl.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.tl.done:not(:last-child)::before { background: var(--brand); }
.tl.active .dot { border-color: var(--brand); color: var(--brand); box-shadow: var(--ring); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(233,81,29,.18); } 50% { box-shadow: 0 0 0 6px rgba(233,81,29,.06); } }
.tl .body { padding-top: 2px; }
.tl .body .t { font-weight: 700; font-size: 15px; }
.tl.pending .body .t { color: var(--muted); font-weight: 600; }
.tl .body .s { color: var(--muted); font-size: 13px; margin-top: 1px; }

.status-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.status-head .big { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; background: var(--brand-soft); color: var(--brand); flex: 0 0 auto; }
.status-head.rej .big { background: var(--danger-soft); color: var(--danger); }

/* ---------- Success check ---------- */
.success { text-align: center; padding: 10px 0 4px; }
.check { width: 88px; height: 88px; margin: 0 auto 18px; }
.check circle { stroke: var(--brand); stroke-width: 4; fill: var(--brand-soft); stroke-dasharray: 276; stroke-dashoffset: 276; animation: draw .7s ease forwards; }
.check path { stroke: var(--brand); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .4s .55s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Misc ---------- */
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.foot .lock { font-size: 13px; }
.resume-banner { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.resume-banner .t { font-weight: 600; font-size: 14px; }
.resume-banner .s { color: var(--muted); font-size: 12.5px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(120%); background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 13px; font-size: 14px; box-shadow: var(--shadow-lg); z-index: 60; max-width: 92%; transition: transform .35s cubic-bezier(.2,.9,.3,1.2); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--brand-press); }

/* ---------- Folio chip + error en línea ---------- */
.folio-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; font-size: 13px; letter-spacing: .03em; padding: 7px 13px; border-radius: 99px; }
.folio-chip .lbl { color: var(--brand); font-weight: 600; opacity: .75; }
.field-error { color: var(--danger); font-size: 13.5px; margin: -6px 0 14px; display: flex; gap: 6px; align-items: center; }

/* Alpine transition helpers */
[x-cloak] { display: none !important; }
.fade-enter { transition: opacity .35s ease, transform .35s cubic-bezier(.2,.7,.3,1); }
.fade-enter-start { opacity: 0; transform: translateY(14px); }
.fade-enter-end { opacity: 1; transform: none; }
