:root {
  --ink: #14181f;
  --muted: #5a6270;
  --line: #e3e6eb;
  --brand: #e8500a;
  --brand-ink: #ffffff;
  --bg: #f7f8fa;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Roboto", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.pheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
body.has-hero .pheader {
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  position: absolute;
  top: 0; left: 0; right: 0;
}
.pbrand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.pbrand img { height: 40px; width: auto; display: block; }
.pbrand-label {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: 0.3px;
}
body.has-hero .pbrand-label { color: #fff; }
.pnav { display: flex; align-items: center; gap: 16px; font-size: 0.95rem; }
.pnav a { color: var(--brand); text-decoration: none; font-weight: 600; }
.pnav a:hover { text-decoration: underline; }
body.has-hero .pnav a { color: #fff; }
body.has-hero .pnav a.pnav-cta {
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 9px 20px;
  border-radius: 3px;
  text-decoration: none;
}
body.has-hero .pnav a.pnav-cta:hover { border-color: #fff; }
.pwho { color: var(--muted); }
body.has-hero .pwho { color: rgba(255, 255, 255, 0.75); }
.pmain { max-width: 720px; margin: 0 auto; padding: 64px 24px; }
body.has-hero .pmain { max-width: none; margin: 0; padding: 0; }

/* Hero — same background photo and treatment as powertrainreman.com's home page */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 48px;
  color: #fff;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(12, 12, 11, 0.92) 30%, rgba(0, 0, 0, 0.35) 80%),
              url("/static/images/hero.jpg") center / cover no-repeat;
  z-index: 0;
}
.hero-content { position: relative; z-index: 1; max-width: 560px; }
.hero-headline {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 900;
  font-size: 4rem;
  line-height: 0.95;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 20px;
}
.hero-headline em { color: var(--brand); font-style: normal; }
.hero-sub {
  font-family: "Roboto", sans-serif;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 480px;
  line-height: 1.5;
  margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 16px; }
.pt-btn {
  display: inline-block;
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 36px;
  border-radius: 3px;
}
.pt-btn-primary { background: var(--brand); color: #fff; }
.pt-btn-primary:hover { background: #cf4409; }
.pt-btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.pt-btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.pt-btn-sm { padding: 9px 18px; font-size: 0.82rem; }
.hero-hint { margin-top: 20px; font-size: 0.9rem; color: rgba(255, 255, 255, 0.65); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 32px;
}
.card h1 { font-family: "Roboto Condensed", sans-serif; font-weight: 700; font-size: 1.5rem; margin-top: 0; }
.hint { font-size: 0.9rem; color: var(--muted); margin-top: 16px; }

@media (max-width: 640px) {
  .hero { padding: 100px 24px 48px; }
  .hero-headline { font-size: 2.75rem; }
}

/* My account */
.acct { max-width: 960px; margin: 0 auto; }
.acct-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.acct-head .pt-btn { padding: 12px 24px; flex-shrink: 0; }
.acct-h1 { font-family: "Roboto Condensed", sans-serif; font-weight: 700; font-size: 1.8rem; margin-bottom: 4px; }
.acct-sub { color: var(--muted); margin: 0; }
.acct-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.acct-kpi { padding: 20px 22px; }
.acct-kpi-lbl { color: var(--muted); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.acct-kpi-val { font-family: "Roboto Condensed", sans-serif; font-weight: 800; font-size: 1.7rem; margin-top: 4px; }
.acct-section { margin-bottom: 20px; }
.acct-section h2 { font-family: "Roboto Condensed", sans-serif; font-weight: 700; font-size: 1.1rem; margin: 0 0 14px; }
.acct-grid { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.acct-grid th, .acct-grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.acct-grid th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; }
.acct-grid .mono { font-family: "SFMono-Regular", Consolas, monospace; }
.acct-muted { color: var(--muted); font-size: 0.85rem; }
.acct-r { text-align: right; }
.acct-row-link { cursor: pointer; }
.acct-row-link:hover { background: var(--bg); }
.acct-grid a { color: inherit; text-decoration: none; }
.acct-grid a:hover { color: var(--brand); text-decoration: underline; }
.acct-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.acct-pill-approved { background: #e3f3e8; color: #1f7a43; }
.acct-pill-denied { background: #fbe8e6; color: #c62828; }
.acct-pill-info, .acct-pill-open { background: #fdf3d3; color: #9a6700; }
.acct-flash { border-radius: 6px; padding: 12px 16px; margin-bottom: 20px; font-size: 0.92rem; }
.acct-flash-ok { background: #e3f3e8; color: #1f7a43; border: 1px solid #bfe3cb; }
.acct-flash-err { background: #fdecea; color: #b7202e; border: 1px solid #f3c6c2; }

/* Order / VIN lookup */
.ord { max-width: 880px; margin: 0 auto; }
.ord h1 { font-family: "Roboto Condensed", sans-serif; font-weight: 700; font-size: 1.8rem; margin-bottom: 4px; }
.ord-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  margin: 20px 0 32px;
}
.ord-row { margin-bottom: 12px; }
.ord-row label { display: block; font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.ord-row input, .ord-row select {
  display: block;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 1rem;
  width: 100%;
}
.ord-row-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.ord-row-grid label { flex: 1; min-width: 100px; }
.ord-or { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 8px 0; }
.ord-error {
  background: #fdecea;
  color: #b7202e;
  border: 1px solid #f3c6c2;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
}
.ord-vehicle { font-size: 1.1rem; margin-bottom: 8px; }
.ord-vin { color: var(--muted); font-size: 0.85rem; margin-left: 10px; }
.ord-vehicle-detail { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.ord-why { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
.ord-option {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.ord-option-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.ord-tnum { font-family: "Roboto Condensed", sans-serif; font-weight: 700; font-size: 1.2rem; }
.ord-fam { color: var(--muted); }
.ord-core { font-size: 0.9rem; color: var(--muted); margin-bottom: 12px; }
.ord-grid { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ord-grid th, .ord-grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.ord-grid th { color: var(--muted); font-weight: 600; }
.ord-avail { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.ord-avail-ship { background: #e3f3e8; color: #1f7a43; }
.ord-avail-build { background: #e6eef8; color: #2e5c9a; }
.ord-avail-core { background: #fdf3d3; color: #9a6700; }
.ord-avail-note { font-size: 0.72rem; color: var(--muted); margin-top: 2px; }
.ord-buy { color: var(--brand); font-weight: 700; text-decoration: none; }
.ord-buy:hover { text-decoration: underline; }

/* --- installable app (portal/pwa.py, static/pwa.js) --- */
.install-banner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1100; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 10px 12px; font-size: 14px; }
.install-banner .ib-text { flex: 1; }
.install-banner button { min-height: 40px; font: inherit; cursor: pointer; }
.install-banner .ib-go { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 4px; padding: 0 16px; font-weight: 600; }
.install-banner .ib-x { background: transparent; color: var(--muted); border: 0; padding: 2px 8px; font-size: 18px; }
html.is-pwa .pheader { padding-top: calc(16px + env(safe-area-inset-top)); }
html.is-pwa body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

/* --- phone-sized portal pages --- */
@media (max-width: 640px) {
  .pheader { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .pnav { flex-wrap: wrap; gap: 10px; }
  .pmain { padding-left: 0; padding-right: 0; }
  table.acct-grid { display: block; overflow-x: auto; }
}

/* --- warranty certificate photos --- */
.cert-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.cert-shot { border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; font-size: 12px; color: var(--muted); }
.cert-shot img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; display: block; background: #eee; }
.cert-shot .pdf { height: 110px; display: flex; align-items: center; justify-content: center; font-weight: 700; background: #f0f1f4; border-radius: 4px; color: var(--ink); }
.cert-drop { border: 2px dashed var(--line); border-radius: 8px; padding: 18px; background: #fff; margin: 12px 0; }
.cert-drop .pt-btn { min-height: 48px; font-size: 1rem; }
.cert-tips li { margin: 4px 0; }
