/* responsive.css — surcouche mobile/tablette pour VYZOR
   Stratégie : on conserve les styles desktop existants (inline + classes)
   et on les écrase via media queries + !important sur mobile.
   Breakpoints :
     - tablette  : <= 980px
     - mobile L  : <= 720px
     - mobile S  : <= 420px
*/

html, body { -webkit-text-size-adjust: 100%; }

/* —— Bandeau "Nouvelle fonctionnalité" (FeatureBadge) —— */
@media (max-width: 480px) {
  .vz-feature-badge {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    border-radius: 20px !important;
    padding: 8px 14px !important;
    row-gap: 6px !important;
  }
  .vz-feature-badge .vz-fb-text { font-size: 12.5px; }
}

/* ============================================================
   TABLETTE  (<= 980px)
   ============================================================ */
@media (max-width: 980px) {

  /* —— Hero cinématique —— */
  .vz-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 24px clamp(16px, 5vw, 32px) !important;
    text-align: center !important;
  }
  .vz-hero-copy { text-align: center !important; }
  .vz-hero-copy p { margin-left: auto !important; margin-right: auto !important; }
  .vz-hero-copy > div:last-child { justify-content: center !important; }

  .vz-hero-brand {
    text-align: center !important;
    font-size: clamp(48px, 10vw, 84px) !important;
  }
  .vz-hero-card {
    width: 92vw !important;
    height: auto !important;
    max-height: 92vh !important;
  }
  .vz-hero-dashboard { max-width: 360px !important; }
  .vz-hero-badge-tl, .vz-hero-badge-br { display: none !important; }

  /* —— Méthodologie —— */
  .vz-method-header {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .vz-method-header > p {
    padding-left: 0 !important;
    border-left: none !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    padding-top: 16px !important;
  }
  .vz-method-panel {
    grid-template-columns: 1fr !important;
  }
  .vz-method-panel > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    padding: 28px 24px !important;
  }
  .vz-method-panel > div:last-child {
    padding: 24px !important;
  }
  /* La pastille stat (24 ratios / VYZOR SCORE / 90j) sortait du flow et
     se posait au-dessus du preview. Sur tablette/mobile on la met inline,
     en haut, alignée à gauche au-dessus du graphique. */
  .vz-method-stat {
    position: static !important;
    top: auto !important;
    right: auto !important;
    align-self: flex-start !important;
    justify-self: flex-start !important;
    margin: 0 0 16px !important;
    width: max-content !important;
  }
  /* Le wrapper grid place-items: center → on revient en flex column pour
     que la pastille apparaisse au-dessus du preview, pas centrée par-dessus. */
  .vz-method-panel > div:last-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
  }
  .vz-method-panel > div:last-child > div:nth-child(2) {
    /* le wrapper du preview — on le force pleine largeur */
    width: 100% !important;
    max-width: 100% !important;
  }

  /* —— Beta cards —— */
  .vz-beta-grid {
    grid-template-columns: 1fr !important;
  }

  /* —— Co-conception DAF —— */
  .vz-daf-header {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .vz-daf-header > p {
    padding-left: 0 !important;
    border-left: none !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    padding-top: 16px !important;
  }
  .vz-daf-panel {
    padding: 28px 24px !important;
  }
  .vz-daf-loop-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .vz-daf-rail {
    display: none !important;
  }
  .vz-daf-step {
    padding: 0 0 28px 0 !important;
    border-left: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  }
  .vz-daf-step:last-child {
    padding-bottom: 0 !important;
    border-bottom: none !important;
  }
  .vz-verbatim-grid {
    grid-template-columns: 1fr !important;
  }

  /* —— Footer —— */
  .vz-footer-main {
    grid-template-columns: 1fr !important;
    padding: 40px 28px 32px !important;
    gap: 36px !important;
  }
  .vz-footer-nav {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
  }
  .vz-footer-bottom {
    padding: 18px 28px !important;
    flex-wrap: wrap !important;
    gap: 14px !important;
  }

  /* —— Calculateurs page shell —— */
  .calc-shell { padding: 120px 28px 64px !important; }
}

/* ============================================================
   NAV COLLAPSE  (<= 900px) — bascule en menu burger
   ============================================================ */
@media (max-width: 900px) {
  .vz-nav-wrap {
    left: 12px !important;
    right: 12px !important;
    transform: none !important;
    width: auto !important;
  }
  .vz-nav-wrap > div {
    width: 100% !important;
    justify-content: space-between !important;
  }
  /* on masque les onglets inline + connexion, on garde logo + CTA + burger */
  .vz-nav-divider, .vz-nav-links, .vz-nav-login { display: none !important; }
  .vz-nav-burger { display: inline-flex !important; }
  .vz-nav-mobile { display: block !important; }
}

/* ============================================================
   MOBILE LARGE  (<= 720px)
   ============================================================ */
@media (max-width: 720px) {

  /* —— Container global de la page (RestOfPage) —— */
  .vz-page-pad {
    padding: 0 18px !important;
  }

  /* —— NAV : compresser, masquer "Se connecter" + "Calculateurs" pour ne garder que CTA —— */
  .vz-nav-wrap {
    left: 12px !important;
    right: 12px !important;
    transform: none !important;
    width: auto !important;
  }
  .vz-nav-wrap > div {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 6px !important;
    padding: 6px 6px 6px 10px !important;
  }
  .vz-nav-divider, .vz-nav-links, .vz-nav-login { display: none !important; }
  .vz-nav-cta {
    padding: 8px 12px !important;
    font-size: 11.5px !important;
  }

  /* —— Hero —— */
  .vz-hero-tagline {
    font-size: clamp(34px, 9vw, 52px) !important;
  }
  .vz-hero-card {
    width: 94vw !important;
    border-radius: 24px !important;
  }
  .vz-hero-grid {
    padding: 22px 18px !important;
    gap: 20px !important;
  }
  .vz-hero-cta-row {
    flex-direction: column !important;
    width: 100% !important;
  }
  .vz-hero-cta-row > a {
    width: 100% !important;
    justify-content: center !important;
  }
  .vz-hero-cta-title {
    font-size: clamp(28px, 7.5vw, 44px) !important;
  }

  /* —— Méthodologie —— */
  .vz-method-header h2 {
    font-size: clamp(32px, 8vw, 44px) !important;
  }
  .vz-method-steps {
    gap: 10px !important;
  }
  .vz-method-step-label {
    font-size: 12px !important;
  }
  .vz-method-num {
    font-size: 44px !important;
  }
  .vz-method-panel h3 {
    font-size: 22px !important;
  }

  /* —— Features —— */
  .vz-features-head {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .vz-features-head > div:last-child {
    align-items: stretch !important;
  }
  .feat-switch {
    width: 100% !important;
    justify-content: space-between !important;
  }
  .feat-switch__btn {
    flex: 1 !important;
    padding: 10px 8px !important;
    font-size: 12px !important;
    justify-content: center !important;
  }

  /* —— Beta —— */
  .vz-beta-head {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .vz-beta-head > div:last-child { text-align: left !important; }

  /* —— Co-conception DAF —— */
  .vz-daf-header h2 {
    font-size: clamp(32px, 8vw, 44px) !important;
  }

  /* —— Variant A (legacy fallback) —— */
  .vz-vA-hero {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .vz-vA-demo {
    grid-template-columns: 1fr !important;
    padding: 28px 22px !important;
  }
  .vz-vA-faq {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .vz-vA-testimonials {
    grid-template-columns: 1fr !important;
  }

  /* —— Beta form (anciens) —— */
  .vz-betaform {
    grid-template-columns: 1fr !important;
    padding: 28px 22px !important;
    gap: 28px !important;
  }

  /* —— Footer —— */
  .vz-footer-main {
    padding: 32px 20px 28px !important;
  }
  .vz-footer-nav {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px 18px !important;
  }
  .vz-footer-bottom {
    padding: 16px 20px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .vz-footer-bottom > div:last-child {
    flex-wrap: wrap !important;
    gap: 12px 16px !important;
  }

  /* Footer signature géante : on réduit la hauteur */
  .vz-footer-signature {
    height: 80px !important;
  }

  /* —— Calculateurs page —— */
  .calc-shell { padding: 100px 18px 56px !important; }
  .calc-nav-pill {
    left: 12px !important;
    right: 12px !important;
    transform: none !important;
    padding: 6px 10px !important;
    gap: 6px !important;
  }
  .calc-nav-links { display: none !important; }
}

/* ============================================================
   MOBILE PETIT  (<= 420px)
   ============================================================ */
@media (max-width: 420px) {

  .vz-hero-tagline {
    font-size: clamp(30px, 10vw, 42px) !important;
  }
  .vz-hero-grid {
    padding: 18px 14px !important;
  }
  .vz-hero-card {
    border-radius: 20px !important;
  }
  .vz-method-num {
    font-size: 38px !important;
  }
  .vz-footer-nav {
    grid-template-columns: 1fr !important;
  }
  .feat-card { height: 88px !important; }
  .feat-card:hover { height: 168px !important; }
  .feat-card__title { font-size: 15px !important; }
  .feat-card__inner { padding: 0 16px !important; gap: 14px !important; }
}

/* ============================================================
   PERF MOBILE — désactivation des effets coûteux <= 720px
   ============================================================
   Cible : backdrop-filter, gros filter:blur, animations décoratives,
   3D / perspective. Tout est neutralisé pour éviter le jank scroll.
*/
@media (max-width: 720px) {
  /* 1. Tous les backdrop-filter → off (très cher sur GPU mobile) */
  *,
  *::before,
  *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* 2. Filter:blur sur les éléments décoratifs → off */
  [aria-hidden="true"],
  [aria-hidden="true"]::before,
  [aria-hidden="true"]::after {
    filter: none !important;
  }

  /* 3. Animations décoratives → off (uniquement sur éléments aria-hidden,
        on garde les animations utiles comme le pulse status) */
  [aria-hidden="true"],
  [aria-hidden="true"] *,
  [aria-hidden="true"]::before,
  [aria-hidden="true"]::after {
    animation: none !important;
  }

  /* 4. 3D / perspective → flatten pour économiser des composites */
  [style*="perspective"] {
    perspective: none !important;
  }

  /* 5. will-change → auto pour libérer la mémoire GPU */
  * { will-change: auto !important; }
}

/* ============================================================
   Petits tweaks transverses
   ============================================================ */


/* Empêcher les overflow horizontaux sur les badges, formulaires, etc. */
@media (max-width: 720px) {
  body { overflow-x: hidden !important; }
  img, svg { max-width: 100%; height: auto; }
  .beta-modal { padding: 24px !important; max-width: calc(100vw - 24px) !important; }
}

/* Preserve tap targets (Apple HIG : 44px minimum) */
@media (max-width: 720px) {
  a[href], button {
    min-height: 40px;
  }
  /* exclude tiny inline links inside paragraphs */
  p a, span a, .vz-nav-cta, .feat-switch__btn, .calc-shell a {
    min-height: 0;
  }
}

/* —— Duo de cartes "Explore more" : empiler sur mobile —— */
@media (max-width: 720px) {
  .vz-explore-more {
    grid-template-columns: 1fr !important;
    margin-top: -16px !important;
    margin-bottom: 56px !important;
  }
  .vz-explore-more a > div > div:last-child {
    white-space: normal !important;
  }
}
