/*
 * partner.ccdocs.com -- design system.
 *
 * Founder-voice sales letter for blue-collar owners: bold type, brand color,
 * zero gradients, zero stock imagery. Pure typography + color. Mobile-first;
 * the sticky Apply/Call bar exists only under 48rem. Print-safe at the end.
 *
 * Brand tokens from apps/ccdocs-astro/src/styles/global.css.
 */

/* ----------------------------------------------------------------
   Tokens
   ---------------------------------------------------------------- */

:root {
  --brand-dark: #0D1427;
  --brand-gold: #FFCF00;
  --brand-blue: #0AA4DB;

  --ink: #1C2333;
  --ink-soft: #4A4C54;
  --ink-invert: #F4F6FB;
  --ink-invert-soft: #B9C0D4;

  --bg: #FFFFFF;
  --bg-tint: #F5F6F8;
  --bg-dark: var(--brand-dark);
  --bg-dark-raised: #16203A;

  --line: #E2E5EB;
  --line-dark: #2A3554;

  --error: #B42318;
  --error-bg: #FEF3F2;

  --font-heading: "Montserrat", "Arial Black", sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;

  --measure: 65ch;
  --radius: 0.5rem;
  --radius-lg: 0.875rem;

  --space-section: 4rem;
  --sticky-bar-h: 3.5rem;
}

/* ----------------------------------------------------------------
   Reset-lite + base
   ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* Room for the sticky bar on mobile; cleared at 48rem. */
  padding-bottom: calc(var(--sticky-bar-h) + env(safe-area-inset-bottom, 0px));
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand-dark);
}

:focus-visible {
  outline: 3px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Long URLs and citations must never force horizontal scroll. */
cite,
.prose a {
  overflow-wrap: anywhere;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--brand-gold);
  color: var(--brand-dark);
  font-weight: 700;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ----------------------------------------------------------------
   Typography
   ---------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--brand-dark);
  margin: 0 0 1rem;
}

h1 {
  font-size: clamp(2.125rem, 6vw, 3.5rem);
  font-weight: 900;
}

h2 {
  font-size: clamp(1.625rem, 4.5vw, 2.5rem);
  margin-top: 0;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

p {
  margin: 0 0 1.1em;
}

.kicker {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin: 0 0 0.75rem;
}

.section--dark .kicker {
  color: var(--brand-gold);
}

.lede {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  line-height: 1.5;
  font-weight: 500;
}

/* Long-form reading column. */
.prose {
  max-width: var(--measure);
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
  margin: 0 0 1.1em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose--invert,
.prose--invert h2,
.prose--invert h3 {
  color: var(--ink-invert);
}

.prose--invert p,
.prose--invert li {
  color: var(--ink-invert-soft);
}

.prose--invert a {
  color: var(--brand-gold);
}

.signature {
  font-weight: 600;
  margin-top: 2rem;
}

/* ----------------------------------------------------------------
   Layout + section rhythm
   ---------------------------------------------------------------- */

.section {
  padding: var(--space-section) 1.25rem;
}

.section-inner {
  max-width: 68rem;
  margin: 0 auto;
}

.section--tint {
  background: var(--bg-tint);
}

.section--dark {
  background: var(--bg-dark);
  color: var(--ink-invert);
}

.section--dark h1,
.section--dark h2,
.section--dark h3 {
  color: var(--ink-invert);
}

/* A hairline of gold separates the platform pitch from the exit above it. */
.section--platform {
  border-top: 1px solid var(--line-dark);
  background: var(--bg-dark-raised);
}

section {
  scroll-margin-top: 1rem;
}

/* ----------------------------------------------------------------
   Header
   ---------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  background: var(--brand-dark);
  border-bottom: 2px solid var(--brand-gold);
}

.wordmark {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #FFFFFF;
}

.wordmark span {
  color: var(--brand-gold);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-phone {
  color: var(--ink-invert);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  display: none; /* shown from 40rem up */
}

.nav-phone:hover {
  color: var(--brand-gold);
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btn-gold {
  background: var(--brand-gold);
  color: var(--brand-dark);
}

.btn-gold:hover {
  background: #E6BB00;
  color: var(--brand-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-invert);
  border-color: var(--ink-invert-soft);
}

.btn-ghost:hover {
  border-color: var(--brand-gold);
  color: var(--brand-gold);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.0625rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ----------------------------------------------------------------
   Hero
   ---------------------------------------------------------------- */

.hero {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

.hero .lede {
  max-width: var(--measure);
  color: var(--ink-invert-soft);
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem 0 2.5rem;
}

.proof-bar {
  list-style: none;
  margin: 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line-dark);
  display: grid;
  gap: 1rem;
}

.proof-bar li {
  color: var(--ink-invert-soft);
  font-size: 0.9375rem;
}

.proof-bar strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--brand-gold);
}

/* ----------------------------------------------------------------
   Tables (takeover map + worked tables)
   ---------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 30rem;
  font-size: 0.9375rem;
}

caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 700;
  padding-bottom: 0.625rem;
  color: inherit;
}

th,
td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--brand-dark);
  color: var(--brand-gold);
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: var(--bg-tint);
}

.funded-stamp {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-dark);
  background: var(--brand-gold);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  white-space: nowrap;
}

/* Worked tables on dark sections. */
.worked-table--invert th,
.worked-table--invert td {
  border-color: var(--line-dark);
}

.worked-table--invert tbody tr:nth-child(even) {
  background: var(--bg-dark-raised);
}

.worked-table--invert tbody td {
  color: var(--ink-invert-soft);
}

.yours-aside {
  margin-top: 1.5rem;
  border-left: 4px solid var(--brand-blue);
  background: var(--bg-tint);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  max-width: var(--measure);
}

.yours-aside h3 {
  margin-bottom: 0.5rem;
}

.yours-aside p {
  margin-bottom: 0;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------
   FAQ
   ---------------------------------------------------------------- */

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: #FFFFFF;
}

.faq-item summary {
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 1rem 1.25rem;
  list-style-position: inside;
}

.faq-item summary:hover {
  color: var(--brand-blue);
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--line);
}

.faq-item p {
  padding: 1rem 1.25rem 0.25rem;
  color: var(--ink-soft);
}

.deck-close {
  font-weight: 600;
  border-top: 1px solid var(--line-dark);
  padding-top: 1.25rem;
}

/* ----------------------------------------------------------------
   Application form
   ---------------------------------------------------------------- */

.section--apply {
  background: var(--bg-tint);
}

.apply-intro {
  max-width: var(--measure);
}

.skip-form {
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.apply-form {
  max-width: 46rem;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
}

.form-step {
  border: none;
  margin: 0 0 2rem;
  padding: 0;
}

.form-step legend {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--brand-dark);
  padding: 0;
  margin-bottom: 1rem;
}

.step-num {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  line-height: 1.75rem;
  text-align: center;
  border-radius: 50%;
  background: var(--brand-dark);
  color: var(--brand-gold);
  font-size: 0.9375rem;
  margin-right: 0.5rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field-grid {
  display: grid;
  gap: 0 1rem;
}

.field label,
.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--brand-dark);
  margin: 0 0 0.375rem;
}

.optional {
  font-weight: 400;
  color: var(--ink-soft);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid #C6CBD4;
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(10, 164, 219, 0.2);
}

textarea {
  resize: vertical;
}

/* Inline muted explainers (Part F). */
.explainer {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0.375rem 0 0;
}

/* 1-10 button-row radio groups. Inputs stay real radios for keyboard +
   screen-reader semantics; the spans are the visible buttons. */
.btn-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.375rem;
}

.btn-row-opt {
  position: relative;
  display: block;
}

.btn-row-opt input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.btn-row-opt span {
  display: block;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.5rem 0;
  border: 1px solid #C6CBD4;
  border-radius: var(--radius);
  background: #FFFFFF;
  color: var(--ink-soft);
  transition: background-color 100ms ease, color 100ms ease, border-color 100ms ease;
}

.btn-row-opt input:hover + span {
  border-color: var(--brand-blue);
  color: var(--brand-dark);
}

.btn-row-opt input:checked + span {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--brand-gold);
}

.btn-row-opt input:focus-visible + span {
  outline: 3px solid var(--brand-blue);
  outline-offset: 1px;
}

/* Honeypot: visually gone, still in the DOM for the proxy to score on. */
.hp-field {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 1rem 0 0;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #FDA29B;
  font-size: 0.9375rem;
}

.apply-success {
  max-width: 46rem;
  background: #FFFFFF;
  border: 2px solid var(--brand-gold);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
}

.apply-success .btn {
  margin: 0.75rem 0;
}

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */

.site-footer {
  background: var(--brand-dark);
  color: var(--ink-invert-soft);
  padding: 2.5rem 1.25rem 3rem;
  font-size: 0.875rem;
}

.site-footer a {
  color: var(--ink-invert);
}

.site-footer a:hover {
  color: var(--brand-gold);
}

.disclaimer {
  max-width: var(--measure);
  line-height: 1.6;
}

.footer-meta {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* ----------------------------------------------------------------
   Sticky mobile bottom bar
   ---------------------------------------------------------------- */

.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  height: calc(var(--sticky-bar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--line-dark);
}

.sticky-bar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9375rem;
  text-decoration: none;
}

.sticky-apply {
  background: var(--brand-gold);
  color: var(--brand-dark);
}

.sticky-call {
  background: var(--brand-dark);
  color: #FFFFFF;
}

/* ----------------------------------------------------------------
   Breakpoints (mobile-first)
   ---------------------------------------------------------------- */

@media (min-width: 40rem) {
  .nav-phone {
    display: inline;
  }

  .cta-row {
    flex-direction: row;
  }

  .proof-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-grid .field--wide {
    grid-column: 1 / -1;
  }

  .btn-row {
    grid-template-columns: repeat(10, 1fr);
  }

  .apply-form {
    padding: 2rem;
  }
}

@media (min-width: 48rem) {
  :root {
    --space-section: 6rem;
  }

  body {
    padding-bottom: 0;
  }

  .sticky-bar {
    display: none;
  }

  .hero {
    padding-top: 6.5rem;
    padding-bottom: 6.5rem;
  }
}

/* ----------------------------------------------------------------
   Print
   ---------------------------------------------------------------- */

@media print {
  body {
    padding-bottom: 0;
    color: #000;
    background: #FFF;
    font-size: 11pt;
  }

  .sticky-bar,
  .site-nav,
  .skip-link,
  .cta-row,
  .apply-form button {
    display: none !important;
  }

  .section,
  .section--dark,
  .section--tint,
  .section--platform {
    background: #FFF;
    color: #000;
    padding: 1.5rem 0;
  }

  .section--dark h1,
  .section--dark h2,
  .section--dark h3,
  .prose--invert,
  .prose--invert p,
  .prose--invert li {
    color: #000;
  }

  thead th {
    background: #FFF;
    color: #000;
    border-bottom: 2px solid #000;
  }

  .funded-stamp {
    background: #FFF;
    border: 1px solid #000;
    color: #000;
  }

  table,
  .faq-item {
    break-inside: avoid;
  }

  a[href^="tel:"]::after,
  .footer-meta a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
