/* CreditFlowAI — Fintech Premium Dark Mode Design System
   VacaWeb | creditflowai.app */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
  --primary: #0066FF;
  --accent: #00C896;
  --bg-dark: #0A0F1E;
  --bg-card: #111827;
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --border: #1E293B;
  --danger: #EF4444;
  --warning: #F59E0B;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: clamp(14px, 1.5vw, 16px);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* Typography scale */
h1 { font-size: clamp(28px, 4vw, 48px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(22px, 2.5vw, 32px); font-weight: 700; margin-bottom: 0.75em; }
h3 { font-size: clamp(18px, 1.8vw, 22px); font-weight: 600; margin-bottom: 0.5em; }
p { margin-bottom: 1em; color: var(--text-secondary); }
p:last-child { margin-bottom: 0; }

/* ========== NAVIGATION ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition), box-shadow var(--transition);
}
.nav.scrolled { background: rgba(10, 15, 30, 0.95); backdrop-filter: blur(12px); box-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.nav-inner { display: flex; align-items: center; gap: 2rem; max-width: 1280px; margin: 0 auto; width: 100%; }
.nav-logo { display: flex; align-items: center; gap: 0.5rem; }
.nav-logo svg { height: 36px; width: auto; }
.nav-logo-icon { animation: logo-pulse 2.5s ease-in-out infinite; }
@keyframes logo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.85; } }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text-secondary); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text-primary); }
.nav-cta .btn { padding: 0.5rem 1.25rem; font-size: 0.9rem; }
.nav-hamburger { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 0.5rem; }
.nav-hamburger svg { width: 24px; height: 24px; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #0052CC; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4); }
.btn-secondary { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-secondary:hover { background: rgba(0, 200, 150, 0.15); }

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 1.5rem 4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0d1530 40%, #0a1a3d 70%, var(--bg-dark) 100%);
  background-size: 400% 400%;
  animation: gradient-shift 12s ease infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 102, 255, 0.15), transparent 60%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 800px; margin: 0 auto; }
.hero h1 { margin-bottom: 1rem; }
.hero-sub { font-size: clamp(16px, 1.8vw, 20px); color: var(--text-secondary); margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-bottom: 2rem; }
.hero-ctas .btn { min-width: 180px; }

/* ========== AD ZONES ========== */
.ad-zone {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.ad-leaderboard { width: 728px; max-width: 100%; height: 90px; margin: 0 auto 2rem; }
.ad-rectangle { width: 300px; height: 250px; }
.ad-mobile { width: 320px; max-width: 100%; height: 100px; margin: 0 auto; }
.ad-zone span { opacity: 0.7; }

/* ========== TRUST BAR ========== */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trust-item { display: flex; align-items: center; gap: 0.75rem; color: var(--text-secondary); font-size: 0.95rem; }
.trust-item svg { flex-shrink: 0; color: var(--accent); }

/* ========== SECTIONS ========== */
.section { padding: 4rem 1.5rem; max-width: 1280px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { margin-bottom: 0.5rem; }

/* ========== CARDS (Glass) ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: rgba(0, 102, 255, 0.3); box-shadow: var(--shadow); }
.card-tag { display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.card h3 { margin-bottom: 0.5rem; }
.card p { font-size: 0.95rem; margin-bottom: 1rem; }
.card-meta { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.card-meta span { margin-right: 1rem; }

/* ========== FEATURED TOOL CARD ========== */
.featured-tool {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 102, 255, 0.08) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.featured-tool-preview {
  aspect-ratio: 16/10;
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.featured-tool-content h2 { margin-bottom: 0.5rem; }
.featured-tool-content p { margin-bottom: 1.5rem; }

/* ========== ARTICLE GRID ========== */
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.article-card { height: 100%; display: flex; flex-direction: column; }
.article-card .card { flex: 1; display: flex; flex-direction: column; }
.article-card .card p { flex: 1; }

/* ========== CATEGORY HUBS ========== */
.category-hubs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.hub-card {
  text-align: center;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}
.hub-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.3); }
.hub-card svg { width: 48px; height: 48px; color: var(--accent); margin-bottom: 1rem; }
.hub-card h3 { margin-bottom: 0.5rem; }
.hub-card p { font-size: 0.95rem; margin-bottom: 1rem; }
.hub-card .hub-count { font-size: 0.85rem; color: var(--primary); margin-bottom: 1rem; }

/* ========== STATS ========== */
.stats { padding: 4rem 1.5rem; background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-inner { max-width: 1280px; margin: 0 auto; text-align: center; }
.stats h2 { margin-bottom: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.stat-item .stat-value { font-size: clamp(24px, 3vw, 36px); font-weight: 700; color: var(--accent); margin-bottom: 0.25rem; }
.stat-item .stat-label { font-size: 0.9rem; color: var(--text-secondary); }

/* ========== NEWSLETTER ========== */
.newsletter {
  padding: 4rem 1.5rem;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.newsletter h2 { margin-bottom: 0.5rem; }
.newsletter p { margin-bottom: 1.5rem; }
.newsletter-form { display: flex; gap: 0.5rem; max-width: 400px; margin: 0 auto; }
.newsletter-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
}
.newsletter-form input::placeholder { color: var(--text-secondary); }
.newsletter-form input:focus { outline: none; border-color: var(--primary); }

/* ========== FOOTER ========== */
.footer {
  padding: 3rem 1.5rem 2rem;
  background: #080c18;
  border-top: 1px solid var(--border);
}
.footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand p { font-size: 0.9rem; margin-top: 0.5rem; max-width: 240px; }
.footer h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-primary); }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 0.5rem; }
.footer ul a { color: var(--text-secondary); font-size: 0.9rem; }
.footer-bottom { max-width: 1280px; margin: 0 auto; padding-top: 2rem; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-secondary); text-align: center; }

/* ========== ARTICLE LAYOUT ========== */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; max-width: 1100px; margin: 0 auto; padding: 6rem 1.5rem 4rem; }
.article-content { max-width: 760px; box-sizing: border-box; width: 100%; }
.article-content h2 { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.article-content h2:first-of-type { margin-top: 1.5rem; border-top: none; padding-top: 0; }
.article-content h3 { margin-top: 1.5rem; }
.article-content ul, .article-content ol { margin: 1rem 0 1rem 1.5rem; color: var(--text-secondary); }
.article-content li { margin-bottom: 0.5rem; }
.article-sidebar { position: sticky; top: 100px; height: fit-content; }
.article-sidebar .card { margin-bottom: 1.5rem; }
.pro-tip { background: rgba(0, 200, 150, 0.1); border-left: 4px solid var(--accent); padding: 1rem 1.25rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.5rem 0; }
.pro-tip strong { color: var(--accent); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary { padding: 1rem 0; cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; color: var(--primary); }
.faq-item[open] summary::after { content: '−'; }
.faq-item div { padding-bottom: 1rem; color: var(--text-secondary); }
.disclaimer { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2rem; padding: 1rem; background: var(--bg-card); border-radius: var(--radius-sm); }

/* ========== TABLES ========== */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-card); color: var(--text-primary); font-weight: 600; }
tr:nth-child(even) { background: rgba(17, 24, 39, 0.5); }

/* ========== PROGRESS / GAUGE ========== */
.score-meter { position: relative; width: 180px; height: 180px; margin: 0 auto; }
.score-meter svg { transform: rotate(-90deg); }
.score-meter .bg { stroke: var(--border); }
.score-meter .fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-meter .fill.danger { stroke: var(--danger); }
.score-meter .fill.warning { stroke: var(--warning); }
.score-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; }

/* ========== ANIMATIONS (Intersection) ========== */
.animate-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.animate-in.visible { opacity: 1; transform: translateY(0); }

/* ========== CONTAINER ========== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .category-hubs { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .featured-tool { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  /* ── Hamburger fix: push logo left, hamburger right ── */
  .nav { padding-left: 1.25rem; padding-right: 1.25rem; }
  .nav-inner { justify-content: space-between; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-card); padding: 1rem; border-bottom: 1px solid var(--border); }
  .nav-hamburger { display: block; margin-left: auto; }
  .nav-cta { display: none; }

  /* ── Content padding fix: element+class selector beats inline style specificity ── */
  .hero { min-height: 70vh; padding: 6rem 20px 3rem; }
  main.article-layout {
    padding-left: 24px !important;
    padding-right: 24px !important;
    width: 100% !important;
    display: block !important;
  }
  .article-content { padding-left: 20px !important; padding-right: 20px !important; box-sizing: border-box; width: 100%; max-width: 100%; }
  .section { padding-left: 20px !important; padding-right: 20px !important; }
  .container { padding-left: 20px !important; padding-right: 20px !important; }
  .stats { padding-left: 20px !important; padding-right: 20px !important; }
  .newsletter { padding-left: 20px !important; padding-right: 20px !important; }
  .footer { padding-left: 20px !important; padding-right: 20px !important; }

  .hero-ctas { flex-direction: column; }
  .articles-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-brand p { max-width: none; }
}
@media (max-width: 480px) {
  /* ── Extra-small phones: enforce 20px safe zone on every container ── */
  .nav { padding-left: 16px; padding-right: 16px; }
  .hero { padding-left: 20px !important; padding-right: 20px !important; }
  main.article-layout { padding-left: 24px !important; padding-right: 24px !important; width: 100% !important; display: block !important; }
  .article-content { padding-left: 20px !important; padding-right: 20px !important; box-sizing: border-box; width: 100%; max-width: 100%; }
  .section { padding-left: 20px !important; padding-right: 20px !important; }
  .container { padding-left: 20px !important; padding-right: 20px !important; }
  .stats { padding-left: 20px !important; padding-right: 20px !important; }
  .newsletter { padding-left: 20px !important; padding-right: 20px !important; }
  .footer { padding-left: 20px !important; padding-right: 20px !important; }
  .ad-leaderboard { height: 90px; }
  .trust-bar { gap: 1rem; padding-left: 20px !important; padding-right: 20px !important; }
}
