/* Ember for the PUBLIC pages (marketplace, booking flow, join, invoices, quotes,
   statements, unsubscribe, team invite, privacy, terms).

   These pages have no login and no Settings, and do not extend base.html, so
   they follow the visitor's own device preference (light / dark) rather than
   the dashboard's data-bs-theme. The token NAMES and VALUES are the same as
   dashboard.css; only the switch differs (prefers-color-scheme). Pair this with
   <meta name="color-scheme" content="light dark">. */

:root {
  --orange:      #FF5A1F;
  --orange-dark: #E94C12;
  --accent-rgb:  255,90,31;
  --orange-light:rgba(var(--accent-rgb),0.11);
  --orange-text: #C2410C;
  --on-accent:   #FFFFFF;
  --charcoal:    #1A1714;
  --gray-50:     #FAF7F2;
  --gray-100:    #FFFFFF;
  --gray-200:    rgba(60,40,20,0.10);
  --gray-300:    rgba(60,40,20,0.20);
  --gray-400:    #7D756C;
  --gray-500:    #5F5850;
  --fill-quiet:  rgba(60,40,20,0.07);
  --fill-quiet-hover: rgba(60,40,20,0.12);
  --green:       #15803D;
  --green-light: rgba(21,128,61,0.11);
  --red:         #D92D20;
  --red-light:   rgba(217,45,32,0.10);
  --amber:       #8A5A00;
  --amber-light: rgba(202,138,4,0.16);
  --shadow-ink:  60, 40, 20;
  --r-card: 24px; --r-ctl: 12px; --r-nest: 12px;
  --card-shadow: 0 1px 2px rgba(var(--shadow-ink),.05), 0 8px 24px rgba(var(--shadow-ink),.06);
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not(.force-light) {
    --orange:      #FF6A33;
    --orange-dark: #FF8250;
    --accent-rgb:  255,106,51;
    --orange-light:rgba(var(--accent-rgb),0.16);
    --orange-text: #FF9466;
    --on-accent:   #FFFFFF;
    --charcoal:    #F5F1EC;
    --gray-50:     #14110F;
    --gray-100:    #1F1B18;
    --gray-200:    rgba(255,244,230,0.09);
    --gray-300:    rgba(255,244,230,0.17);
    --gray-400:    #857D74;
    --gray-500:    #ADA59C;
    --fill-quiet:  rgba(255,244,230,0.08);
    --fill-quiet-hover: rgba(255,244,230,0.13);
    --green:       #30D158;
    --green-light: rgba(48,209,88,0.14);
    --red:         #FF5C52;
    --red-light:   rgba(255,92,82,0.14);
    --amber:       #FFD60A;
    --amber-light: rgba(255,214,10,0.14);
    --shadow-ink:  0, 0, 0;
    --card-shadow: none;
  }
}

:root.force-light { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--gray-50); color: var(--charcoal);
  font-family: var(--font-ui); -webkit-font-smoothing: antialiased; line-height: 1.5;
}
a { color: var(--orange-text); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--orange); outline-offset: 2px;
}
h1, h2, h3 { color: var(--charcoal); }
.text-muted, .form-text { color: var(--gray-500) !important; }
hr { border-color: var(--gray-200); opacity: 1; }

/* ── Top bar: the logo, and one quiet pill (back / list your business) ── */
.ep-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 76px; padding: 0 max(20px, calc((100% - 1120px) / 2));
  box-shadow: 0 1px 0 var(--gray-200); background: var(--gray-50);
}
.ep-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--charcoal); min-height: 44px; }
.ep-logo:hover { color: var(--charcoal); }
.ep-logo img { display: block; width: 34px; height: 34px; }
.ep-logo span { font-family: 'Space Grotesk', var(--font-ui); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.ep-pill, a.ep-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; background: var(--fill-quiet); color: var(--charcoal);
  font: 600 14px/1 var(--font-ui); text-decoration: none; border: 0; cursor: pointer; white-space: nowrap;
  max-width: 55vw; overflow: hidden; text-overflow: ellipsis;
}
.ep-pill:hover { background: var(--fill-quiet-hover); color: var(--charcoal); }
.ep-pill.tint { background: var(--orange-light); color: var(--orange-text); }
.ep-pill.tint:hover { background: rgba(var(--accent-rgb),.2); color: var(--orange-text); }

/* ── Buttons: one orange primary per screen, ink label ── */
.ep-btn, a.ep-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 0; background: var(--fill-quiet); color: var(--charcoal);
  font: 600 15px/1 var(--font-ui); text-decoration: none; cursor: pointer; text-align: center;
}
.ep-btn:hover { background: var(--fill-quiet-hover); color: var(--charcoal); }
.ep-btn.primary { background: var(--orange); color: var(--on-accent); }
.ep-btn.primary:hover { background: var(--orange-dark); color: var(--on-accent); }
.ep-btn.block { display: flex; width: 100%; min-height: 52px; font-size: 16px; }
.ep-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── Cards, fields, alerts ── */
.ep-card {
  background: var(--gray-100); border-radius: var(--r-card); padding: 28px; box-shadow: var(--card-shadow);
}
.ep-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ep-label, .form-label {
  font-size: 13px; font-weight: 500; color: var(--gray-500); text-transform: none; letter-spacing: 0; margin-bottom: 0;
}
.ep-input, .form-control, .form-select {
  width: 100%; min-height: 48px; padding: 0 16px; background: var(--gray-50); color: var(--charcoal);
  border: 0; border-radius: var(--r-ctl); box-shadow: inset 0 0 0 1px var(--gray-300);
  font: 400 16px/1.3 var(--font-ui);
}
textarea.ep-input, textarea.form-control { padding: 12px 16px; min-height: 96px; }
.ep-input::placeholder, .form-control::placeholder { color: var(--gray-400); }
.ep-input:focus, .form-control:focus, .form-select:focus {
  outline: none; background: var(--gray-50); color: var(--charcoal);
  box-shadow: inset 0 0 0 1px var(--orange), 0 0 0 3px rgba(var(--accent-rgb),.18);
}
.input-group { display: flex; flex-wrap: nowrap; align-items: stretch; }
.input-group-text {
  display: inline-flex; align-items: center; padding: 0 14px; background: var(--fill-quiet); color: var(--gray-500);
  border: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); font-size: 15px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--gray-300);
}
.input-group > .form-control, .input-group > .ep-input, .input-group > .pb-form-control {
  flex: 1 1 auto; width: 1%; min-width: 0; border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
}
.ep-note {
  padding: 12px 16px; border-radius: 14px; font-size: 14px; line-height: 1.45; background: var(--fill-quiet); color: var(--charcoal);
}
.ep-note.ok, .alert-success { background: var(--green-light); color: var(--green); }
.ep-note.warn { background: var(--amber-light); color: var(--amber); font-weight: 600; }
.ep-note.bad, .alert-danger { background: var(--red-light); color: var(--red); }
.ep-note.accent, .alert-info { background: var(--orange-light); color: var(--orange-text); }
.alert { border: 0; border-radius: 14px; font-size: 14px; padding: 12px 16px; margin-bottom: 16px; }
.form-check-input { width: 1.25em; height: 1.25em; background-color: var(--gray-50); border-color: var(--gray-300); }
.form-check-input:checked { background-color: var(--orange); border-color: var(--orange); }
.form-check-input:checked[type=checkbox] { --bs-form-check-bg-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%231A1714' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e"); }
.form-check-input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.18); }
.ep-avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px;
  background: var(--orange-light); color: var(--orange-text); font-weight: 800; font-size: 18px;
}
.ep-icon-disc {
  display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 999px;
  background: var(--orange-light); color: var(--orange-text); margin: 0 auto 16px;
}
.ep-icon-disc.ok { background: var(--green-light); color: var(--green); }
.ep-icon-disc.warn { background: var(--amber-light); color: var(--amber); }
.ep-icon-disc.bad { background: var(--red-light); color: var(--red); }
.ep-icon-disc svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ep-center { text-align: center; }
.ep-foot { text-align: center; font-size: 12px; color: var(--gray-500); padding: 24px 16px 32px; }
.ep-foot a { color: var(--gray-500); }
.ep-stage { max-width: 480px; margin: 0 auto; padding: 48px 20px; }
.ep-stage h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 8px; }
.ep-stage p { color: var(--gray-500); font-size: 15px; margin: 0 0 16px; }

/* ── Documents (public invoice / quote / statement) ── */
.ep-doc { width: 100%; max-width: 620px; margin: 0 auto; padding: 40px 20px 8px; }
.ep-doc.wide { max-width: 760px; }
.ep-doc-card { display: flex; flex-direction: column; gap: 16px; }
.ep-doc-head { display: flex; align-items: center; gap: 12px; }
.ep-doc-head b { font-size: 17px; }
.ep-doc-head .sub { font-size: 14px; color: var(--gray-500); }
.ep-doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ep-doc th { text-align: left; font-size: 13px; font-weight: 500; color: var(--gray-500); padding: 12px 0; text-transform: none; letter-spacing: 0; border: 0; }
.ep-doc td { padding: 14px 0; box-shadow: 0 -1px 0 var(--gray-200); border: 0; }
.ep-doc td.num, .ep-doc th.num { text-align: right; }
.ep-doc td.num { font-variant-numeric: tabular-nums; }
.ep-lines { display: flex; flex-direction: column; gap: 8px; }
.ep-lines .row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--gray-500); }
.ep-lines .row.strong { color: var(--charcoal); font-weight: 700; font-size: 17px; }
.ep-lines .row.due { color: var(--charcoal); font-weight: 800; font-size: 19px; align-items: baseline; padding-top: 12px; box-shadow: 0 -1px 0 var(--gray-200); }
.ep-lines .row.green { color: var(--green); }
.ep-pay { display: flex; flex-direction: column; gap: 10px; }
.ep-pay form { margin: 0; }
.ep-doc-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: var(--gray-500); }
.ep-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.ep-stat { background: var(--fill-quiet); border-radius: var(--r-nest); padding: 14px 16px; }
.ep-stat .label { font-size: 13px; color: var(--gray-500); }
.ep-stat .value { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ep-bdg {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--fill-quiet); color: var(--gray-500);
}
.ep-bdg.ok { background: var(--green-light); color: var(--green); }
.ep-bdg.warn { background: var(--amber-light); color: var(--amber); }
.ep-bdg.bad { background: var(--red-light); color: var(--red); }
.ep-bdg.accent { background: var(--orange-light); color: var(--orange-text); }
.ep-dialog-back { display: none; position: fixed; inset: 0; background: rgba(var(--shadow-ink), .5); align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.ep-dialog { background: var(--gray-100); border-radius: var(--r-card); max-width: 380px; width: 100%; padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,.25); }
.ep-dialog p { margin: 0 0 18px; font-size: 16px; font-weight: 600; }
.ep-actions { display: flex; gap: 10px; }
.ep-actions > * { flex: 1; }
.ep-scroll-x { overflow-x: auto; }
@media (max-width: 640px) {
  .ep-doc { padding: 24px 16px 8px; }
  .ep-card { padding: 22px; }
  .ep-stats { grid-template-columns: 1fr; }
  .ep-doc table.stack thead { display: none; }
  .ep-doc table.stack, .ep-doc table.stack tbody, .ep-doc table.stack tr, .ep-doc table.stack td { display: block; width: 100%; }
  .ep-doc table.stack tr { padding: 12px 0; box-shadow: 0 -1px 0 var(--gray-200); }
  .ep-doc table.stack td { padding: 2px 0; box-shadow: none; text-align: left; }
  .ep-doc table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--gray-500); font-size: 13px; }
  .ep-doc table.stack td.num { text-align: left; }
}

/* ── Long-form reading pages (privacy, terms) ── */
.ep-legal { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 40px; max-width: 1120px; margin: 0 auto; padding: 48px 20px 40px; align-items: start; }
.ep-legal h1 { grid-column: 1 / -1; margin: 0; font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.ep-legal .updated { grid-column: 1 / -1; margin: -28px 0 0; color: var(--gray-500); font-size: 15px; }
.ep-toc { position: sticky; top: 20px; background: var(--gray-100); border-radius: var(--r-card); padding: 18px; box-shadow: var(--card-shadow); }
.ep-toc h2 { font-size: 14px; font-weight: 600; color: var(--gray-500); margin: 0 0 8px 10px; }
.ep-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ep-toc a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--charcoal); text-decoration: none; font-size: 14px; }
.ep-toc a:hover, .ep-toc a:focus-visible { background: var(--fill-quiet); }
.ep-toc a.on { background: var(--orange-light); color: var(--orange-text); font-weight: 600; }
.ep-legal-body { background: var(--gray-100); border-radius: var(--r-card); padding: 36px 40px; box-shadow: var(--card-shadow); min-width: 0; }
.ep-legal-body h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 36px 0 10px; scroll-margin-top: 20px; }
.ep-legal-body h2:first-child { margin-top: 0; }
.ep-legal-body h3 { font-size: 16px; font-weight: 700; margin: 20px 0 6px; }
.ep-legal-body p, .ep-legal-body li { font-size: 15px; line-height: 1.65; color: var(--gray-500); }
.ep-legal-body strong, .ep-legal-body b { color: var(--charcoal); }
.ep-legal-body ul, .ep-legal-body ol { padding-left: 1.2rem; }
.ep-legal-body table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0; }
.ep-legal-body th { text-align: left; font-weight: 500; color: var(--gray-500); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--gray-200); }
.ep-legal-body td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--gray-200); vertical-align: top; color: var(--gray-500); }
@media (max-width: 860px) {
  .ep-legal { grid-template-columns: 1fr; gap: 20px; padding: 28px 16px 32px; }
  .ep-legal h1 { font-size: 32px; }
  .ep-legal .updated { margin-top: -12px; }
  .ep-toc { position: static; }
  .ep-toc ol { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 6px; padding-bottom: 2px; }
  .ep-toc ol::-webkit-scrollbar { display: none; }
  .ep-toc a { white-space: nowrap; background: var(--fill-quiet); border-radius: 999px; padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; }
  .ep-toc h2 { margin-left: 4px; }
  .ep-legal-body { padding: 24px 20px; }
}
