/**
 * madestool — Shared Tool Page CSS
 * Common patterns used across multiple calculator/tool pages.
 * Loads AFTER shared/css/theme.css, BEFORE page-specific inline <style>.
 *
 * Includes:
 *   - .breadcrumb            (page header crumb)
 *   - .related-tools / grid  (footer "more tools" widget — matches related-tools.js output)
 *   - .aff-section (long)    (affiliate CTA block, hero-card style)
 *   - .container             (standard 1080-1100px page wrap)
 *   - .field / .input / .select (calculator form controls)
 *   - .card / .card-title    (calculator surface)
 *   - .footer                (page footer)
 *
 * NOTE: Does NOT redefine anything already in theme.css (.faq-*, .rel-*,
 * .btn, .mdt-nav, .badge, table, base typography, etc.). Page-specific
 * inline <style> may still override anything here.
 */

/* ─────────────────────────────────────────────
   Container
───────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─────────────────────────────────────────────
   Breadcrumb
───────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0 0 14px;
}
.breadcrumb a {
  color: #93c5fd;
  text-decoration: none;
}
.breadcrumb a:hover {
  color: #bfdbfe;
}

/* ─────────────────────────────────────────────
   Generic Card (calculator surface)
───────────────────────────────────────────── */
.card {
  background: var(--card-bg, rgba(30, 41, 59, 0.7));
  border: 1px solid var(--border, rgba(59, 130, 246, 0.15));
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}
.card-title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary, #cbd5e1);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title span { font-size: 1.2rem; }
.card-title svg { color: var(--blue-400, #60a5fa); flex-shrink: 0; }

/* ─────────────────────────────────────────────
   Form Fields (calculator inputs)
───────────────────────────────────────────── */
.field {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}
.field label {
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.input, .select {
  width: 100%;
  background: #0b1225;
  border: 1px solid var(--border, rgba(59, 130, 246, 0.15));
  border-radius: 10px;
  color: #e6ebff;
  padding: 9px 12px;
  box-sizing: border-box;
  font-size: 0.93rem;
  font-family: var(--font-sans, "Sarabun", system-ui, sans-serif);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.input::placeholder { color: var(--text-dim, #64748b); }
.input:focus, .select:focus {
  border-color: var(--blue-500, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* ─────────────────────────────────────────────
   Related Tools widget
   (matches output of shared/js/related-tools.js)
───────────────────────────────────────────── */
.related-tools {
  max-width: 1080px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
}
.related-tools h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 1rem;
}
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}
.related-tool-card {
  display: flex;
  flex-direction: column;
  padding: 0.875rem 1rem;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.related-tool-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.related-tool-icon { font-size: 1.25rem; margin-bottom: 0.25rem; }
.related-tool-name { font-weight: 600; font-size: 0.9rem; color: #f8fafc; }
.related-tool-desc { font-size: 0.8rem; color: #94a3b8; margin-top: 0.25rem; }

/* ─────────────────────────────────────────────
   Affiliate Section (long-form, used by loan-calculator)
   NOTE: theme.css has a compact .aff-section variant; this overrides
   it for pages that load tool-page.css.
───────────────────────────────────────────── */
.aff-section {
  max-width: 1100px;
  margin: 0 auto 22px;
  padding: 18px 22px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.aff-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.aff-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #f8fafc;
}
.aff-tag {
  font-size: 0.7rem;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.aff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.aff-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.15);
  background: rgba(15, 23, 42, 0.4);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.aff-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.aff-ico { font-size: 1.5rem; flex-shrink: 0; }
.aff-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.aff-info strong { font-size: 0.88rem; color: #f8fafc; font-weight: 700; }
.aff-info small { font-size: 0.76rem; color: #94a3b8; line-height: 1.35; }
.aff-go { font-size: 0.77rem; color: #93c5fd; font-weight: 700; white-space: nowrap; }
.aff-note { margin: 11px 0 0; font-size: 0.72rem; color: #94a3b8; }
@media (max-width: 600px) {
  .aff-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────
   Page Footer (shared style)
───────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border, rgba(59, 130, 246, 0.15));
  padding: 24px 20px 32px;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 0.86rem;
}
.footer a {
  color: var(--blue-300, #93c5fd);
  text-decoration: none;
  font-weight: 600;
}
.footer a:hover { color: var(--blue-200, #bfdbfe); }
.footer-row { margin-bottom: 8px; }
