/* ===== Base ===== */
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; color: #1e293b; }

/* ===== Range Slider ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #f97316 0%, #f97316 var(--val, 50%), #e2e8f0 var(--val, 50%), #e2e8f0 100%);
  outline: none;
  width: 100%;
  transition: background .1s;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 3px solid #f97316;
  box-shadow: 0 1px 6px rgba(249,115,22,.3);
  transition: box-shadow .2s, transform .15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 12px rgba(249,115,22,.45);
  transform: scale(1.1);
}
input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 3px solid #f97316;
  box-shadow: 0 1px 6px rgba(249,115,22,.3);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(249,115,22,0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-fade-in-up {
  animation: fadeInUp .5s ease-out both;
}
.animate-fade-in {
  animation: fadeIn .4s ease-out both;
}
.animate-slide-in-right {
  animation: slideInRight .5s ease-out both;
}
.animate-spin {
  animation: spin .9s linear infinite;
}
.animate-float {
  animation: float 3s ease-in-out infinite;
}
.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ===== Modal ===== */
#form-modal.hidden { display: none !important; }

/* ===== FAQ ===== */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.25rem !important;
  transition: max-height .35s cubic-bezier(.4,0,.2,1), padding .3s ease;
}
.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 1.25rem 1rem 1.25rem !important;
}
.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}
.faq-chevron {
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

/* ===== Lender card ===== */
.lender-card {
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.lender-card:hover {
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.1);
  border-color: rgba(249,115,22,.3);
  transform: translateY(-2px);
}

/* ===== Loan type card ===== */
.loan-type-icon {
  transition: all .25s ease;
}
.loan-type-card:hover .loan-type-icon {
  background: #f97316;
  color: #fff;
  transform: scale(1.05);
}
.loan-type-card {
  transition: all .25s ease;
}
.loan-type-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -8px rgba(0,0,0,.1);
}

/* ===== Mobile menu ===== */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
#mobile-menu.open {
  max-height: 400px;
}

/* ===== Gradient text ===== */
.text-gradient {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 50%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Glass morphism ===== */
.glass {
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ===== Comparison table ===== */
.comparison-table {
  border-collapse: separate;
  border-spacing: 0;
}
.comparison-table th {
  position: sticky;
  top: 0;
  z-index: 10;
}
.comparison-table tr:hover td {
  background: #fff7ed;
}

/* ===== Benefit card number ===== */
.benefit-number {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all .6s cubic-bezier(.4,0,.2,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Badge pulse ===== */
.badge-recommended {
  position: relative;
}
.badge-recommended::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid rgba(16,185,129,.3);
  animation: pulse-glow 2.5s ease-in-out infinite;
}

/* ===== Blog/Article content ===== */
.article-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #fed7aa;
}
.article-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.article-content p {
  color: #475569;
  line-height: 1.8;
  margin-bottom: 1rem;
}
.article-content ul, .article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.article-content li {
  color: #475569;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}
.article-content a {
  color: #f97316;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-content a:hover {
  color: #ea580c;
}
.article-content blockquote {
  border-left: 4px solid #f97316;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: #fff7ed;
  border-radius: 0 0.75rem 0.75rem 0;
}

/* ===== Smooth button ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: all .2s ease;
  box-shadow: 0 4px 14px rgba(249,115,22,.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249,115,22,.4);
}

/* ===== Review star visual ===== */
.star-filled { color: #f59e0b; }
.star-empty { color: #e5e7eb; }

/* =====================================================
   SUBPAGE GLOBAL ENHANCEMENTS
   Applied to all landing pages, blogs, reviews, tools
   ===================================================== */

/* --- Section spacing & alternating bg --- */
main > section {
  position: relative;
}
main > section:nth-child(even) {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

/* --- Section headings enhanced --- */
main section h2 {
  letter-spacing: -0.02em;
}

/* --- Prose/content blocks --- */
.prose p, main section > div > div > .space-y-5 > p,
main section > div > div > .prose-lg > p {
  font-size: 1rem;
  line-height: 1.85;
  color: #475569;
}

/* --- Card enhancements (benefit cards, requirement cards, etc.) --- */
main section .bg-primary-50,
main section [class*="bg-primary-50"],
main section [class*="bg-orange-50"] {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%) !important;
  border: 1px solid rgba(249,115,22,.1);
}

/* --- Info/stat boxes inside offer cards --- */
main section .bg-gray-50[class*="rounded"] {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
}

/* --- Offer card row enhanced --- */
main section .shadow-sm.border.border-gray-100 {
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
main section .shadow-sm.border.border-gray-100:hover {
  box-shadow: 0 12px 28px -6px rgba(0,0,0,.1);
  border-color: rgba(249,115,22,.25);
  transform: translateY(-2px);
}

/* --- Accent checkmark cards --- */
main section .bg-accent\/10,
main section [class*="bg-accent"] {
  transition: all .2s ease;
}

/* --- Blue info boxes --- */
main section .bg-blue-50 {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #bfdbfe !important;
}

/* --- FAQ enhanced on subpages --- */
.faq-item {
  transition: all .25s ease;
}
.faq-item:hover {
  border-color: rgba(249,115,22,.2);
}

/* --- Breadcrumb enhanced --- */
nav[aria-label="Breadcrumb"] ol {
  font-size: 0.8125rem;
}
nav[aria-label="Breadcrumb"] a {
  transition: color .15s ease;
}

/* --- Footer enhancement --- */
footer {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%) !important;
}

/* --- CTA section at bottom of subpages --- */
main section[class*="bg-gradient-to-r"][class*="from-orange"] {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 40%, #dc2626 100%) !important;
  position: relative;
  overflow: hidden;
}
main section[class*="bg-gradient-to-r"][class*="from-orange"]::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255,255,255,.08), transparent 70%);
  pointer-events: none;
}

/* --- Pros/Cons tables in reviews --- */
main section table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  width: 100%;
}
main section table th {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.875rem 1rem;
  text-align: left;
}
main section table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
  color: #475569;
}
main section table tr:last-child td {
  border-bottom: none;
}
main section table tr:hover td {
  background: #fff7ed;
}

/* --- Step process cards --- */
main section .flex.items-start.gap-4 > .flex-shrink-0,
main section .flex.items-start.gap-3 > .flex-shrink-0 {
  transition: all .2s ease;
}
main section .flex.items-start.gap-4:hover > .flex-shrink-0,
main section .flex.items-start.gap-3:hover > .flex-shrink-0 {
  transform: scale(1.05);
}

/* --- Numbered step cards --- */
main section .bg-white.rounded-2xl.shadow-sm {
  transition: all .3s ease;
}
main section .bg-white.rounded-2xl.shadow-sm:hover {
  box-shadow: 0 10px 25px -8px rgba(0,0,0,.1);
}

/* --- Hero badges on subpages --- */
main section .inline-flex.items-center.gap-1\.5.bg-primary\/10 {
  background: linear-gradient(135deg, rgba(249,115,22,.12), rgba(234,88,12,.08)) !important;
  border: 1px solid rgba(249,115,22,.15);
}

/* --- Mobile responsiveness for subpages --- */
@media (max-width: 640px) {
  main > section {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  /* Offer cards full width on mobile */
  .lender-card { margin-left: -0.25rem; margin-right: -0.25rem; border-radius: 0.75rem; }
  .space-y-4 > .lender-card, .space-y-5 > .lender-card { margin-left: 0; margin-right: 0; }
  main section h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }
  main section h2 {
    font-size: 1.375rem !important;
  }
  main section .prose p,
  main section .prose-lg p,
  main section .space-y-5 > p {
    font-size: 0.9375rem;
    line-height: 1.75;
  }
  /* Stack offer card grids on mobile */
  main section .grid.sm\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Readable content width */
  main section .max-w-4xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* --- Print styles --- */
@media print {
  header, footer, .btn-primary, nav[aria-label="Breadcrumb"] { display: none; }
  main section { padding: 1rem 0 !important; }
  body { font-size: 12pt; }
}
