/* style.css — pinext_pos_api factura (public self-invoicing portal)
   PI.COMMERCE — BUILD PUBLIC SELF-INVOICING PORTAL (2026-08-29).
   Mobile-first on purpose (§27: "el usuario llega principalmente
   desde teléfono") — single column, generous touch targets, no
   sidebar/desktop chrome (deliberately NOT app/static/portal/style.css,
   a different audience/device profile). */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --border: #e1e6e3;
  --text: #14231d;
  --text-muted: #5b6d64;
  --brand: #00b884;
  --brand-dark: #007a58;
  --brand-bg: #e6f8f1;
  --ok: #1a7f4b;
  --ok-bg: #e7f6ee;
  --warn: #93650b;
  --warn-bg: #fdf1da;
  --err: #b3261e;
  --err-bg: #fbe9e8;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

.shell { max-width: 460px; margin: 0 auto; padding: 20px 18px 60px; min-height: 100vh; }

.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--brand);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px;
}
.brand-name { font-weight: 700; font-size: 15px; color: var(--text); }
.brand-sub { font-size: 12px; color: var(--text-muted); }

.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps .dot { flex: 1; height: 4px; border-radius: 999px; background: var(--border); }
.steps .dot.done { background: var(--brand); }
.steps .dot.current { background: var(--brand-dark); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 20px; margin-bottom: 16px;
}

h1 { font-size: 21px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 14px; }
p.lede { color: var(--text-muted); margin: 0 0 18px; font-size: 14.5px; }

.receipt-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.receipt-row:last-child { border-bottom: none; }
.receipt-row .k { color: var(--text-muted); }
.receipt-row .v { font-weight: 600; }
.receipt-row.total .v { font-size: 18px; color: var(--brand-dark); }

.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.field .hint { color: var(--text-muted); font-size: 12.5px; margin-top: 5px; }
.field .error { color: var(--err); font-size: 12.5px; margin-top: 5px; font-weight: 600; }
input, select {
  font: inherit; font-size: 16px; padding: 12px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  width: 100%; background: var(--surface); color: var(--text);
}
input:focus, select:focus { outline: none; border-color: var(--brand); }
input.invalid, select.invalid { border-color: var(--err); }

.warning-box {
  background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 12px 14px;
  font-size: 13px; margin-bottom: 18px; line-height: 1.4;
}

button.primary {
  font: inherit; font-size: 16px; font-weight: 700; width: 100%; padding: 15px;
  background: var(--brand); color: #fff; border: none; border-radius: 12px; cursor: pointer;
}
button.primary:hover { background: var(--brand-dark); }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.secondary {
  font: inherit; font-size: 14.5px; font-weight: 600; width: 100%; padding: 13px; margin-top: 10px;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer;
}
button.secondary:hover { background: #f2f4f3; }

.status-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; margin-bottom: 16px;
}
.status-badge.ok { background: var(--ok-bg); color: var(--ok); }
.status-badge.warn { background: var(--warn-bg); color: var(--warn); }
.status-badge.err { background: var(--err-bg); color: var(--err); }
.status-badge.brand { background: var(--brand-bg); color: var(--brand-dark); }
.status-badge .dot-ping { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }

.spinner {
  width: 34px; height: 34px; border-radius: 999px; border: 3px solid var(--border);
  border-top-color: var(--brand); margin: 8px auto 18px; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center { text-align: center; }
.doc-links { display: flex; gap: 10px; margin-top: 4px; }
.doc-links a {
  flex: 1; text-align: center; padding: 12px; border-radius: 10px; border: 1.5px solid var(--border);
  color: var(--text); font-weight: 700; font-size: 13.5px; text-decoration: none;
}
.doc-links a:hover { background: #f2f4f3; }

.toast {
  position: fixed; left: 18px; right: 18px; bottom: 18px; background: var(--text); color: #fff;
  padding: 12px 16px; border-radius: 10px; font-size: 13.5px; z-index: 50; text-align: center;
}
.toast.err { background: var(--err); }

.footer-note { text-align: center; color: var(--text-muted); font-size: 11.5px; margin-top: 24px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1613; --surface: #172420; --border: #263832; --text: #eef4f1; --text-muted: #93a89d;
    --brand-bg: #143a2e; --ok-bg: #123626; --warn-bg: #3a2c0f; --err-bg: #3a1614;
  }
}
