/* ===================================================================
   Fortaprest MX – Stylesheet (Navy & Gold · Space Grotesk)
   =================================================================== */

/* ===== Base ===== */
html { scroll-behavior: smooth; }
body { font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif; color: #0b2447; }

/* ===== Range Slider (on navy calculator card) ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(to right, #f0b429 0%, #f0b429 var(--val, 50%), #1d3f6e var(--val, 50%), #1d3f6e 100%);
  outline: none;
  width: 100%;
  transition: background .1s;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f0b429;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(240,180,41,.5);
  transition: box-shadow .2s, transform .15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 3px 16px rgba(240,180,41,.7);
  transform: scale(1.08);
}
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f0b429;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(240,180,41,.5);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240,180,41,.45); }
  50%      { box-shadow: 0 0 0 10px rgba(240,180,41,0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@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-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 { border-left: 4px solid #e2e8f0; transition: border-color .25s ease; }
.faq-item.open { border-left-color: #f0b429; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-chevron { transition: transform .3s cubic-bezier(.4,0,.2,1); }

/* ===== Lender card (V3-style vertical cards) ===== */
.lender-card { transition: all .25s cubic-bezier(.4,0,.2,1); }
.lender-card:hover {
  box-shadow: 0 20px 40px -12px rgba(8,26,53,.15);
  border-color: rgba(240,180,41,.5);
  transform: translateY(-3px);
}

/* ===== Loan type card ===== */
.loan-type-icon { transition: all .25s ease; }
.loan-type-card:hover .loan-type-icon {
  background: #f0b429;
  color: #081a35;
  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(8,26,53,.12);
  border-color: rgba(240,180,41,.4);
}

/* ===== Mobile menu ===== */
/* Mobile drawer menu */
#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  pointer-events: none;
}
#mobile-menu .mm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 26, 53, .55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .3s ease;
}
#mobile-menu .mm-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(86vw, 340px);
  background: #0b2447;
  box-shadow: -12px 0 40px rgba(0, 0, 0, .35);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
#mobile-menu.open {
  visibility: visible;
  pointer-events: auto;
}
#mobile-menu.open .mm-overlay { opacity: 1; }
#mobile-menu.open .mm-panel { transform: translateX(0); }

/* Accordion groups inside the drawer */
.mm-acc > .mm-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.mm-acc.open > .mm-sub { max-height: 640px; }
.mm-acc.open > .mm-head .mm-chev { transform: rotate(180deg); }
.mm-chev { transition: transform .28s ease; }

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

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

/* ===== Buttons ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #f7c948 0%, #de911d 100%);
  color: #081a35;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: all .2s ease;
  box-shadow: 0 4px 16px rgba(240,180,41,.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(240,180,41,.5);
}
.btn-outline-navy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 2px solid #0b2447;
  color: #0b2447;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: all .2s ease;
}
.btn-outline-navy:hover {
  background: #0b2447;
  color: #fff;
}

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

/* ===== Section polish ===== */
main > section { position: relative; }
main section h2 { letter-spacing: -0.02em; }

/* ===== Footer ===== */
footer {
  background: linear-gradient(180deg, #081a35 0%, #0b2447 100%) !important;
}

/* ===== Article/legal content ===== */
.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0b2447;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.article-content h2::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, #f7c948, #de911d);
  margin-bottom: 0.65rem;
}
.article-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0b2447;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-left: 0.875rem;
  border-left: 3px solid #f0b429;
}
.article-content p {
  color: #475569;
  line-height: 1.85;
  margin-bottom: 1.1rem;
}
.article-content strong { color: #0b2447; }
/* Lead callout: only when the article literally opens with a paragraph */
.article-content > p:first-child {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: #334155;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
  border-left: 4px solid #f0b429;
  border-radius: 0 1rem 1rem 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}
.article-content ul {
  margin-bottom: 1.4rem;
  padding-left: 0;
  list-style: none;
}
.article-content ul li {
  color: #475569;
  line-height: 1.75;
  margin-bottom: 0.65rem;
  position: relative;
  padding-left: 1.9rem;
}
.article-content ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.18em;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 99px;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.article-content ol {
  margin-bottom: 1.4rem;
  padding-left: 1.5rem;
  list-style: decimal;
}
.article-content ol li {
  color: #475569;
  line-height: 1.75;
  margin-bottom: 0.65rem;
  padding-left: 0.35rem;
}
.article-content ol li::marker { color: #de911d; font-weight: 700; }
.article-content blockquote {
  background: linear-gradient(180deg, #0b2447 0%, #081a35 100%);
  color: #e2e8f0;
  border-left: 4px solid #f0b429;
  border-radius: 1rem;
  padding: 1.4rem 1.6rem;
  margin: 1.75rem 0;
  font-weight: 600;
  line-height: 1.7;
}
.article-content blockquote strong { color: #f0b429; }
.article-content a {
  color: #de911d;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  text-decoration-color: #fce588;
  transition: color .15s ease;
}
.article-content a:hover { color: #b57314; text-decoration-color: #de911d; }
.article-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  margin: 1.5rem 0;
}
.article-content table th {
  background: #0b2447;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1.25rem;
  text-align: left;
}
.article-content table td {
  padding: 0.8rem 1.25rem;
  font-size: 0.9rem;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
}
.article-content table tr:last-child td { border-bottom: none; }
.article-content table tr:nth-child(even) td { background: #f8fafc; }

/* ===== Spec table (review condition tables etc.) ===== */
.spec-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.spec-table thead th {
  background: linear-gradient(180deg, #0b2447 0%, #081a35 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.9rem 1.4rem;
  text-align: left;
}
.spec-table thead th:last-child { text-align: right; }
.spec-table tbody td {
  padding: 0.9rem 1.4rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
}
.spec-table tbody tr:last-child td { border-bottom: none; }
.spec-table tbody tr:nth-child(even) td { background: #f8fafc; }
.spec-table tbody tr:hover td { background: #fffbeb; }
.spec-table tbody td:first-child { color: #64748b; font-weight: 700; }
.spec-table tbody td:last-child { color: #0b2447; font-weight: 700; text-align: right; }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  main > section {
    padding-top: 2.25rem !important;
    padding-bottom: 2.25rem !important;
  }
  main section h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }
  main section h2 { font-size: 1.375rem !important; }
  .lender-card { border-radius: 1rem; }
  input[type="range"]::-webkit-slider-thumb { width: 28px; height: 28px; }

  /* Article typography scales down slightly for phones */
  .article-content { font-size: 0.95rem; }
  .article-content h2 { font-size: 1.3rem; margin-top: 2rem; }
  .article-content h3 { font-size: 1.1rem; }
  .article-content > p:first-child {
    font-size: 1rem;
    padding: 1.05rem 1.15rem;
  }
  .article-content blockquote { padding: 1.15rem 1.25rem; }
  .article-content ul li { padding-left: 1.7rem; }

  /* Spec/article tables: tighter padding + horizontal scroll safety */
  .spec-table thead th,
  .spec-table tbody td,
  .article-content table th,
  .article-content table td {
    padding: 0.7rem 0.85rem;
    font-size: 0.8rem;
  }
  .spec-table thead th { letter-spacing: 0.06em; }

  /* Sidebar cards go full width and looser once stacked below article */
  aside .lg\:sticky { position: static; }
}

/* Wrap wide tables so they never overflow the viewport */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll::-webkit-scrollbar { height: 6px; }
.table-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

/* ===== Modal offers: hidden until "ver más" ===== */
.offer-hidden { display: none !important; }
