/* Runrun · componentes */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

#app {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: max(16px, env(safe-area-inset-top)) var(--pad) max(20px, env(safe-area-inset-bottom));
  animation: rr-in .18s ease;
}
@keyframes rr-in { from { opacity: 0; transform: translateY(6px); } }

/* --- Tipografia --- */
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.02em; margin: 0; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.05; }
h2 { font-size: 23px; font-weight: 700; line-height: 1.1; }
h3 { font-size: 17px; font-weight: 600; }
p  { margin: 0; line-height: 1.5; color: var(--text-dim); font-size: 13.5px; }
.mono { font-family: var(--font-mono); }
.label {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint);
}
.muted { color: var(--text-dim); }
.danger-text { color: var(--danger); }

/* --- Barra superior --- */
.topbar {
  display: flex; align-items: center; gap: 12px;
  min-height: 40px; margin-bottom: 18px;
}
.topbar h3 { flex: 1; }
.iconbtn {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px; background: var(--panel);
  border: 1px solid var(--hairline);
  color: var(--text); font-size: 16px;
  display: grid; place-items: center; cursor: pointer;
}

/* --- Botones --- */
.btn {
  display: block; width: 100%; border: 0; cursor: pointer;
  font-family: var(--font-head); font-size: 15px; font-weight: 700;
  padding: 16px; border-radius: var(--r-btn);
  background: var(--accent); color: var(--on-accent);
  box-shadow: var(--shadow-accent);
  transition: transform .06s ease, opacity .15s ease;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .45; box-shadow: none; cursor: default; }
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--hairline-2); box-shadow: none; font-weight: 600;
}
.btn.link {
  background: transparent; box-shadow: none; color: var(--text-dim);
  font-family: var(--font-body); font-weight: 500; font-size: 13px; padding: 10px;
}
.btn.sm { padding: 12px; font-size: 13px; }
.btn-row { display: flex; gap: 9px; }
.btn-row .btn { flex: 1; }

/* --- Inputs --- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.input {
  width: 100%; background: var(--panel);
  border: 1px solid var(--hairline); border-radius: var(--r-btn);
  padding: 15px 14px; color: var(--text);
  font-family: var(--font-body); font-size: 14px;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--accent); border-width: 1.5px; }
.input.mono { font-family: var(--font-mono); letter-spacing: .04em; }
.phone-row { display: flex; gap: 9px; }
.phone-row .prefix {
  display: flex; align-items: center; gap: 6px; flex: none;
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--r-btn); padding: 15px 13px; font-size: 14px;
}

/* --- OTP --- */
.otp { display: flex; gap: 9px; margin: 4px 0 14px; }
.otp input {
  flex: 1; aspect-ratio: 1; min-width: 0; text-align: center;
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--r-btn); color: var(--text);
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
}
.otp input:focus { outline: none; border: 1.5px solid var(--accent); color: var(--accent); }

/* --- Tarjetas / listas --- */
.card {
  background: var(--panel); border: 1px solid var(--hairline);
  border-radius: var(--r-card); padding: 15px;
}
.card.accent { border-color: var(--accent-line); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; }
.push-bottom { margin-top: auto; }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px; border-radius: var(--r-btn);
  background: var(--panel); border: 1px solid var(--hairline);
  cursor: pointer; width: 100%; text-align: left; color: var(--text);
}
.row .ic {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  background: var(--elev); display: grid; place-items: center;
  font-size: 15px; color: var(--accent);
}
.row .tt { flex: 1; min-width: 0; }
.row .tt b { font-size: 13.5px; font-weight: 600; display: block; }
.row .tt span { font-size: 11px; color: var(--text-faint); }
.row .chev { color: var(--text-faint); font-size: 15px; }
.row.selected { border-color: var(--accent); background: var(--accent-soft); }
.row.ok .ic { color: var(--accent); background: var(--accent-soft); }
.row.pending .ic { color: var(--text-dim); }
.row.rejected { border-color: var(--danger); }
.row.rejected .ic { color: var(--danger); }

/* --- Chips de estado --- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--hairline);
}
.pill .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--accent); }
.pill.warn { border-color: var(--accent-line); }
.pill.bad { border-color: var(--danger); }
.pill.bad .dot { background: var(--danger); }

/* --- Marca / logo --- */
.brandmark {
  width: 52px; height: 52px; border-radius: 15px; background: var(--accent);
  display: grid; place-items: center;
}
.brandmark::after {
  content: ""; width: 24px; height: 13px;
  border-radius: 3px 9px 3px 3px; background: var(--on-accent);
}

/* --- Progreso wizard --- */
.steps { display: flex; gap: 5px; }
.steps i { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.1); }
.steps i.on { background: var(--accent); }

/* --- Toast --- */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--hairline-2);
  color: var(--text); padding: 12px 16px; border-radius: 12px;
  font-size: 13px; max-width: 90%; z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: var(--danger); }

/* --- Spinner --- */
.spin {
  width: 44px; height: 44px; border-radius: 99px;
  border: 3px solid rgba(255,176,32,.22); border-top-color: var(--accent);
  animation: rrspin 1s linear infinite;
}
@keyframes rrspin { to { transform: rotate(360deg); } }
.center-col { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }

/* --- Mapa placeholder --- */
.map-ph {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 2px, transparent 2px 52px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 2px, transparent 2px 58px),
    var(--panel-inset);
}
.sheet {
  position: relative; margin-top: auto;
  background: var(--panel); border-top: 1px solid var(--hairline);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding: 18px var(--pad) max(22px, env(safe-area-inset-bottom));
}
