/* ============================================
   FACILYCRED · GLOBAL STYLES
   Tokens, base, navbar, footer, mobile menu
   ============================================ */

/* ============ DESIGN TOKENS ============ */
:root {
  /* brand colors (extraídas do logo) */
  --green: #74C043;
  --green-bright: #8BD557;
  --green-dark: #5BA32E;
  --green-darker: #3E7821;
  --green-glow: rgba(116, 192, 67, 0.35);
  --green-soft: rgba(116, 192, 67, 0.08);

  /* surfaces */
  --black: #000000;
  --bg: #0A0B0A;
  --bg-elevated: #121412;
  --bg-card: #131513;
  --bg-deep: #060706;

  /* borders */
  --border: #1F221F;
  --border-bright: #2A2E2A;

  /* text */
  --white: #FFFFFF;
  --text: #EDEFED;
  --text-muted: #9A9F9A;
  --text-dim: #6A6E6A;

  /* whatsapp */
  --wa-green: #25D366;
  --wa-green-dark: #1FBA58;

  /* type */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;

  /* radius */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  /* layout */
  --max-width: 1240px;
  --nav-height: 72px;

  /* motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ============ RESET ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

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

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

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

::selection {
  background: var(--green);
  color: var(--black);
}

/* prevent scroll when mobile menu open */
body.no-scroll {
  overflow: hidden;
}

/* ============ LAYOUT HELPERS ============ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* ============ NAVBAR ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: rgba(10, 11, 10, 0.65);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out);
}

.nav.scrolled {
  background: rgba(10, 11, 10, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  padding: 0 28px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-logo {
  display: block;
  position: relative;
  z-index: 2;
}

.nav-logo img {
  height: 38px;
  width: auto;
  transition: transform 0.3s var(--ease-out);
}

.nav-logo:hover img {
  transform: scale(1.04);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-menu > a:not(.nav-cta) {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: -0.01em;
  position: relative;
  transition: color 0.2s;
}

.nav-menu > a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out);
}

.nav-menu > a:not(.nav-cta):hover,
.nav-menu > a.active {
  color: var(--green);
}

.nav-menu > a:not(.nav-cta):hover::after,
.nav-menu > a.active::after {
  transform: scaleX(1);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: var(--black);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.nav-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--green-bright), var(--green));
  opacity: 0;
  transition: opacity 0.25s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px var(--green-glow);
}

.nav-cta:hover::before {
  opacity: 1;
}

.nav-cta span,
.nav-cta svg {
  position: relative;
  z-index: 1;
}

.nav-cta svg {
  width: 16px;
  height: 16px;
}

/* ============ MOBILE MENU TOGGLE ============ */
.menu-toggle {
  display: none;
  position: relative;
  z-index: 110;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  position: absolute;
  left: 50%;
  margin-left: -9px;
  transition: transform 0.35s var(--ease-out), top 0.3s, opacity 0.2s;
}

.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 26px; }

.menu-toggle.open span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.menu-toggle.open span:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: all 0.25s var(--ease-out);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease-out);
}

.btn-primary {
  background: var(--green);
  color: var(--black);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, var(--green-bright), var(--green));
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px var(--green-glow);
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary > * { position: relative; z-index: 1; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.btn:hover svg.arrow {
  transform: translateX(3px);
}

/* ============ SECTION HEADS ============ */
section {
  padding: 110px 0;
}

.section-head {
  max-width: 720px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--green);
  margin-bottom: 18px;
  position: relative;
  padding-left: 26px;
}

.section-eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 1px;
  background: var(--green);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 18px;
}

.section-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--green);
}

.section-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
  letter-spacing: -0.005em;
}

/* ============ FOOTER ============ */
footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 80px 0 30px;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  opacity: 0.4;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 50px;
  margin-bottom: 60px;
}

.foot-brand img {
  height: 42px;
  width: auto;
  margin-bottom: 22px;
}

.foot-brand p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 320px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.social {
  display: flex;
  gap: 10px;
}

.social a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.25s var(--ease-out);
}

.social a:hover {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green);
  transform: translateY(-3px) rotate(-4deg);
}

.social svg {
  width: 16px;
  height: 16px;
}

.foot-col h5 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-bottom: 18px;
  font-weight: 700;
}

.foot-col ul {
  list-style: none;
}

.foot-col li {
  margin-bottom: 10px;
}

.foot-col a {
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.2s, padding-left 0.2s;
  display: inline-block;
}

.foot-col a:hover {
  color: var(--green);
  padding-left: 4px;
}

.disclaimer {
  margin-top: 24px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

.disclaimer strong {
  color: var(--text-muted);
}

.foot-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 13px;
  gap: 20px;
  flex-wrap: wrap;
}

.foot-bottom .legal a {
  margin-left: 18px;
  transition: color 0.2s;
}

.foot-bottom .legal a:hover {
  color: var(--green);
}

/* ============ FLOATING WHATSAPP ============ */
.float-wa {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--wa-green);
  color: #062013;
  padding: 14px 22px 14px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 16px 38px rgba(37, 211, 102, 0.45),
              0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.3s var(--ease-out);
  transform: translateY(0);
  animation: wa-pop-in 0.6s var(--ease-bounce) 0.8s backwards;
}

@keyframes wa-pop-in {
  from {
    transform: translateY(120px) scale(0.6);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.float-wa:hover {
  background: var(--wa-green-dark);
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 22px 50px rgba(37, 211, 102, 0.55);
}

.float-wa svg {
  width: 22px;
  height: 22px;
}

.float-wa::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid var(--wa-green);
  opacity: 0;
  animation: wa-ring 2.4s ease-out infinite;
  pointer-events: none;
}

.float-wa::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid var(--wa-green);
  opacity: 0;
  animation: wa-ring 2.4s ease-out infinite 1.2s;
  pointer-events: none;
}

@keyframes wa-ring {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* ============ MOBILE NAV DRAWER ============ */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(10, 11, 10, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-height) + 30px) 28px 40px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: opacity 0.35s var(--ease-out),
              transform 0.35s var(--ease-out),
              visibility 0.35s;
}

.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: auto;
}

.mobile-drawer-menu a {
  display: block;
  padding: 22px 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--white);
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, padding-left 0.25s var(--ease-out);
  transform: translateX(-20px);
  opacity: 0;
}

.mobile-drawer.open .mobile-drawer-menu a {
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.45s var(--ease-out),
              opacity 0.45s var(--ease-out),
              color 0.2s,
              padding-left 0.25s var(--ease-out);
}

.mobile-drawer.open .mobile-drawer-menu a:nth-child(1) { transition-delay: 0.10s; }
.mobile-drawer.open .mobile-drawer-menu a:nth-child(2) { transition-delay: 0.16s; }
.mobile-drawer.open .mobile-drawer-menu a:nth-child(3) { transition-delay: 0.22s; }
.mobile-drawer.open .mobile-drawer-menu a:nth-child(4) { transition-delay: 0.28s; }

.mobile-drawer-menu a:hover {
  color: var(--green);
  padding-left: 10px;
}

.mobile-drawer-menu a::after {
  content: '→';
  float: right;
  color: var(--green);
  opacity: 0.5;
  transition: transform 0.25s var(--ease-out);
}

.mobile-drawer-menu a:hover::after {
  transform: translateX(4px);
  opacity: 1;
}

.mobile-drawer-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--wa-green);
  color: #062013;
  padding: 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  margin-top: 30px;
  transform: translateY(20px);
  opacity: 0;
}

.mobile-drawer.open .mobile-drawer-cta {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.5s var(--ease-out) 0.35s,
              opacity 0.5s var(--ease-out) 0.35s;
}

.mobile-drawer-cta svg {
  width: 20px;
  height: 20px;
}

/* ============ SCROLL REVEAL ANIMATIONS ============ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out),
              transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s var(--ease-out),
              transform 0.8s var(--ease-out);
}

.reveal-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s var(--ease-out),
              transform 0.8s var(--ease-out);
}

.reveal-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s var(--ease-out),
              transform 0.7s var(--ease-bounce);
}

.reveal-scale.in-view {
  opacity: 1;
  transform: scale(1);
}

/* stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out),
              transform 0.6s var(--ease-out);
}

.stagger.in-view > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger.in-view > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.in-view > *:nth-child(2) { transition-delay: 0.12s; }
.stagger.in-view > *:nth-child(3) { transition-delay: 0.19s; }
.stagger.in-view > *:nth-child(4) { transition-delay: 0.26s; }
.stagger.in-view > *:nth-child(5) { transition-delay: 0.33s; }
.stagger.in-view > *:nth-child(6) { transition-delay: 0.40s; }
.stagger.in-view > *:nth-child(7) { transition-delay: 0.47s; }
.stagger.in-view > *:nth-child(8) { transition-delay: 0.54s; }

/* ============ RESPONSIVE BREAKPOINTS ============ */
@media (max-width: 980px) {
  section {
    padding: 80px 0;
  }
  .section-head {
    margin-bottom: 48px;
  }
  .nav-menu > a:not(.nav-cta),
  .nav-menu > .nav-cta {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .foot-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .float-wa span {
    display: none;
  }
  .float-wa {
    padding: 16px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 540px) {
  section {
    padding: 64px 0;
  }
  .section-head {
    margin-bottom: 40px;
  }
  .foot-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .foot-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .foot-bottom .legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
  }
  .foot-bottom .legal a {
    margin-left: 0;
    margin-right: 18px;
  }
  .container {
    padding: 0 20px;
  }
  .nav-inner {
    padding: 0 20px;
  }
  .mobile-drawer {
    padding: calc(var(--nav-height) + 20px) 20px 30px;
  }
  .mobile-drawer-menu a {
    font-size: 26px;
    padding: 18px 0;
  }
  .btn {
    padding: 14px 24px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
  }
}

/* ============ ACCESSIBILITY ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }
  .stagger > * {
    opacity: 1;
    transform: none;
  }
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}
