@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #0A2540; /* Stripe dark blue */
  --accent: #635BFF; /* Stripe blurple */
  --accent-hover: #4B45D6;
  --bg: #F6F9FC; /* Very light blue/gray */
  --surface: #FFFFFF;
  --border: #E6EBF1;
  --text-main: #425466; /* Readable gray for labels */
  --text-dark: #0A2540; /* Headings */
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4 { color: var(--text-dark); }

/* Form Elements (High Contrast & Pro) */
.input-group {
  margin-bottom: 1rem;
}
.input-group label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.375rem;
}
input[type="number"], select, input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  background-color: var(--surface);
  border: 1px solid #CBD5E1; /* Stronger border for contrast */
  border-radius: 6px;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-dark);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* Subtle depth */
  transition: all 0.2s ease;
}
input[type="number"]:focus, select:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.2);
}
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; margin: 0; 
}

/* Tooltips */
.tooltip-icon {
  color: #94A3B8;
  cursor: help;
  transition: color 0.2s;
}
.tooltip-icon:hover { color: var(--accent); }
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 6px; padding: 6px 10px;
  background-color: var(--text-dark); color: white;
  font-size: 0.75rem; font-weight: 400; border-radius: 4px;
  white-space: nowrap; z-index: 50; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  pointer-events: none;
}

/* Accordion (Advanced Settings) */
details.advanced-settings {
  background-color: #F8FAFC;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  overflow: hidden;
}
details.advanced-settings > summary {
  list-style: none; cursor: pointer; padding: 1rem;
  font-size: 0.875rem; font-weight: 600; color: var(--text-dark);
  display: flex; align-items: center; justify-content: space-between;
  background-color: #F1F5F9; /* Gray background for summary */
}
details.advanced-settings > summary::-webkit-details-marker { display: none; }
.details-content {
  padding: 1.25rem;
  background-color: var(--surface);
  border-top: 1px solid #CBD5E1;
}

/* Tabs */
.tab-btn {
  padding: 0.75rem 0;
  border-bottom: 2px solid transparent;
  color: #64748B; font-weight: 500; font-size: 0.9375rem;
  transition: all 0.2s;
}
.active-tab { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.inactive-tab:hover { color: var(--text-dark); }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.card:hover { box-shadow: 0 12px 24px -8px rgba(10,37,64,0.12); }

/* Typography system: replaces scattered ad-hoc heading sizes */
.section-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: var(--text-dark); margin-bottom: 0.75rem; }
.section-subtitle { font-size: 1rem; font-weight: 500; letter-spacing: -0.006em; line-height: 1.6; color: var(--text-main); margin-bottom: 2rem; }
.card-title { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; color: var(--text-dark); }

/* Primary button: replaces repeated inline Tailwind soup on every CTA */
.btn-primary {
  background-color: var(--accent); color: #fff; font-weight: 600; border-radius: 6px;
  padding: 0.75rem 1.5rem; display: inline-flex; align-items: center; gap: 0.5rem;
  box-shadow: 0 4px 14px 0 rgba(99,91,255,0.39);
  transition: background-color 0.18s cubic-bezier(0.4,0,0.2,1), box-shadow 0.18s cubic-bezier(0.4,0,0.2,1), transform 0.1s ease;
}
.btn-primary:hover { background-color: var(--accent-hover); box-shadow: 0 6px 18px 0 rgba(99,91,255,0.45); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(99,91,255,0.18); }
.btn-primary i[data-lucide="arrow-right"] { transition: transform 0.18s cubic-bezier(0.4,0,0.2,1); }
.btn-primary:hover i[data-lucide="arrow-right"] { transform: translateX(3px); }

.btn-secondary {
  background: #fff; color: var(--text-dark); font-weight: 600; border-radius: 6px;
  border: 1px solid #CBD5E1; padding: 0.75rem 1.5rem; display: inline-flex; align-items: center; gap: 0.5rem;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}
.btn-secondary:hover { background-color: #F8FAFC; border-color: var(--accent); }
.btn-secondary:active { transform: scale(0.98); }

/* Choice cards: radio/checkbox "selection card" pattern used throughout the wizard */
.choice-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1rem 0.875rem; border: 1.5px solid #E2E8F0; border-radius: 10px;
  font-size: 0.8125rem; font-weight: 600; color: #425466; cursor: pointer; background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, color 0.18s ease;
}
.choice-card i { color: #94A3B8; transition: color 0.18s ease; }
.choice-card:hover { border-color: #B9B4FF; box-shadow: 0 2px 8px rgba(10,37,64,0.06); }
.peer:checked + .choice-card {
  border-color: var(--accent); color: var(--primary);
  background: linear-gradient(180deg, rgba(99,91,255,0.06), rgba(99,91,255,0.02));
  box-shadow: 0 6px 16px -6px rgba(99,91,255,0.35), 0 0 0 3px rgba(99,91,255,0.12);
  transform: translateY(-1px) scale(1.015);
}
.peer:checked + .choice-card i { color: var(--accent); }
.peer:checked + .choice-card::after {
  content: "✓"; position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff;
}

/* Trust cards ("Pourquoi nous faire confiance") */
.trust-card {
  padding: 1.75rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.trust-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px -10px rgba(10,37,64,0.14); border-color: #635BFF33; }
.trust-card .icon-wrap {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,91,255,0.12), rgba(0,212,255,0.08));
}

/* Formula/pricing cards (creation-entreprise.html) */
.formule-card {
  padding: 2rem 1.75rem; border-width: 1px; border-color: var(--border);
  box-shadow: 0 2px 8px -2px rgba(10,37,64,0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.formule-card:hover { transform: translateY(-6px); box-shadow: 0 16px 32px -12px rgba(10,37,64,0.16); }
.formule-card.featured {
  border-color: #635BFF; border-width: 2px;
  box-shadow: 0 20px 40px -14px rgba(99,91,255,0.28), 0 0 0 1px rgba(99,91,255,0.08);
  transform: scale(1.03);
}
.formule-card.featured:hover { transform: scale(1.03) translateY(-6px); }

/* Tactile press feedback on buttons */
button:not(:disabled):active { transform: scale(0.98); }

/* Wizard stepper */
.wizard-dot {
  width: 20px; height: 20px; border-radius: 50%; background: #E6EBF1;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: transparent;
  transition: background 0.3s, transform 0.3s;
}
.wizard-dot.active { background: #635BFF; transform: scale(1.15); box-shadow: 0 0 0 4px rgba(99,91,255,0.15); }
.wizard-dot.done { background: #635BFF; color: #fff; }
.wizard-dot.done::before { content: "✓"; }
.wizard-line { width: 40px; height: 2px; background: #E6EBF1; transition: background 0.4s ease; }
.wizard-line.filled { background: #635BFF; }

/* Wizard form card: a touch more premium than a plain .card */
#companyForm.card {
  border-radius: 18px;
  box-shadow: 0 20px 40px -14px rgba(10,37,64,0.14), 0 4px 10px -4px rgba(10,37,64,0.06);
  position: relative;
  overflow: hidden;
}
#companyForm.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #635BFF, #00D4FF);
}
@keyframes wizardStepIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
.wizard-step-anim { animation: wizardStepIn 0.35s ease; }

/* Scroll-reveal animations */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-scale { opacity: 0; transform: translateY(28px) scale(0.93); transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1); }
.reveal-scale.visible { opacity: 1; transform: translateY(0) scale(1); }

.reveal-left { opacity: 0; transform: translateX(-48px); transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1); }
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right { opacity: 0; transform: translateX(48px); transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1); }
.reveal-right.visible { opacity: 1; transform: translateX(0); }

/* Numbered timeline (used by "de l'idée au Kbis" style sections) */
.timeline-num {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #635BFF, #00D4FF);
  color: #fff; font-size: 1.25rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px -6px rgba(99,91,255,0.45);
  position: relative; z-index: 2;
}

/* Hero: plays immediately on load, so motion is obvious even without scrolling */
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hero-anim { opacity: 0; animation: heroFadeUp 0.8s ease forwards; }
.hero-anim-1 { animation-delay: 0.05s; }
.hero-anim-2 { animation-delay: 0.18s; }
.hero-anim-3 { animation-delay: 0.31s; }
.hero-anim-4 { animation-delay: 0.44s; }

/* Decorative hero background (purely cosmetic) */
.hero-gradient {
  background:
    radial-gradient(ellipse 70% 50% at 15% -10%, rgba(99,91,255,0.16), transparent 60%),
    radial-gradient(ellipse 55% 45% at 100% 0%, rgba(0,212,255,0.14), transparent 55%),
    radial-gradient(circle, rgba(10,37,64,0.05) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 24px 24px, auto;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 30%, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 30%, black 40%, transparent 85%);
}

/* Result Box */
.result-box {
  background-color: var(--primary); color: white;
  border-radius: 8px; padding: 2rem;
  box-shadow: 0 10px 25px -5px rgba(10, 37, 64, 0.3);
}

/* Custom select (replaces native <select> for a non-"Excel" look) */
.custom-select { position: relative; }
.custom-select-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: #fff; border: 1px solid #CBD5E1; border-radius: 6px; padding: 0.625rem 0.75rem;
  font-size: 0.875rem; font-weight: 500; color: #0A2540; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: border-color 0.2s, box-shadow 0.2s;
}
.custom-select-trigger:hover { border-color: #635BFF; }
.custom-select-trigger.open { border-color: #635BFF; box-shadow: 0 0 0 3px rgba(99,91,255,0.15); }
.custom-select-trigger .custom-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-trigger i { flex-shrink: 0; transition: transform 0.2s; }
.custom-select-trigger.open i { transform: rotate(180deg); }
.custom-select-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: #fff; border: 1px solid #E6EBF1; border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(10,37,64,0.15), 0 4px 6px -2px rgba(10,37,64,0.05);
  max-height: 300px; overflow-y: auto; padding: 6px;
}
.custom-select-group-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #94A3B8; padding: 10px 10px 4px; }
.custom-select-option { padding: 8px 10px; font-size: 0.875rem; color: #425466; border-radius: 6px; cursor: pointer; transition: background 0.1s; }
.custom-select-option:hover { background: #F6F9FC; color: #0A2540; }
.custom-select-option.selected { background: #635BFF; color: #fff; font-weight: 600; }
.sr-only-select { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Pricing: billing toggle & tier cards (shared by landing + pricing modal) */
.billing-toggle { color: #64748B; }
.billing-toggle.active { background: #fff; color: #0A2540; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.tier-option { border-color: #E6EBF1; }
.tier-option.selected { border-color: #635BFF; }
.pricing-card { border-color: #E6EBF1; }
.pricing-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -8px rgba(10,37,64,0.12); }
.pricing-card.featured { border-color: #635BFF; box-shadow: 0 8px 20px -6px rgba(99,91,255,0.2); }
.pricing-card.featured:hover { transform: translateY(-3px); box-shadow: 0 16px 28px -8px rgba(99,91,255,0.28); }

/* Pro Badge */
.pro-badge {
  background: linear-gradient(135deg, #635BFF, #00D4FF);
  color: white; font-size: 0.65rem; font-weight: 700;
  padding: 0.15rem 0.4rem; border-radius: 4px; letter-spacing: 0.05em; text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(99,91,255,0.3);
}

/* Range Slider */
input[type=range] {
  -webkit-appearance: none; width: 100%; background: transparent;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; height: 20px; width: 20px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
  margin-top: -8px; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%; height: 4px; cursor: pointer;
  background: #CBD5E1; border-radius: 2px;
}

/* Stripe-like Loading Spinner */
.spinner {
  border: 3px solid rgba(255,255,255,0.3); border-radius: 50%;
  border-top: 3px solid white; width: 20px; height: 20px;
  -webkit-animation: spin 1s linear infinite; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* PDF PRINT STYLES - ULTRA PRO */
@media print {
  @page { margin: 1.5cm; size: A4 portrait; }
  body { background: white !important; color: black !important; font-size: 11pt; }
  
  .no-print { display: none !important; }
  
  /* Reset layout for print */
  main { max-width: 100% !important; padding: 0 !important; }
  .grid { display: block !important; }
  .lg\:col-span-7 { display: none !important; } /* Hide left form entirely */
  .lg\:col-span-5 { width: 100% !important; display: block !important; position: static !important; }
  
  /* Custom Print Header (Injected via JS before print, or styled here) */
  body::before {
    content: "RAPPORT DE RENTABILITÉ FINANCIÈRE";
    display: block; font-size: 18pt; font-weight: bold; color: #0A2540;
    text-align: center; margin-bottom: 20px; border-bottom: 2px solid #0A2540; padding-bottom: 10px;
  }
  body::after {
    content: "Généré par Rentabilix PRO - Application SaaS de gestion de rentabilité.";
    display: block; position: fixed; bottom: 0; left: 0; width: 100%;
    text-align: center; font-size: 8pt; color: #888; border-top: 1px solid #ccc; padding-top: 10px;
  }

  /* Result Box redesign for print */
  .result-box { 
    background-color: white !important; color: black !important; 
    border: 2px solid #0A2540; box-shadow: none !important; 
    border-radius: 0 !important; margin-bottom: 30px;
  }
  .result-box * { color: black !important; border-color: #ccc !important; }
  
  /* Chart container */
  .card { border: none !important; box-shadow: none !important; }
  canvas { max-height: 400px !important; }
}
