/* ==========================================================================
   Analyse Financière IA - Comment ça marche
   Styles responsive optimisés pour page WordPress
   ========================================================================== */

/* Variables CSS */
:root {
  /* Couleurs principales */
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;
  --warning-color: #f97316;
  
  /* Couleurs système */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-dark: #0f172a;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  
  /* Spacing responsive */
  --container-max-width: 1200px;
  --section-padding-desktop: 5rem 2rem;
  --section-padding-tablet: 4rem 1.5rem;
  --section-padding-mobile: 3rem 1rem;
  --card-padding-desktop: 2rem;
  --card-padding-mobile: 1.5rem;
  
  /* Typography responsive */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  
  /* Animations */
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset et base */
.comment-ca-marche-container {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

.comment-ca-marche-container * {
  box-sizing: border-box;
}

/* Container principal */
#analyse-financiere-app {
  width: 100%;
  min-height: 100vh;
}

/* Loading state */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  flex-direction: column;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-secondary);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === LAYOUT RESPONSIVE === */

/* Container principal responsive */
.main-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Sections responsive */
.section-hero {
  background: var(--gradient-hero);
  color: white;
  text-align: center;
  padding: var(--section-padding-desktop);
  border-radius: 16px;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.section-standard {
  padding: var(--section-padding-desktop);
  border-radius: 16px;
  margin-bottom: 3rem;
}

.section-bg-secondary {
  background: var(--bg-secondary);
}

.section-bg-white {
  background: white;
}

.section-bg-dark {
  background: var(--gradient-hero);
  color: white;
}

/* === TYPOGRAPHY RESPONSIVE === */

.hero-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: slideInUp 0.8s ease-out;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  text-align: center;
}

.section-title-white {
  color: white;
}

.section-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  line-height: 1.6;
}

.section-subtitle-white {
  color: rgba(255,255,255,0.9);
}

/* === GRILLES RESPONSIVE === */

.grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  width: 100%;
}

.grid-responsive-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  width: 100%;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
  animation: slideInUp 0.8s ease-out 0.6s both;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  width: 100%;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* === CARDS RESPONSIVE === */

.card {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: var(--card-padding-desktop);
  box-shadow: var(--shadow-lg);
  border: 1px solid #e2e8f0;
  transition: var(--transition-base);
  height: 100%;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-gradient {
  background: var(--gradient-primary);
  color: white;
}

.card-gradient-secondary {
  background: var(--gradient-secondary);
  color: white;
}

.card-gradient-accent {
  background: var(--gradient-accent);
  color: white;
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.card-title {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--text-primary);
}

.card-title-white {
  color: white;
}

.card-content {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.card-content-white {
  color: rgba(255,255,255,0.9);
}

/* === BUTTONS RESPONSIVE === */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-base);
  border: none;
  cursor: pointer;
  font-size: clamp(0.9rem, 2vw, 1rem);
  white-space: nowrap;
  text-align: center;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
}

.btn-secondary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: clamp(1rem, 2.5vw, 1.125rem);
}

.btn-xl {
  padding: 1.25rem 3rem;
  font-size: clamp(1.1rem, 2.5vw, 1.2rem);
  font-weight: 700;
}

/* Groupe de boutons responsive */
.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4rem;
  animation: slideInUp 0.8s ease-out 0.4s both;
}

/* === BADGES ET METRICS === */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-exclusive {
  background: var(--accent-color);
  color: white;
  position: absolute;
  top: 10px;
  right: 10px;
}

.metric-card {
  background: rgba(255,255,255,0.1);
  padding: 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: var(--transition-base);
  text-align: center;
}

.metric-card:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-4px);
}

.metric-value {
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  opacity: 0.8;
}

/* === PROCESSUS CARDS === */

.process-card {
  text-align: center;
  position: relative;
}

.process-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
  font-size: 2rem;
  transition: var(--transition-base);
}

.process-icon:hover {
  transform: scale(1.1);
}

.process-title {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 600;
}

.process-description {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

/* === FAQ RESPONSIVE === */

.faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 1.5rem 0;
  cursor: pointer;
  transition: var(--transition-base);
}

.faq-item:hover {
  background: rgba(37,99,235,0.02);
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 8px;
  margin: 0 -1rem;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-title {
  color: var(--text-primary);
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.1rem);
  font-weight: 600;
  flex: 1;
}

.faq-icon {
  font-size: 1.5rem;
  transition: transform 0.3s ease;
  color: var(--primary-color);
  flex-shrink: 0;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding-top 0.3s ease;
  padding-top: 0;
}

.faq-content {
  color: var(--text-secondary);
  margin: 1rem 0 0 0;
  line-height: 1.6;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

/* === TESTIMONIAL === */

.testimonial {
  max-width: 500px;
  margin: 3rem auto;
  background: rgba(255,255,255,0.05);
  padding: 2rem;
  border-radius: 16px;
  border-left: 4px solid var(--secondary-color);
}

.testimonial-content {
  font-style: italic;
  margin-bottom: 1rem;
  color: rgba(255,255,255,0.9);
  font-size: clamp(0.9rem, 2vw, 1rem);
  line-height: 1.6;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.testimonial-info {
  flex: 1;
}

.testimonial-name {
  font-weight: 600;
  color: white;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.testimonial-role {
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  color: rgba(255,255,255,0.7);
}

/* === ANIMATIONS === */

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% { transform: translateX(0px) translateY(0px); }
  50% { transform: translateX(20px) translateY(-20px); }
  100% { transform: translateX(0px) translateY(0px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.3; }
}

@keyframes grain {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(100px) translateY(100px); }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

/* === RESPONSIVE BREAKPOINTS === */

/* Tablettes */
@media (max-width: 1024px) {
  .section-hero,
  .section-standard {
    padding: var(--section-padding-tablet);
  }
  
  .main-container {
    padding: 0 1.5rem;
  }
  
  .grid-responsive {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  
  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
  }
  
  .btn-group {
    gap: 0.75rem;
  }
}

/* Mobiles */
@media (max-width: 768px) {
  .section-hero {
    min-height: 60vh;
    padding: var(--section-padding-mobile);
  }
  
  .section-standard {
    padding: var(--section-padding-mobile);
  }
  
  .main-container {
    padding: 0 1rem;
  }
  
  .grid-responsive,
  .grid-responsive-small {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .process-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .card {
    padding: var(--card-padding-mobile);
  }
  
  .btn-group {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .btn,
  .btn-lg,
  .btn-xl {
    width: 100%;
    max-width: 300px;
  }
  
  .card-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .card-icon {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  
  .faq-question {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .faq-icon {
    align-self: flex-end;
  }
}

/* Petits mobiles */
@media (max-width: 480px) {
  .section-hero,
  .section-standard {
    padding: 2rem 0.75rem;
    margin-bottom: 2rem;
  }
  
  .main-container {
    padding: 0 0.75rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  .metrics-grid,
  .process-grid {
    gap: 1rem;
  }
  
  .btn-group {
    gap: 0.75rem;
  }
  
  .metric-card {
    padding: 1rem;
  }
  
  .testimonial {
    padding: 1.5rem;
    margin: 2rem auto;
  }
  
  .testimonial-author {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
}

/* Mode sombre responsive */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
  }
  
  .card {
    background: var(--bg-secondary);
    border-color: #334155;
  }
  
  .section-bg-white {
    background: var(--bg-secondary);
  }
  
  .section-bg-secondary {
    background: #334155;
  }
}