/* ===================================================================
   Founders 3PL — Tool Pages (IEEPA Tariff Tools)
   Scoped under body.tool-page / .tool-container
   Uses design tokens from style.css
   =================================================================== */

/* --- How It Works --- */

.how-it-works {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  margin-bottom: var(--space-xl);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
}

.how-it-works li {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding-left: var(--space-md);
  border-left: 2px solid var(--border-rule);
}

.how-it-works li strong {
  color: var(--navy);
  display: block;
  font-size: var(--text-base);
  margin-bottom: 2px;
}

/* --- Refund Hero Card --- */

.refund-hero {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  background: var(--navy);
  color: var(--cream);
  border-radius: 4px;
  margin-bottom: var(--space-md);
}

.refund-hero__label {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-on-dark);
  opacity: 0.7;
  margin-bottom: var(--space-xs);
}

.refund-hero__value {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: 500;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.refund-hero__sub {
  font-size: var(--text-sm);
  color: var(--text-on-dark);
  opacity: 0.7;
}

/* --- Section Rule --- */

.section-rule {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: var(--space-xl) 0;
}

/* --- Form Field Labels --- */

.form-field {
  margin-bottom: var(--space-sm);
}

.form-field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

/* --- Focus Visible --- */

.lead-gate__submit:focus-visible,
.lead-gate__field:focus-visible,
.drop-zone:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* --- Tool Container --- */

.tool-container {
  max-width: var(--width-content);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg) var(--space-4xl);
}

.tool-container > section {
  margin-bottom: var(--space-2xl);
}

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

.tool-hero {
  margin-bottom: var(--space-xl);
}

.tool-hero h1 {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  color: var(--navy);
  margin-bottom: var(--space-sm);
  line-height: 1.1;
}

.tool-subtitle {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.6;
}

/* --- Upload State --- */

.upload-error {
  color: var(--red-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-top: var(--space-sm);
}

.sample-link {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.format-notice {
  font-size: var(--text-sm);
  color: #2d6a4f;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: var(--space-xs) var(--space-md);
  margin-bottom: var(--space-md);
}

.fix-summary {
  font-size: var(--text-sm);
  color: var(--navy);
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: var(--space-xs) var(--space-md);
  margin-bottom: var(--space-md);
}

.cap-warning {
  font-size: var(--text-sm);
  color: #b8860b;
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: var(--space-xs) var(--space-md);
  margin-bottom: var(--space-md);
}

/* --- Drop Zone --- */

.drop-zone {
  border: 2px dashed var(--border-rule);
  border-radius: 4px;
  background: var(--cream);
  padding: var(--space-3xl) var(--space-2xl);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone:hover {
  border-color: var(--navy);
  background: var(--cream-dark);
}

.drop-zone.drag-active {
  border-color: var(--navy);
  border-style: solid;
  background: var(--cream-dark);
}

.drop-zone__icon {
  font-size: var(--text-4xl);
  line-height: 1;
  margin-bottom: var(--space-md);
  color: var(--text-muted);
}

.drop-zone__text {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.drop-zone__hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* --- Column Mapper --- */

.column-mapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm) var(--space-lg);
  align-items: center;
  padding: var(--space-lg);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: #fff;
}

.column-mapper label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.column-mapper select {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  background: #fff;
  color: var(--text-primary);
}

.column-mapper__notice {
  grid-column: 1 / -1;
  font-size: var(--text-sm);
  color: #2d6a4f;
  background: #e9f5ee;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 3px;
  border-left: 3px solid #2d6a4f;
}

/* --- Summary Cards --- */

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-md);
}

.summary-card {
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  background: #fff;
}

.summary-card__value {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: var(--space-xs);
}

.summary-card__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-card--good .summary-card__value { color: #2d6a4f; }
.summary-card--error .summary-card__value { color: var(--red-muted); }
.summary-card--warning .summary-card__value { color: #b8860b; }

/* --- Validation Tables --- */

.validation-section {
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.validation-section__heading {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  background: var(--cream);
}

.validation-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.validation-table th {
  text-align: left;
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-bottom: 2px solid var(--border-rule);
  background: var(--cream);
  white-space: nowrap;
}

.validation-table td {
  padding: var(--space-xs) var(--space-md);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.validation-table tr.row--error { background: #fdf0f0; }
.validation-table tr.row--warning { background: #fdf8ec; }
.validation-table tr.row--pass { background: #f0faf4; }

.badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.4;
}

.badge--pass { background: #dff5e6; color: #2d6a4f; }
.badge--error { background: #f5dfdf; color: var(--red-muted); }
.badge--warning { background: #fdf3da; color: #b8860b; }
.badge--auto-fix { background: var(--navy); color: var(--cream); }

.fix-hint {
  font-style: italic;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* --- Lead Gate --- */

.lead-gate {
  max-width: 440px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: var(--space-2xl);
  text-align: center;
}

.lead-gate__heading {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

.lead-gate__field {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  margin-bottom: var(--space-sm);
}

.lead-gate__field:focus {
  outline: none;
  border-color: var(--navy);
}

.lead-gate__turnstile {
  margin: var(--space-md) auto;
}

.lead-gate__submit {
  display: inline-block;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  padding: var(--space-sm) var(--space-lg);
  background: var(--navy);
  color: var(--cream);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.lead-gate__submit:hover { background: var(--navy-light); }

.lead-gate__trust {
  margin-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* --- Download Section --- */

.download-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.download-card {
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: var(--space-lg);
  background: #fff;
  text-align: center;
}

.download-card__icon {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-sm);
}

.download-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.download-card__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.download-card__btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-xs) var(--space-lg);
  background: var(--navy);
  color: var(--cream);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
}

.download-card__btn:hover { background: var(--navy-light); }

/* --- CTA Band --- */

.cta-band {
  background: var(--navy);
  color: var(--cream);
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
}

.cta-band__heading {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  margin-bottom: var(--space-sm);
}

.cta-band__desc {
  font-size: var(--text-base);
  color: var(--text-on-dark);
  margin-bottom: var(--space-lg);
  max-width: var(--width-narrow);
  margin-inline: auto;
}

.cta-band__btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  padding: var(--space-sm) var(--space-2xl);
  background: var(--cream);
  color: var(--navy);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cta-band__btn:hover { opacity: 0.9; }

/* --- Trust Badge --- */

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2d6a4f;
  border: 1px solid #2d6a4f;
  border-radius: 3px;
  padding: 2px 8px;
}

/* --- Processing Overlay --- */

.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.processing-overlay__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: tool-spin 0.8s linear infinite;
  margin-bottom: var(--space-md);
}

@keyframes tool-spin { to { transform: rotate(360deg); } }

.processing-overlay__text {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--cream);
  font-weight: 500;
}

/* --- Share Button --- */

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  background: var(--navy);
  color: var(--cream);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
}

.share-btn:hover { background: var(--navy-light); }

/* --- Tool Counter --- */

.tool-counter {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-sm) 0;
}

/* --- All Clear --- */

.all-clear {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
}

.all-clear p {
  color: #2d6a4f;
  font-weight: 500;
  margin: 0;
}

/* --- Issues intro --- */

.issues-intro {
  color: var(--red-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

/* --- Download single card --- */

.download-single {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  margin-bottom: var(--space-2xl);
}

.download-single .download-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin: var(--space-sm) 0;
}

.download-single .download-desc {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
}

/* --- SEO Content Section --- */

.seo-content {
  max-width: var(--width-narrow);
  margin: var(--space-3xl) auto 0;
}

.seo-content h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--navy);
  margin: var(--space-2xl) 0 var(--space-sm);
}

.seo-content h2:first-of-type {
  margin-top: var(--space-lg);
}

.seo-content p,
.seo-content li {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.seo-content ol,
.seo-content ul {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.seo-content details {
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-md) 0;
}

.seo-content summary {
  font-weight: 600;
  font-size: var(--text-base);
  cursor: pointer;
  color: var(--navy);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.seo-content summary::-webkit-details-marker { display: none; }

.seo-content summary::after {
  content: '+';
  font-size: var(--text-xl);
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.seo-content details[open] summary::after {
  content: '\2212';
}

.seo-content details p {
  margin-top: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .tool-container {
    padding: var(--space-lg) var(--space-md) var(--space-3xl);
  }

  .tool-hero h1 {
    font-size: var(--text-3xl);
  }

  .tool-subtitle {
    font-size: var(--text-base);
  }

  .how-it-works {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .refund-hero__value {
    font-size: var(--text-4xl);
  }

  .summary-cards {
    grid-template-columns: 1fr 1fr;
  }

  .summary-card__value {
    font-size: var(--text-2xl);
  }

  .drop-zone {
    padding: var(--space-2xl) var(--space-md);
  }

  .download-section {
    grid-template-columns: 1fr;
  }

  .validation-section {
    overflow-x: auto;
  }

  .validation-table {
    min-width: 500px;
  }

  .lead-gate {
    padding: var(--space-lg);
  }

  .lead-gate__submit {
    min-height: 44px;
    font-size: var(--text-base);
  }

  .cta-band__btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .column-mapper {
    grid-template-columns: 1fr;
  }

  .cta-band {
    padding: var(--space-2xl) var(--space-md);
  }
}
