/* ===================================================================
   Cash Max MX – Styles (V2 Esmeralda Premium)
   Dark emerald #022c22/#064e3b · Emerald #10b981 · Gold #fbbf24
   Font: Plus Jakarta Sans
   =================================================================== */

/* ===== Base ===== */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; color: #022c22; }

/* ===== Mobile hardening (applies site-wide) ===== */
/* Prevent any element from pushing horizontal scroll on small screens */
html, body { overflow-x: hidden; }
*, *::before, *::after { min-width: 0; }
img, svg, video, table { max-width: 100%; }

/* Tables inside articles: smooth horizontal scroll on touch + right-edge fade hint */
.prose-cm .overflow-x-auto,
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
/* Scroll-hint fade on the right edge of wide tables (only where it can scroll) */
@media (max-width: 767px) {
  .prose-cm .overflow-x-auto {
    background:
      linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
      linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) 100% 0,
      radial-gradient(farthest-side at 0 50%, rgba(2,44,34,.12), rgba(0,0,0,0)),
      radial-gradient(farthest-side at 100% 50%, rgba(2,44,34,.12), rgba(0,0,0,0)) 100% 0;
    background-repeat: no-repeat;
    background-size: 34px 100%, 34px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
  }
}

/* iOS: stop auto-zoom on focus by keeping form fields >=16px on phones */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
  /* Comfortable tap targets */
  a.btn-primary, a.btn-gold, button.btn-primary, button.btn-gold,
  .btn-primary, .btn-gold { min-height: 46px; }
}

/* ===== Buttons ===== */
/* Button text color must win even inside .prose-cm (which colors <a> emerald).
   Higher-specificity selectors + explicit color keep CTA labels readable. */
.btn-primary,
.prose-cm a.btn-primary,
a.btn-primary,
button.btn-primary {
  color: #fff !important;
  text-decoration: none;
}
.btn-gold,
.prose-cm a.btn-gold,
a.btn-gold,
button.btn-gold {
  color: #052e16 !important;
  text-decoration: none;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  color: #fff;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 0 24px rgba(52,211,153,.4);
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.btn-primary:hover {
  box-shadow: 0 0 36px rgba(52,211,153,.65);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #052e16;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(251,191,36,.4);
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.btn-gold:hover {
  box-shadow: 0 6px 26px rgba(251,191,36,.6);
  transform: translateY(-1px);
}
.btn-gold:active { transform: translateY(0); }

.text-gradient {
  background: linear-gradient(135deg, #34d399 0%, #a7f3d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Glassmorphism (dark hero) ===== */
.glass {
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12);
}

/* ===== Range Slider (on dark glass card) ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #34d399 0%, #34d399 var(--val, 50%), rgba(255,255,255,.15) var(--val, 50%), rgba(255,255,255,.15) 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: #fbbf24;
  cursor: pointer;
  border: 3px solid #052e16;
  box-shadow: 0 0 12px rgba(251,191,36,.6);
  transition: box-shadow .2s, transform .15s;
}
input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 18px rgba(251,191,36,.85);
  transform: scale(1.08);
}
input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fbbf24;
  cursor: pointer;
  border: 3px solid #052e16;
  box-shadow: 0 0 12px rgba(251,191,36,.6);
}

/* ===== 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 4px 18px rgba(251,191,36,.4); }
  50%      { box-shadow: 0 4px 28px rgba(251,191,36,.75); }
}
@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; }

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* ===== FAQ (details) ===== */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] .chev { transform: rotate(180deg); }
.chev { transition: transform .3s cubic-bezier(.4,0,.2,1); }

/* ===== Lender row ===== */
.lender-row {
  transition: all .25s cubic-bezier(.4,0,.2,1);
}
.lender-row:hover {
  box-shadow: 0 20px 40px -12px rgba(2,44,34,.12);
  border-color: rgba(52,211,153,.4);
  transform: translateY(-2px);
}
