/* ==========================================================================
   Credplusa2m — Core Stylesheet
   Design tokens + components shared across every page.
   ========================================================================== */

:root {
  /* Brand palette */
  --color-primary: #0B5ED7;
  --color-primary-dark: #094BB0;
  --color-primary-light: #E8F1FD;
  --color-secondary: #0F172A;
  --color-accent: #22C55E;
  --color-accent-dark: #16A34A;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F5F8FC;
  --color-gray-100: #F1F5F9;
  --color-gray-200: #E2E8F0;
  --color-gray-400: #94A3B8;
  --color-gray-600: #475569;
  --color-gray-800: #1E293B;

  /* Type */
  --font-display: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Shape & motion */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --ease: cubic-bezier(.22,1,.36,1);
  --shadow-soft: 0 10px 30px -12px rgba(15,23,42,.15);
  --shadow-card: 0 4px 24px rgba(15,23,42,.06);
  --shadow-hover: 0 20px 40px -16px rgba(11,94,215,.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font-body);
  color: var(--color-secondary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

a { text-decoration: none; color: inherit; }

img { max-width: 100%; display: block; }

.container-wide { max-width: 1280px; margin-inline: auto; padding-inline: 1.25rem; }
@media (min-width: 768px) { .container-wide { padding-inline: 2rem; } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: .4rem .9rem;
  border-radius: var(--radius-pill);
}

.section-pad { padding-block: clamp(3rem, 6vw, 6rem); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .95rem;
  padding: .85rem 1.7rem;
  border-radius: var(--radius-pill);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s var(--ease), color .35s var(--ease);
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(11,94,215,.5);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); background: var(--color-primary-dark); }

.btn-accent {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(34,197,94,.5);
}
.btn-accent:hover { transform: translateY(-3px); background: var(--color-accent-dark); }

.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,.55);
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,.12); transform: translateY(-3px); }

.btn-outline-dark {
  background: transparent;
  border-color: var(--color-gray-200);
  color: var(--color-secondary);
}
.btn-outline-dark:hover { border-color: var(--color-primary); color: var(--color-primary); transform: translateY(-3px); }

.btn-sm { padding: .6rem 1.25rem; font-size: .85rem; }

/* ---------- Header ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid rgba(15,23,42,.06);
  transition: box-shadow .3s var(--ease);
}
#site-header.scrolled { box-shadow: 0 8px 24px -12px rgba(15,23,42,.15); }

.logo-mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), #1E9EFF);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
  box-shadow: 0 6px 16px -4px rgba(11,94,215,.5);
}

.nav-link {
  position: relative;
  font-weight: 500;
  font-size: .95rem;
  color: var(--color-gray-800);
  padding: .5rem 0;
}
.nav-link::after {
  content: '';
  position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--color-primary);
  transition: width .3s var(--ease);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link.active { color: var(--color-primary); }

/* Mobile menu */
#mobile-menu { transition: max-height .4s var(--ease), opacity .3s var(--ease); overflow: hidden; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: rgba(11,94,215,.25); }

.icon-tile {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  flex-shrink: 0;
}

/* Glassmorphism panel used in hero */
.glass-panel {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
}

.glass-panel-light {
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-soft);
}

/* ---------- Hero background ---------- */
.hero-bg {
  background:
    radial-gradient(circle at 15% 20%, rgba(34,197,94,.25), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(30,158,255,.35), transparent 45%),
    linear-gradient(135deg, #0F172A 0%, #0B5ED7 130%);
  position: relative;
  overflow: hidden;
}
.hero-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .5;
  mask-image: radial-gradient(ellipse at 60% 20%, black, transparent 70%);
}

.floating { animation: float 6s ease-in-out infinite; }
.floating-slow { animation: float 9s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(2deg); }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal-stagger.in-view > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in-view > *:nth-child(1) { transition-delay: .05s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: .12s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: .19s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: .26s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: .33s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: .4s; }
.reveal-stagger.in-view > *:nth-child(7) { transition-delay: .47s; }
.reveal-stagger.in-view > *:nth-child(8) { transition-delay: .54s; }

/* ---------- Process steps ---------- */
.process-line {
  background: repeating-linear-gradient(to bottom, var(--color-gray-200) 0 8px, transparent 8px 16px);
  width: 2px;
}
@media (min-width: 900px) {
  .process-line-h { background: repeating-linear-gradient(to right, var(--color-gray-200) 0 8px, transparent 8px 16px); height: 2px; width: 100%; }
}

.step-num {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
  box-shadow: 0 8px 20px -6px rgba(15,23,42,.4);
  flex-shrink: 0;
}

/* ---------- FAQ Accordion ---------- */
.faq-item { border-bottom: 1px solid var(--color-gray-200); }
.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left;
  padding: 1.25rem 0;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  color: var(--color-secondary);
}
.faq-icon { transition: transform .35s var(--ease); flex-shrink: 0; color: var(--color-primary); }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease), padding .4s var(--ease); color: var(--color-gray-600); font-size: .95rem; line-height: 1.7; }
.faq-item.open .faq-answer { padding-bottom: 1.25rem; }

/* ---------- Testimonials ---------- */
.testi-track { display: flex; transition: transform .6s var(--ease); }
.testi-slide { flex: 0 0 100%; }
@media (min-width: 768px) { .testi-slide { flex: 0 0 50%; padding-right: 1rem; } }
@media (min-width: 1100px) { .testi-slide { flex: 0 0 33.3333%; } }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-gray-200); transition: all .3s var(--ease); cursor: pointer; }
.dot.active { background: var(--color-primary); width: 24px; border-radius: 999px; }

/* ---------- Stat counters ---------- */
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.75rem); color: var(--color-secondary); }

/* ---------- WhatsApp floating button ---------- */
#whatsapp-btn {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px -8px rgba(37,211,102,.65);
  animation: pulse-wa 2.4s infinite;
}
@keyframes pulse-wa {
  0% { box-shadow: 0 0 0 0 rgba(37,211,102,.55), 0 10px 26px -8px rgba(37,211,102,.65); }
  70% { box-shadow: 0 0 0 14px rgba(37,211,102,0), 0 10px 26px -8px rgba(37,211,102,.65); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0), 0 10px 26px -8px rgba(37,211,102,.65); }
}

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed; right: 22px; bottom: 92px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--color-secondary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all .35s var(--ease);
  box-shadow: var(--shadow-soft);
}
#back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { background: var(--color-primary); }

/* ---------- Badges ---------- */
.badge-green { background: rgba(34,197,94,.12); color: var(--color-accent-dark); font-weight: 600; font-size: .78rem; padding: .3rem .7rem; border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Footer ---------- */
#site-footer { background: var(--color-secondary); color: #CBD5E1; }
#site-footer a:hover { color: var(--color-accent); }
#site-footer h4 { color: #fff; }

/* ---------- Forms ---------- */
.form-field label { font-size: .85rem; font-weight: 600; color: var(--color-gray-800); margin-bottom: .4rem; display: block; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  font-family: var(--font-body);
  font-size: .95rem;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
  background: #fff;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(11,94,215,.14);
}
.form-field .error-msg { color: #DC2626; font-size: .8rem; margin-top: .3rem; display: none; }
.form-field.has-error input, .form-field.has-error textarea { border-color: #DC2626; }
.form-field.has-error .error-msg { display: block; }

/* Skip link for a11y */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--color-primary); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Breadcrumb */
.breadcrumb a { color: var(--color-gray-600); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb .sep { color: var(--color-gray-400); }

/* Lazy image shimmer */
img[loading="lazy"] { background: linear-gradient(110deg, #ECF1F7 8%, #F7FAFC 18%, #ECF1F7 33%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
img[loading="lazy"].loaded { animation: none; background: none; }
@keyframes shimmer { to { background-position-x: -200%; } }

/* Blog prose */
.prose-blog h2 { font-family: var(--font-display); font-size: 1.5rem; margin-top: 2rem; margin-bottom: .75rem; color: var(--color-secondary); }
.prose-blog h3 { font-family: var(--font-display); font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: .5rem; }
.prose-blog p { margin-bottom: 1.1rem; line-height: 1.85; color: var(--color-gray-600); }
.prose-blog ul { margin: 0 0 1.1rem 1.25rem; list-style: disc; color: var(--color-gray-600); }
.prose-blog li { margin-bottom: .4rem; line-height: 1.7; }
.prose-blog strong { color: var(--color-secondary); }
