/* Credenta Solutions - v3: ServiceTitan-style layout (dark photo hero panel, photo trade cards,
   dark multi-column footer) on Credenta Solutions' own tokens. */

:root {
  /* Neutrals: white page, structural-iron ink for the dark panels */
  --bg-canvas: #ffffff;
  --bg-sheet: #ffffff;
  --bg-well: #f1f3f5;
  --bg-panel: #16191d;            /* hero + sign-up panels, footer */
  --bg-panel-raised: #20252b;

  --ink-primary: #16191d;         /* 17.6:1 on white */
  --ink-secondary: #3a424c;       /* 10.2:1 on white */
  --ink-muted: #56606b;           /* 6.4:1 on white */
  --ink-on-dark: #f3f5f7;
  --ink-on-dark-muted: #a9b3bf;   /* 8.3:1 on panel */

  --border-hairline: #dde2e7;
  --border-strong: #a3adb8;
  --border-on-dark: #343b44;

  /* CTA: burnt safety orange, sampled from the hi-vis vests in the job-site photos.
     White label = 5.1:1. Lighter tint is for orange text on the dark panel (7.5:1). */
  --accent-cta: #c4420a;
  --accent-cta-hover: #a5370a;
  --accent-cta-on-dark: #ff8a3d;

  /* Blueprint blue stays as the data/link accent from v2 */
  --accent-blueprint: #174ea6;
  --accent-blueprint-border: #adc4e8;

  --status-deficient: #b42318;
  --status-verified: #15603a;     /* unslop-ignore: status color for verified records, not the brand color */
  --status-verified-bg: #ecfdf3;
  --status-verified-border: #abefc6;

  --font-display: 'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radius: 4px on controls, 12px on photo cards, 20px on the big dark panels */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-card: 12px;
  --radius-panel: 20px;

  --shadow-card: 0 1px 2px rgba(22, 25, 29, 0.06), 0 4px 16px rgba(22, 25, 29, 0.06);
  --shadow-float: 0 18px 40px rgba(0, 0, 0, 0.35);
  --shadow-modal: 0 16px 40px rgba(22, 25, 29, 0.24);

  --dur-fast: 140ms;
  --ease-snap: cubic-bezier(0.2, 0, 0, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--ink-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  font-size: 1.0625rem;
  background-color: var(--bg-canvas);
}

img {
  display: block;
  max-width: 100%;
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

.font-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--accent-blueprint);
  outline-offset: 2px;
}

.panel :focus-visible {
  outline-color: var(--accent-cta-on-dark);
}

/* ---------- Top utility bar + header ---------- */
.utility-bar {
  font-size: 0.875rem;
  color: var(--ink-secondary);
}

.nav-link {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink-primary);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-snap);
}

.nav-link:hover {
  border-color: var(--accent-cta);
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.5rem 1.25rem;
  min-height: 2.75rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-snap), border-color var(--dur-fast) var(--ease-snap), color var(--dur-fast) var(--ease-snap);
}

.btn-primary {
  background-color: var(--accent-cta);
  border: 1px solid var(--accent-cta);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-cta-hover);
  border-color: var(--accent-cta-hover);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--border-on-dark);
  color: var(--ink-on-dark);
}

.btn-secondary:hover {
  border-color: var(--ink-on-dark-muted);
}

/* ServiceTitan-style full-width outline button inside photo cards */
.btn-outline {
  width: 100%;
  background-color: var(--bg-sheet);
  border: 1px solid var(--ink-primary);
  color: var(--ink-primary);
}

.btn-outline:hover {
  background-color: var(--ink-primary);
  color: var(--ink-on-dark);
}

.btn-lg {
  min-height: 3.5rem;
  padding: 0.75rem 1.75rem;
  font-size: 1.0625rem;
}

/* ---------- Dark panels (hero, sign-up) ---------- */
.panel {
  position: relative;
  background-color: var(--bg-panel);
  color: var(--ink-on-dark);
  border-radius: var(--radius-panel);
  overflow: hidden;
}

.panel h1,
.panel h2 {
  color: var(--ink-on-dark);
}

/* Hero photo sits on the right and fades into the panel colour on its left edge */
.hero-photo {
  position: absolute;
  inset: 0 0 0 auto;
  width: 62%;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 30%;
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg-panel) 0%, rgba(22, 25, 29, 0.85) 22%, rgba(22, 25, 29, 0.2) 60%, rgba(22, 25, 29, 0.05) 100%);
}

@media (max-width: 1023px) {
  .hero-photo {
    position: relative;
    width: 100%;
    height: 16rem;
  }

  .hero-photo::after {
    background: linear-gradient(0deg, var(--bg-panel) 0%, rgba(22, 25, 29, 0.1) 55%);
  }
}

/* Inline email + CTA, like the reference hero */
.hero-capture {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 34rem;
}

.hero-capture input {
  flex: 1 1 16rem;
  min-height: 3.5rem;
  padding: 0 1rem;
  border: 1px solid #ffffff;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
}

.hero-capture input::placeholder {
  color: var(--ink-muted);
}

.hero-capture .btn-primary {
  flex: 0 0 auto;
}

/* Proof strip along the bottom of the hero panel */
.proof-strip {
  border-top: 1px solid var(--border-on-dark);
  background-color: rgba(22, 25, 29, 0.94);
}

.proof-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-on-dark-muted);
  font-size: 0.9375rem;
  line-height: 1.35;
}

.proof-item strong {
  display: block;
  color: var(--ink-on-dark);
  font-weight: 600;
}

.proof-item svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  color: var(--accent-cta-on-dark);
}

/* Monday list card floating over the hero photo */
.dispatch-float {
  width: 100%;
  max-width: 23rem;
  background-color: var(--bg-sheet);
  color: var(--ink-primary);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.dispatch-bar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background-color: var(--bg-well);
  border-bottom: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.dispatch-bar strong {
  color: var(--ink-primary);
  font-weight: 500;
}

.dispatch-footer {
  padding: 0.625rem 1rem;
  border-top: 1px solid var(--border-hairline);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

/* ---------- Section headings ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-cta);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel .eyebrow {
  color: var(--accent-cta-on-dark);
}

/* ---------- Trade photo cards (also the trade picker) ---------- */
.trade-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-sheet);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color var(--dur-fast) var(--ease-snap), box-shadow var(--dur-fast) var(--ease-snap);
}

.trade-card:hover {
  border-color: var(--border-strong);
}

.trade-card-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--bg-well);
}

.trade-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trade-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
  padding: 1.25rem;
}

.trade-card-body h3 {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}

.trade-card-body p {
  color: var(--ink-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.trade-card-body .btn-outline {
  margin-top: auto;
}

.trade-card-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.trade-card.active {
  border-color: var(--accent-cta);
  box-shadow: 0 0 0 1px var(--accent-cta), var(--shadow-card);
}

.trade-card.active .btn-outline {
  background-color: var(--accent-cta);
  border-color: var(--accent-cta);
  color: #ffffff;
}

/* ---------- How it works: photo + timeline ---------- */
.side-photo {
  border-radius: var(--radius-card);
  overflow: hidden;
  background-color: var(--bg-well);
}

.side-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline {
  list-style: none;
  display: grid;
  gap: 2rem;
}

.timeline-step {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  column-gap: 1.25rem;
  position: relative;
}

.timeline-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: calc(1.25rem - 1px);
  top: 2.5rem;
  bottom: -2rem;
  width: 2px;
  background-color: var(--border-hairline);
}

.timeline-num {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  background-color: var(--bg-well);
  color: var(--ink-secondary);
  border: 1px solid var(--border-hairline);
}

.timeline-week {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-muted);
}

.timeline-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0.125rem;
}

.timeline-text {
  margin-top: 0.375rem;
  color: var(--ink-secondary);
  font-size: 1rem;
}

.is-you .timeline-num {
  background-color: var(--accent-cta);
  border-color: var(--accent-cta);
  color: #ffffff;
}

.is-you .timeline-week {
  color: var(--accent-cta);
  font-weight: 500;
}

.is-late .timeline-num {
  color: var(--status-deficient);
  border-color: var(--status-deficient);
  background-color: #ffffff;
}

.is-late .timeline-week {
  color: var(--status-deficient);
}

.you-tag {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.625rem;
  background-color: var(--accent-cta);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: var(--radius-md);
}

/* ---------- Job cards (styled like the reference's result cards: stat on top) ---------- */
.job-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem;
  background-color: var(--bg-sheet);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.job-card-compact {
  padding: 1.125rem 1rem;
  gap: 1rem;
}

.job-price {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-blueprint);
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}

.call-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  background-color: var(--status-verified-bg);
  border: 1px solid var(--status-verified-border);
  color: var(--status-verified);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- Payback math ---------- */
.math-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 1.125rem;
  color: var(--ink-secondary);
}

.math-row strong {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--ink-primary);
  white-space: nowrap;
}

.math-row strong.text-verified {
  color: var(--status-verified);
}

.math-total {
  border-bottom: none;
  border-top: 2px solid var(--ink-primary);
  padding-top: 0.875rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.math-total strong {
  font-size: 1.5rem;
}

.price-card {
  background-color: var(--bg-sheet);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.check-item {
  display: flex;
  gap: 0.75rem;
  color: var(--ink-secondary);
}

.check-item svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1875rem;
  color: var(--status-verified);
}

.check-item strong {
  color: var(--ink-primary);
}

/* ---------- Form (sits inside the dark sign-up panel) ---------- */
.form-card {
  background-color: var(--bg-sheet);
  color: var(--ink-primary);
  border-radius: var(--radius-card);
}

.field-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ink-primary);
}

.field-input {
  width: 100%;
  min-height: 3.25rem;
  background-color: var(--bg-sheet);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink-primary);
  transition: border-color var(--dur-fast) var(--ease-snap);
}

.field-input::placeholder {
  color: var(--ink-muted);
}

.field-input:focus {
  outline: none;
  border-color: var(--accent-blueprint);
  box-shadow: 0 0 0 2px var(--accent-blueprint-border);
}

/* Shown only after a submit attempt, cleared as soon as the field is edited */
.field-input[aria-invalid="true"] {
  border-color: var(--status-deficient);
}

.field-error {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--status-deficient);
}

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--border-hairline);
}

.faq-header {
  width: 100%;
  background: transparent;
  border: none;
  text-align: left;
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--ink-primary);
}

.faq-header:hover {
  color: var(--accent-cta);
}

.faq-icon {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--accent-cta);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 200ms var(--ease-snap);
  color: var(--ink-secondary);
}

.faq-content.open {
  max-height: 420px;
  padding-bottom: 1.25rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background-color: var(--bg-panel);
  color: var(--ink-on-dark-muted);
}

.footer-heading {
  color: var(--ink-on-dark);
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.footer-link {
  color: var(--ink-on-dark-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.footer-link:hover {
  color: var(--ink-on-dark);
  text-decoration: underline;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(22, 25, 29, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-snap);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-sheet);
  border-radius: var(--radius-card);
  max-width: 28rem;
  width: 100%;
  box-shadow: var(--shadow-modal);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
