/* FASTCHECK - DESIGN SYSTEM */

/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: #C75450 #F5F2ED;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: #485B69;
  background-color: #F5F2ED;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* CSS Variables - apenas shadows e transitions (cores vivem no tailwind.config) */
:root {
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-coral: 0 4px 14px 0 rgba(199, 84, 80, 0.25);
  --shadow-coral-lg: 0 8px 25px 0 rgba(199, 84, 80, 0.35);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth Scrolling */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ── ANIMATIONS ─────────────────────────────────────────────── */

@keyframes blob {
  0%   { transform: translate(0px, 0px) scale(1); }
  33%  { transform: translate(30px, -50px) scale(1.1); }
  66%  { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0px, 0px) scale(1); }
}

@keyframes fade-in-up {
  0%   { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
  0%   { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes slide-up {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.05); opacity: 0.9; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes animate-in {
  0%   { opacity: 0; transform: translateY(16px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes success-bounce {
  0%   { transform: scale(0.3); }
  50%  { transform: scale(1.05); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

@keyframes error-shake {
  0%, 100%                    { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90%     { transform: translateX(-10px); }
  20%, 40%, 60%, 80%          { transform: translateX(10px); }
}

/* Animation Classes */
.animate-blob           { animation: blob 7s infinite; }
.animation-delay-2000   { animation-delay: 2s; }
.animation-delay-4000   { animation-delay: 4s; }
.animate-pulse          { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-spin           { animation: spin 1s linear infinite; }
.fade-in-up             { animation: fade-in-up 0.6s ease-out forwards; }
.scale-in               { animation: scale-in 0.3s ease-out forwards; }
.slide-up               { animation: slide-up 0.4s ease-out forwards; }
.animate-in             { animation: animate-in 0.6s ease-out; }
.success-state          { animation: success-bounce 0.6s ease-out; }
.error-shake            { animation: error-shake 0.5s ease-in-out; }

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ── HEADER ─────────────────────────────────────────────────── */

.header {
  transition: all var(--transition-normal);
  will-change: transform, box-shadow;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

/* Logo - logofast.svg */
.header img[alt="FastCheck"] {
  height: 50px;
  width: auto;
  transition: all var(--transition-normal);
  object-fit: contain;
}

.mobile-menu img[alt="FastCheck"] {
  height: 42px;
  width: auto;
  object-fit: contain;
}

footer img[alt="FastCheck"] {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* ── MOBILE MENU ────────────────────────────────────────────── */

.mobile-menu {
  transition: transform var(--transition-normal);
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ── FORMS ──────────────────────────────────────────────────── */

.form-card {
  position: relative;
  transition: all var(--transition-normal);
}

.form-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(72, 91, 105, 0.15);
}

.form-field.valid input,
.valid input {
  border-color: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-field.invalid input,
.invalid input {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ── BUTTONS ────────────────────────────────────────────────── */

.btn-gradient {
  background: linear-gradient(135deg, #C75450 0%, #A8453F 100%);
  position: relative;
  overflow: hidden;
}

.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-gradient:hover::before {
  left: 100%;
}

.btn-loading .submit-text { display: none; }
.btn-loading .loading-text { display: inline; }
.btn-loading { opacity: 0.7; cursor: not-allowed; }

/* ── CARDS ──────────────────────────────────────────────────── */

.solution-card,
.case-card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.solution-card:hover,
.case-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.stats-card {
  transition: all var(--transition-normal);
}

.stats-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(72, 91, 105, 0.15);
}

.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(72, 91, 105, 0.15);
}

/* ── COUNTER ────────────────────────────────────────────────── */

.counter {
  font-variant-numeric: tabular-nums;
  transition: all var(--transition-normal);
}

/* ── DEMO MODAL ─────────────────────────────────────────────── */

.demo-modal {
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.demo-modal.open {
  opacity: 1;
  visibility: visible;
}

.demo-modal.open > div {
  transform: scale(1);
}

.demo-modal > div {
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

/* ── NOTIFICATIONS ──────────────────────────────────────────── */

.notification {
  transition: all var(--transition-normal);
}

.notification.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── FAQ ────────────────────────────────────────────────────── */

.faq-item {
  transition: all var(--transition-normal);
}

/* JS controla max-height via scrollHeight - CSS apenas define o overflow/transition */
.faq-answer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal), opacity var(--transition-normal);
}

.faq-item.active .faq-answer {
  opacity: 1;
  /* max-height definido pelo JS para acomodar conteudo de qualquer tamanho */
}

.faq-icon {
  transition: transform var(--transition-normal);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

/* ── GRADIENT TEXT ───────────────────────────────────────────── */

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

/* ── SCROLLBAR ──────────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #F5F2ED; }
::-webkit-scrollbar-thumb { background: #C75450; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #A8453F; }

/* ── FOCUS & SELECTION ──────────────────────────────────────── */

*:focus {
  outline: 2px solid #C75450;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #C75450;
  outline-offset: 2px;
}

::selection {
  background: rgba(199, 84, 80, 0.2);
  color: #485B69;
}

/* ── ACCESSIBILITY ──────────────────────────────────────────── */

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── PRINT ──────────────────────────────────────────────────── */

@media print {
  .header,
  .whatsapp-float,
  .demo-modal,
  .mobile-menu {
    display: none !important;
  }
  body {
    font-size: 12pt;
    line-height: 1.4;
  }
}

/* ── HIGH CONTRAST ──────────────────────────────────────────── */

@media (prefers-contrast: high) {
  .bg-cream-50 { background-color: #ffffff; }
  .text-slate-600 { color: #000000; }
}

/* ── REDUCED MOTION ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .animate-blob,
  .animate-pulse {
    animation: none;
  }
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hero { padding-top: 140px; }
  .container { padding-left: 16px; padding-right: 16px; }

  /* Touch targets minimos (WCAG) */
  button, a { min-height: 44px; min-width: 44px; }

  .header img[alt="FastCheck"] { height: 48px; }
  .mobile-menu img[alt="FastCheck"] { height: 40px; }
  footer img[alt="FastCheck"] { height: 40px; }
}

@media (max-width: 480px) {
  .header img[alt="FastCheck"] { height: 40px; }
  .mobile-menu img[alt="FastCheck"] { height: 34px; }
  footer img[alt="FastCheck"] { height: 34px; }
}
