/* ==========================================
   CASHTV - Styles globaux
   Optimisé mobile-first (iPhone, Android, tablette, desktop)
   ========================================== */

/* ---------- VARIABLES ---------- */
:root {
  --color-primary: #0A2540;
  --color-primary-light: #1E3A5F;
  --color-accent: #00C853;
  --color-accent-dark: #00A844;
  --color-gold: #FFB300;
  --color-danger: #E53935;
  --color-warning: #FB8C00;
  --color-text: #1A1A1A;
  --color-text-light: #6B7280;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8FAFC;
  --color-border: #E5E7EB;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

  --header-height: 64px;
  --container: 1200px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- RESET ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: 16px; /* Empêche le zoom auto sur iPhone */
}

/* ---------- TYPOGRAPHIE ---------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
}

h1 { font-size: clamp(1.875rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 3vw, 1.5rem); }

p { color: var(--color-text-light); }

/* ---------- CONTAINER ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 768px) {
  .container { padding: 0 32px; }
}

/* ==========================================
   HEADER
   ========================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-primary);
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1rem;
}

.logo-text span { color: var(--color-accent); }

/* Navigation desktop */
.nav-desktop {
  display: none;
  align-items: center;
  gap: 32px;
}

.nav-desktop a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.2s;
}

.nav-desktop a:hover { color: var(--color-accent); }

.header-actions {
  display: none;
  align-items: center;
  gap: 12px;
}

/* Menu mobile - burger */
.burger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

.burger span {
  width: 22px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.burger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Menu mobile - drawer */
.mobile-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  padding: 24px 20px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 99;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu.open { transform: translateX(0); }

.mobile-menu a {
  padding: 16px;
  font-size: 1.0625rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

.mobile-menu a:active { background: var(--color-bg-alt); }

.mobile-menu .menu-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- BOUTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 48px; /* Cible tactile iOS/Android */
  user-select: none;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:active { background: var(--color-accent-dark); }

.btn-secondary {
  background: var(--color-primary);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
}

.btn-outline:active { background: var(--color-bg-alt); }

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  padding: 10px 16px;
}

.btn-block { width: 100%; }

.btn-lg {
  padding: 18px 32px;
  font-size: 1.0625rem;
  min-height: 56px;
}

/* ==========================================
   HERO
   ========================================== */
.hero {
  padding: 48px 0 64px;
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  position: relative;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 200, 83, 0.1);
  color: var(--color-accent-dark);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 1.125rem;
  margin-bottom: 32px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto 40px;
}

/* Stats hero */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 560px;
  margin: 40px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.stat { text-align: center; }

.stat-value {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 800;
  color: var(--color-primary);
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* ==========================================
   SECTIONS
   ========================================== */
.section {
  padding: 64px 0;
}

.section-alt { background: var(--color-bg-alt); }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section-header h2 { margin-bottom: 12px; }
.section-header p { font-size: 1.0625rem; }

/* ---------- ÉTAPES (Comment ça marche) ---------- */
.steps {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

.step {
  background: white;
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.step:active { transform: scale(0.98); }

.step-number {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 auto 20px;
}

.step h3 { margin-bottom: 12px; }
.step p { font-size: 0.9375rem; }

/* ---------- AVANTAGES ---------- */
.features {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.feature {
  display: flex;
  gap: 16px;
  padding: 24px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.feature-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(0, 200, 83, 0.1);
  color: var(--color-accent-dark);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.feature h3 {
  font-size: 1.0625rem;
  margin-bottom: 4px;
}

.feature p { font-size: 0.9375rem; margin: 0; }

/* ---------- TÉMOIGNAGES ---------- */
.testimonials {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

.testimonial {
  background: white;
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.testimonial-text {
  font-size: 0.9375rem;
  color: var(--color-text);
  margin-bottom: 20px;
  line-height: 1.7;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.testimonial-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.testimonial-role {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

/* ---------- CTA FINAL ---------- */
.cta {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: white;
  padding: 64px 0;
  text-align: center;
}

.cta h2 {
  color: white;
  margin-bottom: 16px;
}

.cta p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.0625rem;
  max-width: 560px;
  margin: 0 auto 32px;
}

.cta .btn-primary {
  max-width: 320px;
  margin: 0 auto;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.7);
  padding: 48px 0 24px;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  margin-bottom: 40px;
}

.footer-brand .logo { color: white; margin-bottom: 16px; }
.footer-brand p { color: rgba(255, 255, 255, 0.6); font-size: 0.875rem; }

.footer h4 {
  color: white;
  font-size: 0.9375rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: white; }

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ==========================================
   FORMULAIRES (register, login, contact)
   ========================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: var(--color-bg-alt);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.auth-card > p {
  font-size: 0.9375rem;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.form-label .required { color: var(--color-danger); }

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
  min-height: 52px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.15);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--color-text-light);
  margin-top: 6px;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--color-danger);
  margin-top: 6px;
  display: none;
}

.form-error.show { display: block; }

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--color-text-light);
  cursor: pointer;
  user-select: none;
}

.form-checkbox input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}

.form-checkbox a {
  color: var(--color-accent-dark);
  font-weight: 600;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9375rem;
  color: var(--color-text-light);
}

.auth-footer a {
  color: var(--color-accent-dark);
  font-weight: 600;
}

.form-row {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

/* ==========================================
   PAGES DE CONTENU (a-propos, faq, cgu...)
   ========================================== */
.page-header {
  padding: 48px 0 32px;
  background: var(--color-bg-alt);
  text-align: center;
}

.page-header h1 { margin-bottom: 8px; }
.page-header p { font-size: 1.0625rem; max-width: 640px; margin: 0 auto; }

.content {
  padding: 48px 0;
  max-width: 800px;
  margin: 0 auto;
}

.content h2 {
  font-size: 1.5rem;
  margin-top: 40px;
  margin-bottom: 16px;
}

.content h2:first-child { margin-top: 0; }

.content h3 {
  font-size: 1.125rem;
  margin-top: 28px;
  margin-bottom: 12px;
}

.content p {
  margin-bottom: 16px;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.75;
}

.content ul, .content ol {
  margin-bottom: 16px;
  padding-left: 24px;
  color: var(--color-text);
}

.content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.content a {
  color: var(--color-accent-dark);
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  background: white;
  transition: background 0.2s;
  min-height: 60px;
}

.faq-question:active { background: var(--color-bg-alt); }

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-accent-dark);
  transition: transform 0.3s;
  font-size: 1.125rem;
}

.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer { max-height: 500px; }

.faq-answer-inner {
  padding: 0 20px 20px;
  color: var(--color-text-light);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ---------- TARIFS ---------- */
.pricing {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

.pricing-card {
  background: white;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card.featured {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent);
  color: white;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 16px 0;
  line-height: 1;
}

.pricing-price span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-light);
}

.pricing-features {
  list-style: none;
  margin: 24px 0;
  padding: 0;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.pricing-features li::before {
  content: '✓';
  color: var(--color-accent);
  font-weight: 800;
  flex-shrink: 0;
}

/* ---------- CONTACT ---------- */
.contact-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.contact-item-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: rgba(0, 200, 83, 0.1);
  color: var(--color-accent-dark);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.contact-item h4 {
  font-size: 0.9375rem;
  margin-bottom: 2px;
}

.contact-item p {
  font-size: 0.875rem;
  margin: 0;
}

/* ==========================================
   RESPONSIVE - TABLETTE (≥ 640px)
   ========================================== */
@media (min-width: 640px) {
  .hero-actions {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }

  .hero-actions .btn { flex: 0 1 auto; }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .steps { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .testimonials { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================
   RESPONSIVE - DESKTOP (≥ 1024px)
   ========================================== */
@media (min-width: 1024px) {
  .nav-desktop { display: flex; }
  .header-actions { display: flex; }
  .burger { display: none; }
  .mobile-menu { display: none; }

  .hero { padding: 80px 0 100px; }

  .section { padding: 96px 0; }

  .steps { grid-template-columns: repeat(4, 1fr); }
  .features { grid-template-columns: repeat(3, 1fr); }
  .testimonials { grid-template-columns: repeat(3, 1fr); }
  .pricing { grid-template-columns: repeat(3, 1fr); }

  .step:hover,
  .pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
  }

  .feature:hover {
    border-color: var(--color-accent);
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .footer-bottom { text-align: left; }
}

/* ==========================================
   SUPPORT NOTCH (iPhone X+)
   ========================================== */
@supports (padding: env(safe-area-inset-top)) {
  .header {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-height) + env(safe-area-inset-top));
  }
  .mobile-menu {
    top: calc(var(--header-height) + env(safe-area-inset-top));
  }
  .footer {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* ==========================================
   UTILITAIRES
   ========================================== */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.hidden { display: none; }

/* ==========================================
   ACCESSIBILITÉ
   ========================================== */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}