/* ===== PrimeForge — clean industrial design ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --bg-dark: #0f1419;
  --text: #1a1f26;
  --text-muted: #5c6570;
  --text-light: #8b949e;
  --border: #e4e7eb;
  --border-strong: #d0d5dd;
  --primary: #0066ff;
  --primary-hover: #0052cc;
  --primary-light: #e8f0ff;
  --success: #0d9488;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: 720px; }

/* ===== Shared mounts (header injected into #site-header) ===== */
/* display: contents so children participate in body flow — required for
   position:sticky on .header (a short wrapper would kill sticky) */
#site-header {
  display: contents;
}
#site-footer {
  display: contents;
}

/* ===== Announcement ===== */
.announce-bar {
  background: var(--bg-dark);
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  letter-spacing: 0.01em;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

/* Image logos (paths set in partials/header.js and partials/footer.js) */
.logo-img {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
}
.logo-img--nav {
  height: 56px;
  max-width: 300px;
}
.logo-img--footer {
  height: 56px;
  max-width: 300px;
}
.logo-fallback {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-fallback[hidden] {
  display: none !important;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border-radius: 8px;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.nav-active { color: var(--primary); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.mobile-menu-btn:focus-visible {
  outline: 2px solid var(--primary, #1976d2);
  outline-offset: 2px;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav[hidden] { display: none !important; }
.mobile-nav a {
  font-size: 15px;
  font-weight: 500;
  padding: 10px 0;
  color: var(--text);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; padding: 14px 20px; }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:focus-visible {
  outline-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.25);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-alt); }
.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.btn-text:hover { text-decoration: underline; }
.btn-text:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== Hero ===== */
.hero {
  padding: 72px 0 80px;
  background: linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.hero-badge .stars { color: #f59e0b; letter-spacing: 1px; }

.hero h1 {
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
  color: var(--text);
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 28px;
  line-height: 1.55;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.stat span {
  font-size: 13px;
  color: var(--text-muted);
}

/* Hero visual — image carousel */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
  border: none;
  box-shadow: none;
  outline: none;
}
.hero-carousel:focus-visible {
  box-shadow: var(--shadow-lg), 0 0 0 3px rgba(25, 118, 210, 0.35);
}
.hero-carousel-track {
  position: absolute;
  inset: 0;
}
.hero-carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.hero-carousel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.hero-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
}
/* ===== Trust strip ===== */
.trust-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 20px 0;
}
.trust-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.trust-item svg { flex-shrink: 0; color: var(--primary); opacity: 0.8; }

/* ===== Sections ===== */
.section {
  padding: 80px 0;
}
.section-alt { background: var(--bg-alt); }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.section-header h2 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.2;
}
.section-header p {
  font-size: 17px;
  color: var(--text-muted);
}

/* ===== Steps ===== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.step-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.step-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ===== Materials ===== */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.material-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.material-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
/* Full materials page cards with top image */
.material-card--with-media {
  padding: 0;
  /* overflow visible so color tooltips can extend past the card edges */
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.material-card--with-media:hover {
  z-index: 5; /* paint above neighboring cards while inspecting swatches */
}
.material-card-media {
  position: relative;
  aspect-ratio: 1 / 1; /* square — matches material product photos */
  background: linear-gradient(145deg, #e8eef8 0%, #f0f4ff 45%, #e4e7eb 100%);
  overflow: hidden; /* only clip the photo, not tooltips in the body */
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.material-card-media-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.material-card-media-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.material-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* show full image without cropping */
  display: block;
  pointer-events: none;
}

.material-photo-lightbox {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: none;
  padding: 16px 16px 20px;
  max-width: min(960px, calc(100vw - 32px));
  width: auto;
  max-height: min(92vh, 960px);
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.material-photo-lightbox::backdrop {
  background: rgba(15, 20, 25, 0.65);
  backdrop-filter: blur(2px);
}
.material-photo-lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}
.material-photo-lightbox-close:hover {
  background: #f0f2f5;
}
.material-photo-lightbox img {
  display: block;
  max-width: min(900px, calc(100vw - 64px));
  max-height: min(80vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}
.material-photo-lightbox-caption {
  margin: 12px 40px 0 0;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}
.material-card-media.is-placeholder::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-light);
  pointer-events: none;
}
.material-card-body {
  padding: 20px 24px 24px;
  flex: 1;
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.material-card-body .material-swatches {
  margin-bottom: 14px;
}
.material-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: auto;
  padding-top: 14px;
}
.material-props-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
}
.material-props-btn:hover {
  color: var(--primary);
  text-decoration: underline;
}
.material-card-link {
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.material-card-link:hover {
  text-decoration: underline;
}
.section-materials-page {
  padding-top: 24px;
}

/* Material properties modal */
.material-props-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  border: none;
  padding: 0;
  max-width: min(680px, calc(100vw - 32px));
  width: 100%;
  max-height: min(90vh, 900px);
  height: fit-content;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  background: #fff;
  color: var(--text);
}
.material-props-modal::backdrop {
  background: rgba(15, 20, 25, 0.55);
  backdrop-filter: blur(2px);
}
.material-props-dialog {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 900px);
}
.material-props-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.material-props-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0;
  padding-right: 8px;
}
.material-props-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.material-props-close:hover {
  background: var(--border);
  color: var(--text);
}
.material-props-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.material-props-variant {
  font-size: 15px;
  font-weight: 700;
  margin: 20px 0 10px;
  color: var(--text);
}
.material-props-variant:first-child {
  margin-top: 4px;
}
.material-props-section {
  margin-bottom: 14px;
}
.material-props-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.material-props-table-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.material-props-note {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.material-props-empty {
  font-size: 14px;
  color: var(--text-muted);
}
.material-swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  overflow: visible;
  position: relative;
  z-index: 1;
}
/* Swatches: span = display-only; button = has sample image */
.material-swatches .material-swatch {
  position: relative;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  box-sizing: border-box;
  cursor: default;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  line-height: 0;
  background-clip: padding-box;
}
.material-swatches .material-swatch--has-image {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.material-swatches .material-swatch--has-image:hover {
  transform: scale(1.12);
}
.material-swatches .material-swatch--has-image:focus-visible {
  outline: 2px solid var(--primary, #1976d2);
  outline-offset: 2px;
}
.material-swatches .material-swatch.is-selected {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--primary, #1976d2);
  border-color: transparent;
}
/* Hide a swatch without deleting it:
   set hidden: true on the color in materials-data.js
*/
.material-swatches .material-swatch.is-hidden {
  display: none !important;
}
/* Color-name tooltip on hover and keyboard focus */
.material-swatches .material-swatch[data-color-name]:hover,
.material-swatches .material-swatch[data-color-name]:focus-visible {
  z-index: 30;
}
.material-swatches .material-swatch[data-color-name]:hover::after,
.material-swatches .material-swatch[data-color-name]:focus-visible::after {
  content: attr(data-color-name);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--bg-dark, #0f1419);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  z-index: 40;
  pointer-events: none;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.15));
}
.material-swatches .material-swatch[data-color-name]:hover::before,
.material-swatches .material-swatch[data-color-name]:focus-visible::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-dark, #0f1419);
  z-index: 40;
  pointer-events: none;
}
.material-swatches .material-swatch[role="img"]:focus-visible {
  outline: 2px solid var(--primary, #1976d2);
  outline-offset: 2px;
}
.material-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.material-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.material-card > p:not(.material-tag),
.material-card-body > p:not(.material-tag) {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.material-specs {
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
}
.material-specs li {
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}
.material-specs li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}
.materials-cta {
  text-align: center;
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ===== Quote page ===== */
.page-hero {
  padding: 48px 0 8px;
  background: linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%);
  text-align: center;
}
.page-hero h1 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.2;
}
.page-hero p {
  font-size: 17px;
  color: var(--text-muted);
}
.page-hero .legal-updated {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
}
/* ===== Legal pages (Terms / Privacy) ===== */
.section-legal {
  padding-top: 24px;
  padding-bottom: 80px;
  /* Ensure sticky TOC is not clipped by a scroll/overflow ancestor */
  overflow: visible;
}
.section-legal .container {
  overflow: visible;
}
.legal-layout {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  max-width: 960px;
  margin: 0 auto;
  overflow: visible;
}

/* Table of contents (sticky sidebar)
   Pinning is handled by legal.js (position: fixed) for reliability. */
.legal-toc-spacer {
  flex: 0 0 240px;
  width: 240px;
  min-width: 240px;
  pointer-events: none;
  visibility: hidden;
}
.legal-toc-aside {
  flex: 0 0 240px;
  width: 240px;
  align-self: flex-start;
}
.legal-toc-aside.is-pinned {
  /* position/top/left/width set inline by legal.js */
  z-index: 50;
}
.legal-toc {
  padding: 20px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.legal-toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.legal-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  counter-reset: toc;
}
.legal-toc-list li {
  margin: 0;
  padding: 0;
  counter-increment: toc;
}
.legal-toc-list a {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.legal-toc-list a:hover {
  color: var(--primary);
  background: var(--primary-light);
  text-decoration: none;
}
.legal-toc-list a::before {
  content: counter(toc) ". ";
  font-weight: 600;
  color: var(--text-light);
}

.legal-content {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
}
.legal-content h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 36px;
  margin-bottom: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--text);
  scroll-margin-top: 96px;
}
.legal-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 28px;
}
.legal-content h3 {
  font-size: 15px;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--text);
}
.legal-content p {
  margin-bottom: 14px;
  color: var(--text-muted);
}
.legal-content p strong {
  color: var(--text);
  font-weight: 600;
}
.legal-content ul {
  margin: 0 0 16px;
  padding-left: 1.25em;
  color: var(--text-muted);
}
.legal-content li {
  margin-bottom: 8px;
  padding-left: 4px;
}
.legal-content li strong {
  color: var(--text);
  font-weight: 600;
}
.legal-content a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}
.legal-content a:hover {
  text-decoration: underline;
}
.legal-content .legal-caps {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.65;
}
.legal-content .legal-meta {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

@media (max-width: 900px) {
  .legal-layout {
    flex-direction: column;
    gap: 28px;
  }
  .legal-toc-spacer {
    display: none !important;
  }
  .legal-toc-aside {
    position: static !important;
    flex: none;
    width: 100% !important;
    max-height: none !important;
    left: auto !important;
    top: auto !important;
    overflow: visible !important;
  }
  .legal-toc-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 12px;
  }
}

@media (max-width: 520px) {
  .legal-toc-list {
    grid-template-columns: 1fr;
  }
}

/* Upload CTA band on homepage (clean link-out to quoting app) */
.upload-cta-band {
  background: linear-gradient(145deg, #f4f7ff 0%, #eef3ff 42%, #f8f9fb 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(40px, 6vw, 64px) clamp(24px, 5vw, 48px);
  text-align: center;
  box-shadow: var(--shadow);
}
.upload-cta-content {
  max-width: 640px;
  margin: 0 auto;
}
.upload-cta-band h2 {
  font-size: clamp(26px, 3.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  line-height: 1.2;
  color: var(--text);
}
.upload-cta-band p {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 28px;
  line-height: 1.55;
}
.upload-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 18px;
}
.upload-cta-note {
  font-size: 13px !important;
  color: var(--text-light) !important;
  margin: 0 !important;
  line-height: 1.45 !important;
}
@media (max-width: 560px) {
  .upload-cta-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .upload-cta-actions .btn {
    width: 100%;
  }
}

/* Shared form + info-card styles (contact page) */
.info-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.info-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}
.info-card ul {
  list-style: none;
  font-size: 14px;
  color: var(--text-muted);
}
.info-card li {
  padding: 5px 0;
  padding-left: 18px;
  position: relative;
}
.info-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.info-card p { font-size: 14px; margin-bottom: 6px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.form-group textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.5;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,102,255,0.12);
}

/* ===== Contact page ===== */
.section-contact {
  padding-top: 24px;
}
.contact-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 32px;
  align-items: start;
  max-width: 960px;
  margin: 0 auto;
}
.contact-form-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.contact-mailto-note {
  margin: 0 0 20px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--bg-alt, #f5f7fa);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
}
.optional-label {
  font-weight: 500;
  color: var(--text-light, #8a93a0);
}
.contact-char-hint {
  margin: 4px 0 0;
}
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-info-panel a {
  color: var(--primary);
  font-weight: 500;
}
.contact-info-panel a:hover {
  text-decoration: underline;
}
.contact-error {
  color: var(--danger);
  font-size: 14px;
  margin: 4px 0 0;
}
.contact-success {
  background: var(--success-bg);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  margin: 4px 0 8px;
}
.contact-success strong {
  display: block;
  margin-bottom: 4px;
  color: var(--success);
}
.contact-success p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.contact-form-panel .btn-full {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 400;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}
.faq-item p a {
  color: var(--primary);
  font-weight: 500;
}
.faq-item p a:hover {
  text-decoration: underline;
}
.faq-more {
  text-align: center;
  margin-top: 28px;
}
.section-faq-page {
  padding-top: 24px;
}
.faq-page-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.faq-page-cta p {
  width: 100%;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* ===== File guidelines ===== */
.section-file-guidelines {
  padding-top: 24px;
}
.guidelines-intro {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}
.guidelines-intro p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}
.guidelines-intro strong {
  color: var(--text);
}
.guidelines-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.guideline-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}
.guideline-card--preferred {
  border-color: rgba(25, 118, 210, 0.35);
  background: linear-gradient(180deg, #f7faff 0%, #fff 55%);
}
.guideline-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.guideline-list {
  margin: 0;
  padding-left: 1.15em;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guideline-list li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}
.guideline-list li strong {
  color: var(--text);
  font-weight: 600;
}
.guideline-list--warn li {
  color: var(--text);
}
.guideline-note {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-light);
}
.guidelines-cta {
  margin-top: 40px;
  padding: 36px 28px;
  text-align: center;
  background: linear-gradient(145deg, #f4f7ff 0%, #eef3ff 42%, #f8f9fb 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.guidelines-cta h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.guidelines-cta p {
  margin: 0 0 22px;
  font-size: 16px;
  color: var(--text-muted);
}
.guidelines-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
@media (max-width: 768px) {
  .guidelines-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 404 page ===== */
.section-404 {
  padding-top: 8px;
}
.error-404-card {
  text-align: center;
  padding: 32px 24px 40px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.error-404-code {
  font-size: clamp(56px, 12vw, 88px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--primary);
  margin: 0 0 12px;
  opacity: 0.85;
}
.error-404-card > p {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0 0 24px;
}
.error-404-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ===== About page ===== */
.section-about {
  padding-top: 24px;
}
.about-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.85fr;
  gap: 40px;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
}
.about-main h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.about-main h2:not(:first-child) {
  margin-top: 36px;
}
.about-main p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.about-main p strong {
  color: var(--text);
  font-weight: 600;
}
.about-main a {
  color: var(--primary);
  font-weight: 500;
}
.about-main a:hover {
  text-decoration: underline;
}
.about-values {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.about-values li {
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.about-values strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}
.about-values span {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}
.about-steps {
  margin: 0;
  padding-left: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-steps li {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-muted);
}
.about-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.about-aside a:not(.btn) {
  color: var(--primary);
  font-weight: 500;
}
.about-aside a:not(.btn):hover {
  text-decoration: underline;
}
.about-cta {
  max-width: 1000px;
  margin: 48px auto 0;
  padding: 36px 28px;
  text-align: center;
  background: linear-gradient(145deg, #f4f7ff 0%, #eef3ff 42%, #f8f9fb 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.about-cta h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.about-cta p {
  margin: 0 0 22px;
  font-size: 16px;
  color: var(--text-muted);
}
.about-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
@media (max-width: 900px) {
  .about-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== Final CTA ===== */
.final-cta {
  padding: 80px 0;
  background: var(--bg-dark);
  color: #fff;
  text-align: center;
}
.final-cta h2 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.final-cta p {
  font-size: 17px;
  color: #a0a8b0;
  margin-bottom: 28px;
}
.final-cta .btn-primary {
  background: #fff;
  color: var(--bg-dark);
}
.final-cta .btn-primary:hover {
  background: #e8e8e8;
}

/* ===== Footer ===== */
.footer {
  background: #0a0e12;
  color: #a0a8b0;
  padding: 56px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand .logo-text { color: #fff; }
.footer-brand p { font-size: 14px; max-width: 280px; line-height: 1.5; }
.footer-links h5 {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.footer-links a {
  display: block;
  font-size: 14px;
  padding: 5px 0;
  color: #a0a8b0;
  transition: color 0.15s;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #1c232b;
  padding: 20px 24px;
  font-size: 13px;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .hero-card { max-width: 100%; }
  .steps-grid { grid-template-columns: 1fr; }
  .materials-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-links, .nav-actions { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero { padding: 48px 0 56px; }
  .hero-stats { gap: 20px; }
  .materials-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .trust-inner { justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 56px 0; }
  .upload-cta-band { padding: 40px 24px; }
  .page-hero { padding: 36px 0 0; }
}
