/* ========== Base ========== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 17px; overflow-x: hidden; }
body { overflow-x: hidden; }

/* ========== Slider ========== */
.slider {
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, #16a34a var(--fill, 0%), #e2e8f0 var(--fill, 0%));
  outline: none; cursor: pointer; width: 100%;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: #16a34a; cursor: pointer;
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: #16a34a; cursor: pointer;
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* ========== Term Buttons ========== */
.term-btn {
  padding: 6px 2px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  background: #fff; font-size: 12px; font-weight: 600;
  color: #64748b; cursor: pointer; transition: all .2s; text-align: center;
}
.term-btn:hover { border-color: #16a34a; color: #16a34a; }
.term-btn.active { background: #16a34a; border-color: #16a34a; color: #fff; }

/* ========== Animations ========== */
.funnel-modal { animation: slideUp .3s ease-out; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.dot1,.dot2,.dot3 { animation: blink 1.4s infinite; }
.dot2 { animation-delay: .2s; }
.dot3 { animation-delay: .4s; }
@keyframes blink { 0%,80%,100% { opacity: 0; } 40% { opacity: 1; } }

@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 0 0 rgba(22,163,74,.4); }
  50% { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
}
.pulse-cta { animation: pulse-green 2s infinite; }

/* ========== Cards ========== */
.offer-card {
  background: #fff; border: 1.5px solid #e5e7eb; border-radius: 12px;
  padding: 16px; transition: all .2s;
}
.offer-card:hover { border-color: #16a34a; box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.offer-card.best { border-color: #16a34a; box-shadow: 0 2px 8px rgba(22,163,74,.08); }

.ranking-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  border: 1.5px solid #e5e7eb; transition: all .2s;
}
.ranking-card:hover { border-color: #16a34a; box-shadow: 0 4px 12px rgba(0,0,0,.06); }

.ranking-card .rank-badge {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; color: #fff; flex-shrink: 0;
}
.ranking-card:nth-child(1) .rank-badge { background: #16a34a; }
.ranking-card:nth-child(2) .rank-badge { background: #1a56db; }
.ranking-card:nth-child(3) .rank-badge { background: #f59e0b; }
.ranking-card:nth-child(n+4) .rank-badge { background: #9ca3af; }

.blog-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  border: 1.5px solid #e5e7eb; transition: all .2s;
}
.blog-card:hover { border-color: #1a56db; box-shadow: 0 4px 12px rgba(0,0,0,.06); }

/* ========== Badges ========== */
.check-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; background: #f0fdf4; border-radius: 50%; flex-shrink: 0;
}
.check-icon svg { width: 11px; height: 11px; color: #16a34a; }

.badge-free {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; background: #f0fdf4; color: #16a34a;
  font-size: 10px; font-weight: 700; border-radius: 999px; border: 1px solid #bbf7d0;
}
.badge-best {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; background: #16a34a; color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px;
}
.badge-category {
  display: inline-flex; padding: 2px 8px; border-radius: 999px;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}

/* ========== Misc ========== */
.stars { color: #f59e0b; letter-spacing: -1px; font-size: 13px; }

.lender-logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; color: #0f2d5e;
}

/* ========== Nav ========== */
.nav-dropdown-menu { margin-top: 0; }
.nav-dropdown { position: relative; }
details summary { list-style: none; }
details summary::-webkit-details-marker { display: none; }

/* ========== Scrollbar - hide on funnel ========== */
.funnel-card::-webkit-scrollbar { display: none; }
.funnel-card { -ms-overflow-style: none; scrollbar-width: none; }
#funnel-step-offers::-webkit-scrollbar { display: none; }
#funnel-step-offers { -ms-overflow-style: none; scrollbar-width: none; }

/* ========== Content Prose ========== */
.content-prose { font-size: 1rem; line-height: 1.8; color: #475569; overflow-wrap: break-word; word-wrap: break-word; }
.content-prose h2 { font-size: 1.4rem; font-weight: 800; color: #0f2d5e; margin: 2rem 0 0.75rem; }
.content-prose h3 { font-size: 1.2rem; font-weight: 700; color: #0f2d5e; margin: 1.5rem 0 0.5rem; }
.content-prose p { color: #475569; line-height: 1.8; margin-bottom: 1rem; font-size: 1rem; }
.content-prose ul, .content-prose ol { color: #475569; padding-left: 1.5rem; margin-bottom: 1.25rem; }
.content-prose ul { list-style: disc; }
.content-prose ol { list-style: decimal; }
.content-prose li { margin-bottom: 0.5rem; line-height: 1.75; font-size: 1rem; }
.content-prose a { color: #1a56db; text-decoration: underline; text-underline-offset: 2px; }
.content-prose a:hover { color: #0f2d5e; }
.content-prose strong { color: #0f2d5e; }
.content-prose blockquote {
  border-left: 3px solid #16a34a; background: #f0fdf4;
  padding: 0.75rem 1rem; border-radius: 0 8px 8px 0; margin: 1.25rem 0;
}
.content-prose blockquote strong { color: #16a34a; }

/* ========== Info Boxes ========== */
.info-box {
  border-radius: 10px; padding: 1rem 1.25rem; margin: 1.5rem 0;
  font-size: 0.95rem; line-height: 1.75; display: flex; gap: 0.6rem;
  align-items: flex-start; border-left: 3px solid;
}
.info-box .info-icon { font-size: 1.1rem; flex-shrink: 0; }
.info-box-blue { background: #eff6ff; border-left-color: #1a56db; color: #1e40af; }
.info-box-green { background: #f0fdf4; border-left-color: #16a34a; color: #166534; }
.info-box-yellow { background: #fefce8; border-left-color: #f59e0b; color: #854d0e; }
.info-box-red { background: #fef2f2; border-left-color: #ef4444; color: #991b1b; }

/* ========== Tables ========== */
.content-prose table, .prose-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: 1.25rem 0; border-radius: 8px; overflow: hidden;
  border: 1px solid #e5e7eb; font-size: 0.825rem;
}
.content-prose table thead th, .prose-table thead th {
  background: #0f2d5e; color: #fff; font-weight: 600;
  padding: 0.6rem 0.75rem; text-align: left; font-size: 0.8rem;
}
.content-prose table tbody td, .prose-table tbody td {
  padding: 0.6rem 0.75rem; border-bottom: 1px solid #f3f4f6; color: #475569;
}
.content-prose table tbody tr:last-child td, .prose-table tbody tr:last-child td { border-bottom: none; }
.content-prose table tbody tr:nth-child(even), .prose-table tbody tr:nth-child(even) { background: #f8fafc; }
.content-prose table tbody td strong, .prose-table tbody td strong { color: #0f2d5e; }

/* ========== TOC ========== */
.toc {
  background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 1rem 1.25rem;
}
.toc-title { font-weight: 700; color: #0f2d5e; font-size: 0.875rem; margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.4rem; }
.toc a { display: block; padding: 3px 0; color: #64748b; font-size: 0.8rem; transition: color .2s; }
.toc a:hover { color: #1a56db; }

/* ========== Lender Profile ========== */
.pros-list li::before { content: "✅ "; }
.cons-list li::before { content: "⚠️ "; }
.pros-list li, .cons-list li { list-style: none; padding-left: 0; }
.pros-list, .cons-list { padding-left: 0; }

/* ========== Article/Glossary Cards ========== */
.article-card {
  background: #fff; border-radius: 12px; border: 1.5px solid #e5e7eb;
  overflow: hidden; transition: all .2s; display: flex; flex-direction: column; height: 100%;
}
.article-card:hover { border-color: #1a56db; box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.article-card .card-accent { height: 3px; background: linear-gradient(90deg, #1a56db, #16a34a); }
.article-card .card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.article-card .card-meta { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.article-card .card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.article-card .card-title { font-weight: 700; color: #0f2d5e; font-size: 0.95rem; line-height: 1.4; margin-bottom: 0.4rem; }
.article-card:hover .card-title { color: #1a56db; }
.article-card .card-excerpt { font-size: 0.8rem; color: #64748b; line-height: 1.6; flex: 1; }
.article-card .card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 0.75rem; margin-top: auto; border-top: 1px solid #f3f4f6; }
.article-card .card-footer span { font-size: 0.7rem; color: #9ca3af; }
.article-card .card-arrow { width: 28px; height: 28px; border-radius: 6px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; color: #9ca3af; transition: all .2s; }
.article-card:hover .card-arrow { background: #1a56db; color: #fff; }

.glossary-card {
  background: #fff; border-radius: 12px; border: 1.5px solid #e5e7eb; padding: 1.25rem;
  transition: all .2s; display: flex; flex-direction: column; height: 100%;
}
.glossary-card:hover { border-color: #1a56db; box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.glossary-card .glossary-icon { width: 44px; height: 44px; border-radius: 10px; background: #eff6ff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 0.75rem; }
.glossary-card .glossary-title { font-weight: 700; color: #0f2d5e; font-size: 0.95rem; margin-bottom: 0.35rem; }
.glossary-card:hover .glossary-title { color: #1a56db; }
.glossary-card .glossary-desc { font-size: 0.8rem; color: #64748b; line-height: 1.6; flex: 1; }
.glossary-card .glossary-link { font-size: 0.75rem; color: #1a56db; font-weight: 600; margin-top: 0.6rem; display: inline-flex; align-items: center; gap: 3px; }

/* ========== Article Hero ========== */
.article-hero { background: linear-gradient(135deg, #0f2d5e, #1a3f7a); }

/* ========== Author Box ========== */
.author-box-enhanced {
  background: #fff; border-radius: 12px; border: 1.5px solid #e5e7eb; padding: 1.5rem; margin-top: 2rem;
}

/* ========== Sidebar ========== */
.sidebar-toc { position: sticky; top: 70px; }

/* ========== FAQ ========== */
.faq-item { background: #fff; border-radius: 10px; border: 1.5px solid #e5e7eb; transition: all .2s; overflow: hidden; }
.faq-item[open] { border-color: #1a56db; }
.faq-item summary { padding: 1rem 1.25rem; font-weight: 600; color: #0f2d5e; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 0.875rem; }
.faq-item .faq-answer { padding: 0 1.25rem 1rem; font-size: 0.85rem; color: #64748b; line-height: 1.7; }

/* ========== Table Scroll Wrapper ========== */
.content-prose .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.25rem 0; }
.content-prose .table-scroll table { margin: 0; }

/* ========== Responsive ========== */
@media (max-width: 640px) {
  .funnel-modal { border-radius: 12px 12px 0 0; max-height: 95vh; }
  #funnel-step-offers { max-height: 85vh; }
  .content-prose h2 { font-size: 1.2rem; }
  .content-prose h3 { font-size: 1.05rem; }
  .content-prose p, .content-prose li { font-size: 0.9rem; }
  .content-prose table, .prose-table { font-size: 0.8rem; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .info-box { font-size: 0.85rem; }
  .toc a { font-size: 0.75rem; }
  .article-card .card-title { font-size: 0.875rem; }
  .glossary-card .glossary-title { font-size: 0.875rem; }
  .faq-item summary { font-size: 0.8rem; padding: 0.75rem 1rem; }
  .faq-item .faq-answer { font-size: 0.8rem; padding: 0 1rem 0.75rem; }

  /* Funnel form checkbox touch targets */
  #f-agree, #f-marketing { width: 20px; height: 20px; min-width: 20px; min-height: 20px; }

  /* Ranking card stat values - prevent overflow */
  .ranking-card .text-sm.font-bold { font-size: 0.75rem; }
}

/* Extra small screens (320px) */
@media (max-width: 374px) {
  html { font-size: 15px; }
  .content-prose h2 { font-size: 1.1rem; }
  .content-prose p, .content-prose li { font-size: 0.85rem; }
}
