/* ═══════════════════════════════════════════════════════════
   RoofIgnite Client Portal v2 — pay-per-appointment credit model
   Design goals (from the Aug 31 call):
   - readable by someone who has never heard a marketing term
   - credits are the entire mental model: always visible
   - light, consumer-grade feel (Thumbtack/Angi energy),
     NOT an ops dashboard
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #1c2430;
  --ink-soft:   #5a6675;
  --ink-faint:  #8b95a3;
  --paper:      #f7f5f1;
  --card:       #ffffff;
  --line:       #e7e2da;
  --line-soft:  #f0ece5;

  --flame:      #e8590c;
  --flame-dark: #c94b08;
  --flame-soft: #fdf0e7;
  --flame-line: #f6d9c4;

  --good:       #1f8a4c;
  --good-soft:  #e8f5ee;
  --warn:       #b7791f;
  --warn-soft:  #fdf6e7;
  --bad:        #c2402f;
  --bad-soft:   #fbeae7;
  --info:       #2b6cb0;
  --info-soft:  #e9f1fa;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(28,36,48,0.05), 0 4px 16px rgba(28,36,48,0.05);
  --shadow-lift: 0 2px 4px rgba(28,36,48,0.06), 0 10px 32px rgba(28,36,48,0.10);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* one-page layout: anchored sections clear the sticky nav */
section[id] { scroll-margin-top: 118px; }
.section-block { margin-top: 64px; }
.section-kicker {
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--flame); margin-bottom: 4px;
}

/* section header band — dark like the nav, so it's unmistakable where you are */
.section-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: #0b0b0c; color: #fff;
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 20px;
}
.section-ico {
  flex: none; width: 48px; height: 48px; border-radius: 13px;
  background: linear-gradient(135deg, #f6c453, #ca8a04);
  display: flex; align-items: center; justify-content: center; font-size: 23px;
}
.section-head .t { font-size: 23px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.2; }
.section-head .s { font-size: 13.5px; color: #9aa4b0; margin-top: 3px; line-height: 1.5; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ═══ Top nav — black banner, white wordmark ═══ */
.topnav {
  background: #0b0b0c;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky; top: 0; z-index: 100;
}
.topnav-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 8px; height: 62px;
}
.brand { display: flex; align-items: center; gap: 9px; margin-right: 18px; }
/* the real RoofIgnite wordmark (assets/roofignite-wordmark-dark.png = black ROOF for light backgrounds) */
.brand-img { height: 34px; width: auto; display: block; }

/* admin-only account switcher, top-left next to the wordmark */
.admin-switch {
  background: rgba(255,255,255,0.08); color: #f6c453;
  border: 1px solid rgba(246,196,83,0.35); border-radius: 9px;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  padding: 6px 8px; max-width: 180px; margin-right: 10px; cursor: pointer;
}
.admin-switch:hover { background: rgba(255,255,255,0.14); }
.admin-switch option { color: #1c2430; background: #fff; font-weight: 600; }

.nav-links { display: flex; gap: 2px; }
.nav-link {
  padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 600;
  color: #9aa4b0; transition: all .15s; white-space: nowrap;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.active { background: rgba(246,196,83,0.14); color: #f6c453; }

.nav-spacer { flex: 1; }

/* "coming soon" tag — gold, used in the nav and on section titles */
.soon-tag {
  display: inline-block; background: #f6c453; color: #0b0b0c;
  font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; vertical-align: 2px; margin-left: 5px;
}

/* red count bubble on the Appointments link */
.nav-dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 800; vertical-align: 1px;
}

/* the feedback hammer — site-wide bar whenever feedback is owed */
.feedback-bar {
  display: block; text-align: center;
  background: linear-gradient(90deg, var(--flame), #f08c38);
  color: #fff; font-size: 13.5px; padding: 10px 18px; line-height: 1.5;
}
.feedback-bar b { font-weight: 800; }
.feedback-bar .fb-cta {
  font-weight: 800; text-decoration: underline; white-space: nowrap; margin-left: 4px;
}
.feedback-bar:hover { filter: brightness(1.05); }

/* the credit pill — always on screen, the core mental model */
.credit-pill {
  display: flex; align-items: center; gap: 8px;
  background: #fff; color: var(--ink);
  border-radius: 999px; padding: 7px 16px 7px 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .15s; white-space: nowrap;
}
.credit-pill:hover { transform: translateY(-1px); }
.credit-pill .coin {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, #f6c453, #e8940c);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.credit-pill.low { background: var(--bad); color: #fff; }
.credit-pill small { font-weight: 500; opacity: .65; font-size: 12px; }

/* hamburger — mobile only */
.nav-burger {
  display: none; flex-direction: column; justify-content: center; gap: 4.5px;
  width: 40px; height: 40px; border: none; border-radius: 9px;
  background: transparent; cursor: pointer; padding: 0 9px;
}
.nav-burger span {
  display: block; height: 2.5px; border-radius: 2px; background: #fff;
  transition: transform .2s, opacity .2s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* dropdown panel the hamburger opens */
.mobile-menu { display: none; }

.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--flame-soft); color: var(--flame-dark);
  border: 1px solid var(--flame-line);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; margin-left: 10px; cursor: pointer;
}

/* ═══ Page scaffold ═══ */
.page { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { color: var(--ink-soft); margin-top: 4px; font-size: 15px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* ═══ Buttons ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 700; padding: 11px 20px;
  transition: all .15s;
}
.btn-primary { background: var(--flame); color: #fff; }
.btn-primary:hover { background: var(--flame-dark); transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2c3a4d; }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-big { padding: 14px 26px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ═══ Badges ═══ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-good  { background: var(--good-soft);  color: var(--good); }
.badge-warn  { background: var(--warn-soft);  color: var(--warn); }
.badge-bad   { background: var(--bad-soft);   color: var(--bad); }
.badge-info  { background: var(--info-soft);  color: var(--info); }
.badge-flame { background: var(--flame-soft); color: var(--flame-dark); }
.badge-gray  { background: var(--line-soft);  color: var(--ink-soft); }

/* ═══ Forms ═══ */
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field-hint { font-size: 12px; color: var(--ink-faint); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: #fff; outline: none; transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--flame); }
.textarea { resize: vertical; min-height: 90px; }

/* toggle switch */
.toggle { position: relative; width: 46px; height: 26px; flex: none; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #d5cec3; transition: background .2s;
}
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s;
}
.toggle input:checked + .toggle-track { background: var(--good); }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }

/* ═══ Tables ═══ */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ═══ Modal ═══ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(28,36,48,0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lift);
  width: 100%; max-width: 460px; padding: 26px;
  max-height: 90vh; overflow-y: auto;
}
.modal-title { font-size: 18px; font-weight: 800; }

/* ═══ Toast ═══ */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 12px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lift);
  z-index: 600; opacity: 0; transition: all .25s; pointer-events: none;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══ Progress / tracker (Domino's-style) ═══ */
.tracker { display: flex; gap: 0; }
.tracker-step { flex: 1; text-align: center; position: relative; padding-top: 34px; }
.tracker-dot {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--line); color: var(--ink-faint);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; z-index: 2;
}
.tracker-step::before {
  content: ''; position: absolute; top: 12px; left: -50%; width: 100%; height: 3px;
  background: var(--line); z-index: 1;
}
.tracker-step:first-child::before { display: none; }
.tracker-step.done .tracker-dot { background: var(--good); color: #fff; }
.tracker-step.done::before { background: var(--good); }
.tracker-step.current .tracker-dot {
  background: var(--flame); color: #fff;
  box-shadow: 0 0 0 5px var(--flame-soft);
  animation: pulse 2s infinite;
}
.tracker-step.current::before { background: var(--good); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 5px var(--flame-soft); }
  50% { box-shadow: 0 0 0 9px var(--flame-soft); }
}
.tracker-label { font-size: 12px; font-weight: 700; }
.tracker-sub { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.tracker-step.pending .tracker-label { color: var(--ink-faint); }

/* thin progress bar */
.bar { height: 9px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--flame); transition: width .4s; }
.bar-fill.good { background: var(--good); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }

/* ═══ Responsive ═══ */
@media (max-width: 760px) {
  .topnav-inner { padding: 0 10px; height: 56px; gap: 6px; }
  .brand { margin-right: 6px; }
  .brand-img { height: 26px; }
  .nav-links { display: none; }           /* links collapse into the hamburger */
  .nav-burger { display: flex; }
  .admin-switch { max-width: 110px; font-size: 11.5px; padding: 5px 6px; margin-right: 6px; }
  .credit-pill { padding: 5px 10px 5px 7px; font-size: 12.5px; gap: 5px; }
  .credit-pill .coin { width: 16px; height: 16px; font-size: 9px; }
  .credit-pill small { display: none; }
  .nav-avatar { display: none; }
  .mobile-menu.open {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 10px 12px; border-top: 1px solid rgba(255,255,255,0.08);
  }
  .mobile-menu .nav-link { padding: 12px 14px; font-size: 15px; border-radius: 10px; }
  .page { padding: 20px 14px 70px; }
  .page-title { font-size: 22px; }
  .section-block { margin-top: 44px; }
  .section-head { padding: 16px 18px; gap: 13px; }
  .section-ico { width: 40px; height: 40px; border-radius: 11px; font-size: 19px; }
  .section-head .t { font-size: 19px; }
  .section-head .s { font-size: 12.5px; }
  .mobile-hide { display: none !important; }
}
