/* ==========================================================================
   TechSpire Solutions — static pages (About, Contact, Legal, 404)
   Loaded only by app/pages/about.php, contact.php, legal.php and 404.php.
   Builds on the tokens and components in app.css.
   ========================================================================== */

/* Shared ----------------------------------------------------------------- */
.anchor-target,
.legal-section { scroll-margin-top: 16px; }

/* Category tiles (About + 404) */
.cat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cat-tiles > li { display: flex; min-width: 0; }
.cat-tile {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  color: var(--ts-text);
}
.cat-tile:hover { color: var(--ts-text); text-decoration: none; }
.cat-tile:hover .cat-tile-name { color: #c7511f; }
.cat-tile:focus-visible { border-radius: var(--radius); }
.cat-tile-body { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.cat-tile-name { font-size: 16px; font-weight: 700; line-height: 1.3; transition: color .15s; }
.cat-tile-text { font-size: 13.5px; line-height: 1.45; color: var(--ts-text-2); }
.cat-tile-meta { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--ts-steel-600); }
.cat-tile-chevron { align-self: center; margin-left: auto; color: var(--ts-text-3); transition: transform .2s var(--ease); }
.cat-tile:hover .cat-tile-chevron { transform: translateX(3px); color: var(--ts-text-2); }

/* About ------------------------------------------------------------------ */
.about-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin: 8px 0 0;
  padding: 28px 20px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 85% 20%, rgba(91, 137, 173, .45), transparent 45%),
    radial-gradient(circle at 10% 110%, rgba(26, 115, 232, .35), transparent 50%),
    linear-gradient(135deg, var(--ts-navy-900) 0%, var(--ts-navy-700) 100%);
  color: #fff;
  box-shadow: var(--shadow-2);
}
.about-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  pointer-events: none;
}
.about-hero-inner { position: relative; max-width: 760px; }
.about-hero-eyebrow { color: #8ab4f8; }
.about-hero-title {
  margin: 0 0 12px;
  color: #fff;
  font-size: 26px;
  line-height: 1.18;
  letter-spacing: -.02em;
}
.about-hero-lead { margin: 0; max-width: 640px; color: #c9d6e3; font-size: 16px; line-height: 1.6; }
.about-hero-actions { margin-top: 22px; }
.about-hero-actions .btn { white-space: normal; }
.about-hero-art { display: none; position: relative; color: rgba(255, 255, 255, .88); justify-self: center; }
.about-hero-tree { width: 220px; height: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .25)); }
.about-hero-tree circle { fill: var(--ts-orange); }
.about-hero-tree circle:nth-child(2n) { fill: #8ab4f8; }

.about-mission { margin-top: 20px; }
.about-mission-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 32px; align-items: center; }
.about-mission-quote {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -.015em;
  color: var(--ts-navy-700);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .about-mission-quote {
    background: linear-gradient(90deg, var(--ts-blue) 0%, #7b61ff 55%, var(--ts-steel-600) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
.about-mission-text { color: var(--ts-text-2); font-size: 15px; line-height: 1.65; }

/* How ordering works: vertical timeline on phones, 5 columns on desktop */
.steps { display: grid; gap: 20px; margin: 4px 0 0; padding: 0; list-style: none; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 16px;
  align-content: start;
}
.step-marker {
  position: relative;
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ts-blue), var(--ts-navy-700));
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 115, 232, .28);
  z-index: 1;
}
.step-icon { width: 22px; height: 22px; }
.step-num {
  position: absolute;
  top: -5px;
  right: -7px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 11px;
  background: var(--ts-orange);
  color: var(--ts-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.step-title { margin: 2px 0 4px; font-size: 16px; font-weight: 700; }
.step-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ts-text-2); }
.step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 56px;
  bottom: -16px;
  left: 23px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--ts-blue-100), var(--ts-border-2));
}

/* Payment methods */
.pay-card { display: flex; flex-direction: column; }
.pay-card-icon,
.commit-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ts-blue-50);
  color: var(--ts-blue);
}
.pay-card-title,
.commit-card-title { margin: 14px 0 4px; font-size: 16px; font-weight: 700; }
.pay-card-text,
.commit-card-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ts-text-2); }
.billing-notes { margin-top: 16px; }
.billing-notes-title { margin: 0 0 12px; font-size: 16px; }
.billing-notes .list-check { gap: 10px; font-size: 14px; }

.about-footnote { margin-top: 10px; }

/* Commitments */
.commit-card { display: flex; flex-direction: column; }
.commit-card-icon { background: var(--ts-green-50); color: var(--ts-green); }
.commit-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 14px;
  font-size: 14px;
  font-weight: 600;
}
.commit-card-link .icon { transition: transform .2s var(--ease); }
.commit-card-link:hover .icon { transform: translateX(3px); }

/* Closing call to action */
.about-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 36px;
  padding: 24px;
  border: 1px solid var(--ts-blue-100);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--ts-blue-50) 0%, #f3efff 100%);
}
.about-cta-text { flex: 1 1 420px; min-width: 0; color: var(--ts-text-2); }
.about-cta-title { margin: 0 0 6px; font-size: 21px; color: var(--ts-text); }
.about-cta-actions .btn { white-space: normal; }

/* Contact ---------------------------------------------------------------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 36px;
}
.contact-main { min-width: 0; }
.contact-required-note { margin: -4px 0 16px; }
.contact-form .textarea { min-height: 170px; }
.contact-error-summary { margin: 0 0 18px; }
.contact-error-list { margin: 6px 0 0; padding-left: 18px; }
.contact-error-list li { margin: 2px 0; }
.contact-error-list a { color: #a50e0e; font-weight: 600; text-decoration: underline; }
.contact-actions { margin-top: 22px; gap: 14px 20px; }
.contact-actions .btn { white-space: normal; }
.contact-privacy { flex: 1 1 240px; }

/* Honeypot: off-screen for people, still present for bots */
.contact-hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.contact-success-head { display: flex; align-items: flex-start; gap: 16px; }
.contact-success-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ts-green-50);
  color: var(--ts-green);
}
.contact-success-title { margin: 4px 0 6px; font-size: 21px; line-height: 1.3; }
.contact-success-text { margin: 0; color: var(--ts-text-2); }
.contact-next-title { margin: 24px 0 12px; font-size: 16px; }
.contact-success .list-check { font-size: 14px; }
.contact-success-actions { margin-top: 22px; }

.contact-aside { display: grid; gap: 16px; min-width: 0; }
.contact-card-title { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.contact-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.contact-list li { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; font-size: 14px; }
.contact-list a { overflow-wrap: anywhere; font-weight: 500; }
.contact-list-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ts-blue-50);
  color: var(--ts-blue);
}
.contact-list-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ts-text-2); }
.contact-address { white-space: pre-line; }
.contact-response {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--ts-border-2);
  color: var(--ts-green);
  font-size: 14px;
  font-weight: 600;
}
.contact-steps { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ts-text-2); }
.contact-steps li { margin: 6px 0; padding-left: 2px; }
.contact-steps li::marker { color: var(--ts-steel-600); font-weight: 700; }
.contact-links { margin: 0; padding: 0; list-style: none; }
.contact-links li + li { border-top: 1px solid var(--ts-border-2); }
.contact-links a { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 14px; font-weight: 500; }
.contact-links .icon { color: var(--ts-text-2); }

.contact-service-link { display: flex; align-items: center; gap: 12px; color: var(--ts-text); }
.contact-service-link:hover { color: var(--ts-text); text-decoration: none; }
.contact-service-link:hover .contact-service-name { color: #c7511f; }
.contact-service-thumb { flex-shrink: 0; width: 64px; height: 64px; overflow: hidden; border-radius: var(--radius); }
.contact-service-thumb .art { width: 100%; height: 100%; }
.contact-service-name { display: block; font-size: 15px; font-weight: 700; line-height: 1.3; }
.contact-service-price { display: block; margin-top: 2px; font-size: 13px; color: var(--ts-text-2); }

/* Legal ------------------------------------------------------------------ */
.legal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin: 4px 0 36px;
}
.legal-aside { order: 2; display: grid; gap: 16px; min-width: 0; }
.legal-toc { display: none; }
.legal-aside-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ts-text-2);
}
.legal-toc-list,
.legal-docs-list { margin: 0; padding: 0; list-style: none; }
.legal-toc-list a,
.legal-docs-list a {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ts-text-2);
  font-size: 14px;
  line-height: 1.4;
}
.legal-toc-list a:hover,
.legal-docs-list a:hover { background: var(--ts-surface-3); color: var(--ts-text); text-decoration: none; }
.legal-toc-num { flex-shrink: 0; min-width: 1.6em; color: var(--ts-text-3); font-variant-numeric: tabular-nums; }
.legal-docs-list a { align-items: center; }
.legal-docs-list a[aria-current="page"] { background: var(--ts-blue-50); color: #174ea6; font-weight: 700; }

.legal-doc { min-width: 0; padding: 20px 18px 24px; }
.legal-head { padding-bottom: 18px; border-bottom: 1px solid var(--ts-border-2); }
.legal-updated {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--ts-text-2);
}
.legal-intro { max-width: 820px; margin: 0; font-size: 16px; line-height: 1.6; }

.legal-toc-mobile {
  margin: 16px 0 0;
  border: 1px solid var(--ts-border);
  border-radius: var(--radius);
  background: var(--ts-surface-2);
}
.legal-toc-mobile > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.legal-toc-mobile > summary::-webkit-details-marker { display: none; }
.legal-toc-mobile > summary::after {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23565959' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat center / 16px;
  transition: transform .2s ease;
}
.legal-toc-mobile[open] > summary::after { transform: rotate(180deg); }
.legal-toc-mobile .legal-toc-list { padding: 0 6px 10px; }

.legal-body { max-width: 820px; }
.legal-section h2 { display: flex; gap: 8px; margin: 1.7em 0 .6em; font-size: 19px; line-height: 1.3; }
.legal-section:first-child h2 { margin-top: 1.2em; }
.legal-num { flex-shrink: 0; color: var(--ts-steel-600); font-variant-numeric: tabular-nums; }
.legal-section h3 { margin: 1.3em 0 .5em; font-size: 16px; }
.legal-section ul,
.legal-section ol { margin: 0 0 1em; padding-left: 1.4em; }
.legal-section li { margin: .45em 0; }
.legal-section code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ts-surface-3);
  font-size: .9em;
}
.legal-caps {
  padding: 12px 14px;
  border-left: 3px solid var(--ts-border);
  border-radius: 4px;
  background: var(--ts-surface-2);
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.legal-dl { margin: 0 0 1em; }
.legal-dl dt { margin-top: 14px; font-weight: 700; color: var(--ts-text); }
.legal-dl dt:first-child { margin-top: 0; }
.legal-dl dd { margin: 4px 0 0; color: var(--ts-text-2); }

.legal-table-wrap { margin: 0 0 1em; border: 1px solid var(--ts-border-2); }
.legal-table { font-size: 14px; line-height: 1.45; }
.legal-table caption {
  padding: 12px 14px 10px;
  caption-side: top;
  text-align: left;
  font-weight: 700;
  color: var(--ts-text);
  background: #fff;
}
.legal-table tbody th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ts-border-2);
  background: #fff;
  color: var(--ts-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: top;
}
.legal-table tbody tr:last-child th { border-bottom: 0; }
.legal-table td { color: var(--ts-text-2); }
.legal-table-severity { min-width: 680px; }
.legal-table-severity td:nth-child(n+3) { color: var(--ts-text); font-weight: 600; white-space: nowrap; }

.legal-foot {
  max-width: 820px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--ts-border-2);
  font-size: 13.5px;
  color: var(--ts-text-2);
}

/* 404 / 405 ------------------------------------------------------------- */
.nf {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin: 16px 0 4px;
  padding: 20px;
}
.nf-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 140px;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  background:
    radial-gradient(circle at 80% 15%, rgba(255, 255, 255, .18), transparent 45%),
    linear-gradient(135deg, var(--ts-navy-700), var(--ts-steel));
  color: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-2);
}
.nf-tree { width: 62%; height: auto; margin-bottom: 18%; }
.nf-tree g[fill] circle { fill: var(--ts-orange); }
.nf-code {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
}
.nf-body { min-width: 0; }
.nf-title { margin: 0 0 8px; font-size: 22px; line-height: 1.25; }
.nf-text { max-width: 640px; margin: 0 0 18px; color: var(--ts-text-2); }

.nf-search { display: flex; max-width: 640px; height: 46px; }
.nf-search-input {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid #888c8c;
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: #fff;
  font-size: 16px;
  box-shadow: 0 1px 2px rgba(15, 17, 17, .15) inset;
}
.nf-search-input:focus {
  outline: none;
  border-color: var(--ts-blue);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .25);
}
.nf-search-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 56px;
  padding: 0;
  border: 1px solid var(--ts-orange-border);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--ts-orange);
  color: var(--ts-text);
  transition: background-color .15s;
}
.nf-search-btn:hover { background: var(--ts-orange-hover); }
.nf-search-btn:focus-visible { outline: var(--focus); outline-offset: 2px; border-radius: 0 var(--radius) var(--radius) 0; }
.nf-search-btn .icon { width: 22px; height: 22px; }

.nf-popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 18px; }
.nf-popular-label { margin-right: 2px; font-size: 13px; font-weight: 600; color: var(--ts-text-2); }
.nf-popular .chip { min-height: 30px; padding: 0 12px; font-size: 13px; }
.nf-actions .btn { white-space: normal; }

/* Responsive ------------------------------------------------------------- */
@media (min-width: 768px) {
  .about-hero { grid-template-columns: minmax(0, 1fr) 240px; padding: 40px 40px; }
  .about-hero-art { display: block; }
  .about-hero-title { font-size: 34px; }
  .about-hero-lead { font-size: 17px; }
  .about-mission-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .about-mission-quote { font-size: 30px; }
  .about-cta { padding: 28px 32px; }

  .legal-doc { padding: 28px 36px 32px; }

  .nf { grid-template-columns: 220px minmax(0, 1fr); gap: 36px; padding: 32px 36px; }
  .nf-art { width: 100%; }
  .nf-code { right: 16px; bottom: 12px; font-size: 48px; }
  .nf-title { font-size: 28px; }
}

@media (min-width: 1024px) {
  .about-hero { grid-template-columns: minmax(0, 1fr) 280px; padding: 48px 56px; }
  .about-hero-title { font-size: 40px; }
  .about-hero-tree { width: 250px; }

  .steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; }
  .step { grid-template-columns: minmax(0, 1fr); }
  .step-marker { grid-row: auto; margin-bottom: 14px; }
  .step:not(:last-child)::before {
    top: 23px;
    right: -16px;
    bottom: auto;
    left: 64px;
    width: auto;
    height: 2px;
    background: linear-gradient(90deg, var(--ts-blue-100), var(--ts-border-2));
  }

  .contact-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }

  .legal-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 24px; }
  .legal-aside {
    order: 0;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .legal-toc { display: block; }
  .legal-toc-mobile { display: none; }
  .legal-doc { padding: 36px 48px 40px; }
}

@media (min-width: 1280px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr) 380px; }
}

@media (max-width: 479px) {
  .about-hero-actions .btn,
  .contact-success-actions .btn,
  .nf-actions .btn:not(.btn-link) { width: 100%; }
  .contact-success-head { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .cat-tile:hover .cat-tile-chevron,
  .commit-card-link:hover .icon { transform: none; }
}

@media print {
  .legal-aside,
  .legal-toc-mobile,

  .nf-search,
  .contact-aside { display: none !important; }
  .legal-layout,
  .contact-layout { display: block; }
  .legal-doc { padding: 0; box-shadow: none; border: 0; }
  .legal-caps { background: none; border-left: 2px solid #999; }
  .about-hero { background: none; color: #000; box-shadow: none; border: 1px solid #ccc; }
  .about-hero-title, .about-hero-lead { color: #000; }
}
