/* app.css — shared styles for the bidit customer app (production brand). */
:root {
  --navy: #072a52;
  --navy-deep: #010d1f;
  --navy-hover: #0a3568;
  --blue: #008eff;
  --blue-hover: #0077db;
  --blue-tint: #e6f4ff;
  --blue-tint-2: #f2f9ff;
  --text: #0b1f3a;
  --muted: #5a6b7d;
  --faint: #8494a4;
  --border: #d7e2ee;
  --white: #ffffff;
  --paper: #f5f8fc;
  --ok: #1f9d57;
  --ok-bg: #e7f6ee;
  --warn: #c47a00;
  --shadow-lg: 0 24px 60px rgba(7, 42, 82, 0.14);
  --shadow-sm: 0 6px 20px rgba(7, 42, 82, 0.08);
  --radius: 14px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word; /* long URLs/words never force horizontal scroll */
}
a { text-decoration: none; color: inherit; }
/* Media never overflows its container on any screen size. */
img, svg, video, canvas { max-width: 100%; }
.container { width: min(1120px, 92%); margin: 0 auto; }
.container-narrow { width: min(720px, 92%); margin: 0 auto; }

/* ---- Logo ---- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo svg { display: block; height: 32px; width: auto; }
.logo .wordmark { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.04em; color: var(--navy); }

/* ---- Header ---- */
header.app {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.app .nav { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-right { display: flex; align-items: center; gap: 16px; font-weight: 600; font-size: 0.94rem; }
.nav-right .who { color: var(--muted); }
.nav-msg { color: var(--navy); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav-msg:hover { color: var(--blue); }
.nav-pip { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 0.7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* ---- Buttons ---- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 700; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.button-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 22px rgba(0, 142, 255, 0.3); }
.button-primary:hover:not(:disabled) { background: var(--blue-hover); }
.button-navy { background: var(--navy); color: #fff; }
.button-navy:hover:not(:disabled) { background: var(--navy-hover); }
.button-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.button-ghost:hover { border-color: var(--blue); color: var(--blue); }
.button-lg { padding: 16px 30px; font-size: 1.05rem; border-radius: 12px; }
.button-block { width: 100%; }

/* ---- Page scaffolding ---- */
.page { padding: 44px 0 80px; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.03em; color: var(--navy); margin: 0 0 8px; font-weight: 800; }
.page .sub { color: var(--muted); margin: 0 0 28px; font-size: 1.08rem; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-hover); font-weight: 700; margin: 0 0 10px; }

/* ---- Cards ---- */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px; }
.card + .card { margin-top: 18px; }

/* ---- Forms ---- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 0.92rem; color: var(--navy); margin-bottom: 7px; }
.field .hint { font-weight: 400; color: var(--faint); font-size: 0.85rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], textarea, select {
  width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 1rem; font-family: inherit; color: var(--text); background: var(--white); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 142, 255, 0.14); }
textarea { min-height: 120px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---- Badges / pills ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge-verified { background: var(--ok-bg); color: var(--ok); }
.badge-featured { background: var(--blue-tint); color: var(--blue-hover); }
.badge svg { width: 13px; height: 13px; }
.stars { color: #f5a623; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }
.stars svg { width: 15px; height: 15px; fill: #f5a623; }

/* ---- Steps / progress ---- */
.progress { display: flex; gap: 8px; margin-bottom: 28px; }
.progress .seg { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.progress .seg.on { background: var(--blue); }

/* ---- Job status pipeline ----
   The requirements' governing principle, rendered. 12 stages never fit as
   horizontal labels on a phone, so the bar stays abstract (one segment per
   stage) and the named detail expands as a vertical list on every screen. */
.pipeline {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px;
}
.pipeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pipeline-head b { color: var(--navy); font-size: 1.05rem; }
.pipeline-count { color: var(--faint); font-size: 0.78rem; font-weight: 600; margin-left: 8px; white-space: nowrap; }
.pipeline-toggle {
  background: none; border: none; padding: 0; cursor: pointer; font-family: inherit;
  color: var(--blue-hover); font-weight: 700; font-size: 0.82rem; white-space: nowrap; flex: none;
}
.pipeline-toggle:hover { text-decoration: underline; }
.pipeline-bar { display: flex; gap: 4px; }
.pipeline-bar .seg { flex: 1; height: 6px; border-radius: 3px; background: var(--border); }
.pipeline-bar .seg.done { background: var(--ok); }
.pipeline-bar .seg.on { background: var(--blue); box-shadow: 0 0 0 3px rgba(0, 142, 255, 0.18); }
/* Skipped reads as absent, not achieved — the escrow stage really didn't run. */
.pipeline-bar .seg.skipped { background: repeating-linear-gradient(90deg, var(--border) 0 3px, transparent 3px 6px); }
.pipeline-note { margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; }
.pipeline-steps { list-style: none; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); }
.pipeline-step { display: flex; flex-direction: column; padding: 7px 0 7px 22px; position: relative; font-size: 0.88rem; }
.pipeline-step::before {
  content: ""; position: absolute; left: 0; top: 12px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--border);
}
.pipeline-step b { color: var(--faint); font-weight: 700; }
.pipeline-step span { color: var(--faint); font-size: 0.82rem; }
.pipeline-step.done::before { background: var(--ok); }
.pipeline-step.done b { color: var(--navy); }
.pipeline-step.on::before { background: var(--blue); box-shadow: 0 0 0 3px rgba(0, 142, 255, 0.18); }
.pipeline-step.on b { color: var(--blue-hover); }
.pipeline-step.on span { color: var(--muted); }
.pipeline-step.skipped::before { background: transparent; border: 1.5px dashed var(--faint); }
.pipeline-step.skipped b { text-decoration: line-through; }
/* Flat variant: draft / cancelled / disputed have no position to show. */
.pipeline-flat b { color: var(--navy); font-size: 1.05rem; }
.pipeline-flat .pipeline-note { margin-top: 4px; }
.pipeline-warn { background: #fff8ea; border-color: #f0d9a8; }
.pipeline-warn b { color: var(--warn); }

@media (max-width: 480px) {
  .pipeline { padding: 16px; }
  .pipeline-head { flex-wrap: wrap; }
  .pipeline-bar .seg { height: 5px; }
  .pipeline-bar { gap: 3px; }
}

/* ---- Empty / status states ---- */
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 12px; }
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.notice { padding: 12px 16px; border-radius: 10px; font-size: 0.95rem; margin-bottom: 16px; }
.notice-err { background: #fbeae6; color: #c0392b; }
.notice-ok { background: var(--ok-bg); color: var(--ok); }

/* ---- Footer ---- */
footer.app { background: var(--navy-deep); color: #a9bdd4; padding: 30px 0; margin-top: 40px; }
footer.app .footer-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.9rem; }
footer.app .logo .wordmark { color: #fff; }

/* ----------------------------------------------------------------------
   Responsive breakpoints — every bidit page must work across all four.
   Desktop        > 1024px
   Tablet         641–1024px  (portrait tablets, phone landscape on large phones)
   Mobile landsc. 481–640px
   Mobile portr.  <= 480px
   Prefer fluid containers (min()) and auto-fit grids over hard breakpoints;
   these rules cover the cases that need explicit help.
   ---------------------------------------------------------------------- */

/* Tablet and below */
@media (max-width: 1024px) {
  .app .nav { height: 64px; }
}

/* Mobile landscape and below */
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .nav-right .who { display: none; }
  .page { padding: 34px 0 64px; }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .container, .container-narrow { width: 90%; }
  .card { padding: 20px; }
  .button-lg { padding: 14px 22px; font-size: 1rem; }
  .nav-right { gap: 10px; font-size: 0.9rem; }
  .page h1 { font-size: 1.7rem; }
}

/* ============================================================
   Role-aware app nav (rendered by mountNav in bidit.js).
   Customer = navy default. Provider = blue accent + "for providers" badge.
   ============================================================ */

.nav-desktop { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: var(--navy); font-weight: 600; padding: 8px 11px; border-radius: 9px;
  white-space: nowrap; line-height: 1;
}
.nav-link:hover { color: var(--blue); }
.nav-link.active { color: var(--navy); background: rgba(7, 42, 82, 0.06); font-weight: 700; }

/* Provider theming */
header.app.providing { border-bottom-color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
header.app.providing .nav-link.active { color: var(--blue-hover); background: var(--blue-tint); }
.mode-badge {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.01em; white-space: nowrap;
  color: var(--blue-hover); background: var(--blue-tint);
  padding: 3px 8px; border-radius: 6px; margin-left: 4px;
}

/* Account avatar + dropdown */
.acct { position: relative; display: inline-flex; }
.acct-btn { border: 0; background: none; padding: 0; margin: 0; cursor: pointer; border-radius: 50%; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 800; color: #fff; background: var(--navy);
  box-shadow: 0 0 0 1px var(--border);
}
header.app.providing .avatar { background: var(--blue); }
.acct-btn:hover .avatar, .acct-btn:focus-visible .avatar { box-shadow: 0 0 0 3px var(--blue-tint); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 12px); width: 244px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 20px 50px rgba(7, 42, 82, 0.18); overflow: hidden; z-index: 30;
}
.acct-head, .mp-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.acct-head b, .mp-head b { display: block; color: var(--navy); }
.acct-email { color: var(--muted); font-size: 0.78rem; font-weight: 500; word-break: break-all; }
.acct-item {
  display: block; width: 100%; text-align: left; padding: 12px 14px;
  background: none; border: 0; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer;
}
.acct-item:hover { background: var(--blue-tint-2); color: var(--blue-hover); }

/* Hamburger + mobile slide-down panel (hidden on desktop) */
.hamburger {
  display: none; width: 42px; height: 40px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.hamburger i { width: 18px; height: 2px; border-radius: 2px; background: var(--navy); display: block; }
.nav-mobile-panel {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(7, 42, 82, 0.18); padding: 8px; z-index: 25;
}
.nav-mobile-panel .mp-head { margin-bottom: 6px; }
.nav-mobile-panel .nav-link { display: block; padding: 13px 14px; border-radius: 10px; font-size: 1rem; }
.mp-signout { border-top: 1px solid var(--border); margin-top: 6px; color: var(--muted); }

/* Show the mobile nav, hide the desktop nav, at tablet width and below */
@media (max-width: 720px) {
  .nav-desktop, .acct { display: none; }
  .hamburger { display: inline-flex; }
  .nav-mobile-panel.open { display: flex; flex-direction: column; }
}
