/* ============================================================
   OBICASH — Animations & Micro-interactions
   Complementa style.css com camada de movimento e polimento
   ============================================================ */

/* ── Page Load ────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* Chart line drawing */
@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

/* Gradient fill reveal */
@keyframes fillReveal {
  from { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
  to   { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
}

/* Glow pulse */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,229,255,0.15); }
  50%       { box-shadow: 0 0 40px rgba(0,229,255,0.35); }
}

/* Blink cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Float subtle */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

/* Orbit spin */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Number count up (visual cue) */
@keyframes numberReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero h1 {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero .badge {
  animation: slideInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero p {
  animation: fadeInUp 0.7s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero > .container > div > div:first-child > div:nth-child(3) {
  animation: fadeInUp 0.7s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero > .container > div > div:first-child > div:nth-child(4) {
  animation: fadeInUp 0.7s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Browser mockup floats subtly */
.browser-mockup {
  animation: float 6s ease-in-out infinite;
  will-change: transform;
}

/* SVG chart line animation */
.hero svg path[stroke="#00E5FF"],
.hero svg path[stroke="currentColor"] {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 1.8s 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Stats / Counters ─────────────────────────────────────── */
.stat-number {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: -0.04em;
  line-height: 1;
  display: inline-block;
}

.stat-suffix {
  font-size: 0.6em;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ── Stagger delays for card grids ───────────────────────── */
.card-grid .card:nth-child(1) { transition-delay: 0s;    }
.card-grid .card:nth-child(2) { transition-delay: 0.07s; }
.card-grid .card:nth-child(3) { transition-delay: 0.14s; }
.card-grid .card:nth-child(4) { transition-delay: 0.21s; }

/* ── Button micro-interactions ────────────────────────────── */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover::after { opacity: 1; }

.btn-primary:active {
  transform: scale(0.97);
}

/* Ripple effect on button click */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: ripple 0.5s ease-out forwards;
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ── Card Hover Effects ───────────────────────────────────── */
.card {
  position: relative;
}

/* Subtle inner shine on hover */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(0, 229, 255, 0.04) 0%,
    transparent 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.card:hover::before { opacity: 1; }

/* ── Feature Icon — Hover Lift ────────────────────────────── */
.feature-icon {
  transition: transform var(--transition), background var(--transition);
}

.card:hover .feature-icon {
  transform: scale(1.1);
  background: rgba(0, 229, 255, 0.2);
}

/* ── Navigation Active Indicator ─────────────────────────── */
nav ul li a {
  position: relative;
}

nav ul li a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 2px;
}

/* ── Logo Animation ───────────────────────────────────────── */
.logo:hover .logo-mark {
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
  transition: box-shadow 0.2s;
}

/* ── Accent Glow on Primary CTA (hero) ────────────────────── */
.hero .btn-primary {
  animation: glowPulse 3s 1.5s ease-in-out infinite;
}

/* ── Tab Buttons ──────────────────────────────────────────── */
.tab-btn {
  position: relative;
  transition: all var(--transition);
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 2px;
  transition: transform 0.25s ease;
}

.tab-btn.active::after { transform: translateX(-50%) scaleX(1); }

/* Tab panel transition */
.tab-panel {
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── FAQ Animation Polish ─────────────────────────────────── */
.faq-answer-inner {
  animation: fadeIn 0.25s ease;
}

/* ── Compliance strip ticker items ────────────────────────── */
.compliance-badge {
  transition: border-color var(--transition), color var(--transition);
  cursor: default;
}

.compliance-badge:hover {
  border-color: var(--accent-blue) !important;
  color: var(--accent-blue) !important;
}

/* ── Form Field Focus Polish ──────────────────────────────── */
.form-control {
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:focus {
  animation: none; /* remove any inherited animation */
}

/* Validation states */
.form-control.is-valid {
  border-color: var(--accent-green);
}

.form-control.is-invalid {
  border-color: #F87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.field-hint {
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.field-hint.error {
  display: block;
  color: #F87171;
}

/* ── Range Slider Polish ──────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border-mid);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(0,229,255,0.15);
  transition: box-shadow var(--transition), transform var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(0,229,255,0.2);
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-mid); }

/* ── Selection ────────────────────────────────────────────── */
::selection {
  background: rgba(0, 229, 255, 0.2);
  color: var(--text-primary);
}

/* ── Loader for submit button ─────────────────────────────── */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.btn-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #0A0E12;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* ── Mobile Nav Slide In ──────────────────────────────────── */
nav.open {
  animation: fadeIn 0.2s ease;
}

/* ── Data table row animations ────────────────────────────── */
.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover td {
  color: var(--text-primary);
}

/* ── Browser mockup content fade ──────────────────────────── */
.browser-content {
  animation: fadeIn 0.4s ease;
}

/* ── Orb hover parallax (desktop) ────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .orb { transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
}

/* ── Skip link for accessibility ──────────────────────────── */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--accent-blue);
  color: #0A0E12;
  padding: 8px 16px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── Print styles ─────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .btn,
  nav { display: none !important; }

  body {
    background: white;
    color: black;
  }

  h1, h2, h3, h4 { color: black; }
}

/* ── High-contrast / prefers-reduced-motion ───────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive: Tablet ───────────────────────────────────── */
@media (max-width: 1024px) {
  .browser-mockup {
    animation: none; /* disable float on small screens */
  }

  .hero > .container > div {
    grid-template-columns: 1fr !important;
    gap: 48px !important;
  }

  .hero > .container > div > div:last-child {
    max-width: 560px;
    margin: 0 auto;
  }
}

/* ── Responsive: Mobile ───────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  h3 { font-size: 18px; }

  .section-header h2 { font-size: 26px; }

  /* All 2-col grids collapse */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* 3-col grids collapse */
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Cards with flex row become column */
  .card[style*="display:flex"] {
    flex-direction: column !important;
  }

  /* Hero CTA buttons stack */
  .hero [style*="display:flex"][style*="gap:14px"] {
    flex-direction: column !important;
  }

  .hero [style*="display:flex"][style*="gap:14px"] .btn {
    width: 100%;
    justify-content: center;
  }

  /* Trust bar wraps naturally */
  .hero [style*="align-items:center"][style*="gap:24px"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .pipe { display: none; }

  /* Tab buttons scroll horizontally */
  .tabs-container > div:first-child {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs-container > div:first-child::-webkit-scrollbar { display: none; }

  /* Form rows collapse */
  .form-row { grid-template-columns: 1fr !important; }

  /* Footer grid */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* Browser mockup on mobile */
  .browser-mockup {
    font-size: 11px;
  }

  .browser-content {
    padding: 16px;
  }

  /* Calc card */
  #calc-card {
    padding: 24px !important;
  }

  /* Section headers center on mobile */
  .section-header:not(.center) {
    text-align: left;
  }

  /* Legal pages */
  div[style*="padding-left:52px"] {
    padding-left: 0 !important;
  }

  div[style*="padding:56px 64px"] {
    padding: 28px 24px !important;
  }
}

/* ── Responsive: Small Mobile ─────────────────────────────── */
@media (max-width: 380px) {
  .container { padding: 0 16px; }
  .btn { height: 48px; font-size: 13px; }
  .btn-lg { height: 52px; }
}
