/* ServPro – one stylesheet for the public site, the business app and the owner admin */
:root {
  --asphalt: #16202b;     /* dark text, sidebar */
  --asphalt-2: #223040;
  --signal: #ffc21a;      /* safety yellow – main call to action */
  --signal-dk: #e6a800;
  --cable: #1f5fbf;       /* links, primary in app */
  --brand: #1f5fbf;       /* overridden per company */
  --concrete: #eef0f2;    /* page background */
  --paper: #ffffff;
  --line: #d9dee4;
  --muted: #5d6b7a;
  --green: #2f8f5b; --red: #c7362f; --amber: #b7791f; --purple: #6b46c1;
  --radius: 10px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-cond: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--asphalt); background: var(--concrete); }
img { max-width: 100%; height: auto; }
a { color: var(--cable); }
h1, h2, h3, h4 { font-family: var(--font-cond); font-weight: 700; line-height: 1.1; letter-spacing: .005em; margin: 0 0 .5em; }
h1 { font-size: 2rem; } h2 { font-size: 1.6rem; } h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
code { background: var(--concrete); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.ic { vertical-align: -3px; flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .45em; justify-content: center; font: 600 1rem/1 var(--font);
  padding: .75em 1.15em; border-radius: 8px; border: 1px solid transparent; background: var(--brand); color: #fff; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn-signal { background: var(--signal); color: var(--asphalt); } .btn-signal:hover { background: var(--signal-dk); filter: none; }
.btn-ghost { background: transparent; color: var(--asphalt); border-color: var(--line); } .btn-ghost:hover { background: var(--concrete); filter: none; }
.btn-light { background: var(--paper); color: var(--asphalt); border-color: var(--line); } .btn-light:hover { background: var(--concrete); filter: none; }
.btn-danger { background: var(--red); } .btn-green { background: var(--green); }
.btn-sm { font-size: .875rem; padding: .5em .8em; } .btn-lg { font-size: 1.1rem; padding: .9em 1.5em; }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--cable); font: inherit; cursor: pointer; text-decoration: underline; }
.linkbtn.danger { color: var(--red); }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .9rem; }
label .hint { font-weight: 400; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; font: 400 1rem var(--font); color: var(--asphalt);
  padding: .65em .75em; border: 1px solid #c5ccd4; border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; margin: 0 .4em 0 0; vertical-align: -2px; }
textarea { min-height: 90px; resize: vertical; }
.check { font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }

/* ---------- Alerts & pills ---------- */
.alert { padding: .8rem 1rem; border-radius: 8px; margin: 0 0 1rem; border: 1px solid; }
.alert-ok { background: #e8f5ee; border-color: #b9e0c9; color: #1d5c3a; }
.alert-err { background: #fdecea; border-color: #f3c0bb; color: #8a231d; }
.alert-warn { background: #fff6dc; border-color: #f4d98a; color: #6b4e00; }
.alert-info { background: #e9f1fc; border-color: #bcd3f2; color: #173f7a; }
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: .2em .65em; border-radius: 999px; white-space: nowrap; }
.pill-grey { background: #e7eaee; color: #4a5562; } .pill-blue { background: #e1ecfb; color: #1a4f9c; }
.pill-green { background: #dff3e7; color: #1f6b42; } .pill-red { background: #fbe3e1; color: #9b2a24; }
.pill-amber { background: #fff1cc; color: #7a5300; } .pill-purple { background: #ece4fb; color: #55339c; }

/* ---------- Cards, tables ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card-head h2, .card-head h3 { margin: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: .85rem; padding: .6rem .7rem; border-bottom: 2px solid var(--line); white-space: nowrap; }
.t td { padding: .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t tbody tr:hover td { background: #f8fafb; }
.t a.rowlink { color: inherit; text-decoration: none; font-weight: 600; }
.t a.rowlink:hover { color: var(--brand); text-decoration: underline; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .btn { margin-top: .8rem; }

/* ---------- Auth pages ---------- */
.auth-bg { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 40px; background: var(--concrete); }
.auth-card { width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; }
.auth-card .brandmark { display: inline-flex; margin-bottom: 1.25rem; }
.checks { list-style: none; padding: 0; } .checks li { padding: .2rem 0; } .checks .yes { color: var(--green); } .checks .no { color: var(--red); font-weight: 600; }
.slug-preview { font-size: .875rem; color: var(--muted); margin-top: -.6rem; margin-bottom: .9rem; }
.slug-preview b { color: var(--asphalt); }

/* ---------- Brand mark ---------- */
.brandmark { display: flex; align-items: center; gap: .5rem; font: 700 1.45rem/1 var(--font-cond); color: inherit; text-decoration: none; letter-spacing: .01em; }
.brandmark .mk { width: 30px; height: 30px; border-radius: 7px; background: var(--signal); color: var(--asphalt); display: grid; place-items: center; }

/* =====================================================================
   PUBLIC SITE
   ===================================================================== */
.site { background: var(--paper); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(6px); }
.nav .wrap { display: flex; align-items: center; gap: 1.5rem; height: 66px; }
.nav .links { display: flex; gap: 1.4rem; margin-left: auto; align-items: center; }
.nav .links a { color: var(--asphalt); text-decoration: none; font-weight: 500; }
.nav .links a:hover { color: var(--cable); }
.nav .links .btn { color: var(--asphalt); }
@media (max-width: 760px) { .nav .links .hide-sm { display: none; } .nav .links { gap: .8rem; } }

.hero { background: var(--asphalt); color: #fff; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; padding-top: 4.5rem; padding-bottom: 4.5rem; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: .98; margin-bottom: 1.2rem; letter-spacing: -.005em; }
.hero p.lead { font-size: 1.2rem; color: #c9d3de; max-width: 34em; margin-bottom: 2rem; }
.hero .cta { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.hero .cta .note { color: #9fb0c2; font-size: .95rem; }
.hero .btn-ghost { color: #fff; border-color: #3b4d61; } .hero .btn-ghost:hover { background: var(--asphalt-2); }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; padding-top: 3rem; padding-bottom: 3.5rem; } }

/* The job card in the hero – the one bold moment */
.jobcard-demo { position: relative; background: #fff; color: var(--asphalt); border-radius: 14px; padding: 1.4rem 1.4rem 1.2rem; box-shadow: 0 30px 60px -20px rgba(0,0,0,.55); transform: rotate(1.2deg); max-width: 440px; justify-self: center; width: 100%; }
.jobcard-demo::before { content: ""; position: absolute; left: -18px; right: -18px; top: -14px; height: 26px; transform: rotate(-2.5deg);
  background: repeating-linear-gradient(-45deg, var(--signal) 0 18px, var(--asphalt) 18px 36px); border-radius: 3px; box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.jobcard-demo .jc-top { display: flex; justify-content: space-between; align-items: baseline; margin: .6rem 0 .2rem; }
.jobcard-demo .jc-no { font: 700 1.35rem var(--font-cond); }
.jobcard-demo .jc-meta { color: var(--muted); font-size: .9rem; margin-bottom: .9rem; }
.jobcard-demo .jc-timer { display: flex; align-items: center; justify-content: space-between; background: #f3f6f9; border-radius: 9px; padding: .6rem .8rem; margin-bottom: .9rem; }
.jobcard-demo .jc-timer b { font: 700 1.5rem var(--font-cond); font-variant-numeric: tabular-nums; }
.jobcard-demo .jc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: .4rem; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.jobcard-demo ul { list-style: none; padding: 0; margin: 0 0 .9rem; font-size: .95rem; }
.jobcard-demo li { display: flex; justify-content: space-between; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.jobcard-demo .jc-sign { font: italic 1.4rem/1 "Brush Script MT", cursive; color: var(--cable); border-bottom: 1px solid var(--asphalt); padding-bottom: .2rem; margin-bottom: .2rem; }
.jobcard-demo .jc-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: 1rem; }

.section { padding: 5rem 0; }
.section-alt { background: var(--concrete); }
.section h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .6rem; }
.section .intro { font-size: 1.15rem; color: var(--muted); max-width: 40em; margin-bottom: 2.6rem; }

/* The real workflow is a sequence, so it is numbered */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 3px solid var(--asphalt); }
.flow li { list-style: none; padding: 1.2rem 1.1rem 0 0; position: relative; }
.flow li::before { counter-increment: step; content: counter(step); position: absolute; top: -17px; left: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--signal); color: var(--asphalt); font: 700 1rem/30px var(--font-cond); text-align: center; }
.flow { counter-reset: step; padding: 0; margin: 0; }
.flow h3 { margin: .9rem 0 .35rem; font-size: 1.35rem; }
.flow p { color: var(--muted); font-size: .97rem; margin: 0; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; border-top: 0; border-left: 3px solid var(--asphalt); padding-left: 1.6rem; } .flow li { padding: 0 0 1.8rem; } .flow li::before { left: -2.55rem; top: 0; } .flow h3 { margin-top: 0; } }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 3.5rem; }
.feature { display: grid; grid-template-columns: 44px 1fr; gap: 1rem; }
.feature .fi { width: 44px; height: 44px; border-radius: 10px; background: var(--asphalt); color: var(--signal); display: grid; place-items: center; }
.feature h3 { margin: .1rem 0 .3rem; font-size: 1.3rem; }
.feature p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.plans { display: grid; gap: 1.5rem; align-items: stretch; }
/* Boxes sit side by side only when each can be at least 280px wide – otherwise they stack (works inside the app too) */
.plans-1 { grid-template-columns: minmax(0, 460px); }
.plans-2, .plans-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.plan { display: flex; flex-direction: column; position: relative; }
.plan ul { flex: 1; }
.plan.plan-hot { border-color: var(--signal); border-width: 3px; box-shadow: 0 18px 40px -22px rgba(22,32,43,.45); }
.plan-badge { position: absolute; top: -14px; left: 2rem; background: var(--signal); color: var(--asphalt); font: 700 .85rem/1 var(--font); padding: .45em .8em; border-radius: 999px; }
.coming { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 3rem; margin-top: 3rem; }
@media (max-width: 960px) { .coming { grid-template-columns: 1fr; } }
.plan { background: var(--paper); border: 2px solid var(--asphalt); border-radius: 14px; padding: 2rem; }
.plan .price { font: 700 3.6rem/1 var(--font-cond); margin: .6rem 0 .2rem; white-space: nowrap; }
.plan .btn { white-space: normal; text-align: center; line-height: 1.2; }
.plan form { margin: 0; }
@media (max-width: 600px) { .plan { padding: 1.5rem 1.25rem; } .plan .price { font-size: 3rem; } }
.plan .price small { font: 500 1.1rem var(--font); color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 1.4rem 0 1.6rem; }
.plan li { padding: .35rem 0 .35rem 1.8rem; position: relative; }
.plan li::before { content: ""; position: absolute; left: 0; top: .55rem; width: 16px; height: 9px; border-left: 3px solid var(--green); border-bottom: 3px solid var(--green); transform: rotate(-45deg); }
.coming { color: var(--muted); }
.coming h3 { color: var(--asphalt); }

.faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq summary { font-weight: 600; font-size: 1.1rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; font: 700 1.4rem/1 var(--font-cond); color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: .7rem 0 0; color: var(--muted); max-width: 46em; }

.cta-band { background: var(--signal); color: var(--asphalt); padding: 3.5rem 0; }
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { margin: 0; font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
.cta-band .btn { background: var(--asphalt); color: #fff; }

.footer { background: var(--asphalt); color: #9fb0c2; padding: 2.5rem 0; font-size: .95rem; }
.footer .wrap { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.footer a { color: #d6dee7; text-decoration: none; margin-right: 1.2rem; } .footer a:hover { text-decoration: underline; }
.legal { max-width: 760px; padding: 3rem 20px; margin: 0 auto; }

/* =====================================================================
   BUSINESS APP
   ===================================================================== */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--asphalt); color: #c9d3de; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .co { padding: 1rem 1.1rem; border-bottom: 1px solid #2a3a4c; display: flex; align-items: center; gap: .7rem; min-height: 70px; }
.side .co .logo { background: #fff; border-radius: 8px; padding: 4px 6px; line-height: 0; max-width: 150px; }
.side .co .logo img { max-height: 40px; width: auto; }
.side .co .name { font: 700 1.15rem/1.1 var(--font-cond); color: #fff; }
.side nav { padding: .6rem 0; flex: 1; }
.side nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem 1.15rem; color: #c9d3de; text-decoration: none; font-weight: 500; border-left: 3px solid transparent; }
.side nav a:hover { background: var(--asphalt-2); color: #fff; }
.side nav a.on { background: var(--asphalt-2); color: #fff; border-left-color: var(--signal); }
.side nav .grp { margin: .9rem 1.15rem .3rem; font-size: .78rem; color: #7f91a5; }
.side .me { padding: .9rem 1.15rem; border-top: 1px solid #2a3a4c; font-size: .9rem; }
.side .me a { color: #c9d3de; }
.side .powered { padding: 0 1.15rem 1rem; font-size: .75rem; color: #6c7f94; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.6rem; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar h1 { margin: 0; font-size: 1.6rem; }
.topbar .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.menu-btn { display: none; background: none; border: 0; padding: .3rem; color: var(--asphalt); cursor: pointer; }
.content { padding: 1.6rem; max-width: 1280px; }
.trialbar { background: var(--signal); color: var(--asphalt); padding: .55rem 1.6rem; font-weight: 500; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.trialbar a { color: var(--asphalt); font-weight: 700; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: .7rem 1rem; } .topbar h1 { font-size: 1.35rem; }
  .content { padding: 1rem; } .trialbar { padding: .55rem 1rem; }
}

/* Dashboard stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; color: inherit; display: block; }
.stat .v { font: 700 1.8rem/1.1 var(--font-cond); font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: .9rem; }
.stat.warn .v { color: var(--red); }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; } }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.cols-21 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
.cols > *, .cols-21 > *, .grid2 > *, .grid3 > *, .stats > * { min-width: 0; }
@media (max-width: 1000px) { .cols, .cols-21 { grid-template-columns: 1fr; } }

/* Toolbar / filters */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; margin: 0; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.tabs a { padding: .45em .85em; border-radius: 999px; text-decoration: none; color: var(--asphalt); font-weight: 500; font-size: .92rem; border: 1px solid var(--line); background: var(--paper); }
.tabs a.on { background: var(--asphalt); color: #fff; border-color: var(--asphalt); }

/* Document editor lines */
.lines td { padding: .4rem; vertical-align: middle; }
.lines input { margin: 0; }
.lines .c-desc { min-width: 240px; } .lines .c-qty { width: 90px; } .lines .c-price { width: 130px; } .lines .c-total { width: 120px; text-align: right; } .lines .c-x { width: 40px; }
.totals { margin-left: auto; max-width: 340px; width: 100%; }
.totals div { display: flex; justify-content: space-between; padding: .35rem 0; }
.totals .grand { border-top: 2px solid var(--asphalt); margin-top: .3rem; padding-top: .6rem; font: 700 1.35rem var(--font-cond); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: .35rem 1rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.doc-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* Job card */
.timer-box { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.timer-box .clock { font: 700 2rem var(--font-cond); font-variant-numeric: tabular-nums; }
.sigpad { width: 100%; height: 200px; border: 2px dashed #9aa6b2; border-radius: 10px; background: #fff; touch-action: none; display: block; }

/* Calendar */
#calendar { background: var(--paper); border-radius: var(--radius); }
.fc .fc-toolbar-title { font-family: var(--font-cond); }
.fc .fc-button-primary { background: var(--asphalt); border-color: var(--asphalt); }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--brand); border-color: var(--brand); }

/* Print */
@media print { .side, .topbar, .trialbar, .noprint { display: none !important; } .app { display: block; } .card { border: 0; } body { background: #fff; } }

/* Payroll */
.pay-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; }
.pay-stats .v { font-size: 1.3rem; }
@media (max-width: 600px) { .pay-stats { grid-template-columns: 1fr 1fr; } }
