/*
 * responsive.css — BEYENI
 * Media queries — mobile first.
 * Breakpoints : sm 640 | md 768 | lg 1024 | xl 1280
 * ⚠️ Toujours via var(--byn-*) — jamais de couleurs hardcodées.
 */

/* ─────────────────────────────────────────────────────────────────────
   ≤ 1280px — Réduire les marges container
───────────────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .byn-listing__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .byn-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .byn-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   ≤ 1024px — Tablette paysage
───────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {

  /* Header */
  .byn-header__nav {
    display: none;
  }
  .byn-header__burger {
    display: flex;
  }

  /* Dashboard — nav en overlay */
  .byn-dash {
    grid-template-columns: 1fr;
  }

  .byn-dash-nav {
    transform: translateX(-100%);
  }
  .byn-dash-nav.is-open {
    transform: translateX(0);
  }

  .byn-dash-content {
    grid-column: 1;
    padding: 1.5rem;
  }

  /* Overlay sombre quand nav dash ouverte */
  .byn-dash-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(13,19,33,.5);
    z-index: 49;
  }
  .byn-dash-overlay.is-visible {
    display: block;
  }

  /* Listing */
  .byn-listing {
    grid-template-columns: 1fr;
  }

  .byn-listing__filters {
    position: static;
  }

  /* Auth */
  .byn-auth__visual {
    display: none;
  }
  .byn-auth {
    grid-template-columns: 1fr;
  }
  .byn-auth__form-side {
    padding: 2rem 1.5rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   ≤ 768px — Tablette portrait
───────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Variables */
  :root {
    --byn-header-h: 60px;
  }

  /* Header */
  .byn-header__actions .byn-btn--ghost {
    display: none;
  }

  /* Listing grid → 1 colonne */
  .byn-listing__grid {
    grid-template-columns: 1fr;
  }

  /* KPI grid → 2 colonnes */
  .byn-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Dashboard content */
  .byn-dash-content {
    padding: 1rem;
  }

  .byn-dash-content__header {
    margin-bottom: 1.25rem;
  }

  /* Footer */
  .byn-footer__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .byn-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Form rows → 1 colonne */
  .byn-form-row--2,
  .byn-form-row--3 {
    grid-template-columns: 1fr;
  }

  /* Auth */
  .byn-auth__form-side {
    padding: 2rem 1.25rem;
    justify-content: flex-start;
    padding-top: 3rem;
  }

  .byn-auth__form-box {
    max-width: 100%;
  }

  /* Modal plein écran */
  .byn-modal {
    border-radius: var(--byn-radius-lg) var(--byn-radius-lg) 0 0;
    max-height: 85vh;
    margin-top: auto;
  }
  .byn-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  /* Panneau notifications */
  .byn-notif-panel {
    width: 100%;
  }

  /* Boutons */
  .byn-btn--sm {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   ≤ 640px — Mobile
───────────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {

  /* Typographie */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }

  /* Header */
  .byn-header__inner {
    padding-inline: 1rem;
    gap: 0.75rem;
  }

  .byn-header__user-btn .byn-badge {
    display: none;
  }

  /* KPI grid → 1 colonne */
  .byn-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Cards */
  .byn-card__specs {
    gap: 0.625rem;
  }

  /* Toast */
  .byn-toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  .byn-toast {
    min-width: unset;
    max-width: 100%;
  }

  /* Pagination */
  .byn-pagination__btn {
    min-width: 36px;
    height: 36px;
    font-size: 0.875rem;
  }

  /* Page pending */
  .byn-pending {
    padding: 2rem 1.25rem;
  }

  /* Auth */
  .byn-auth__form-title {
    font-size: 1.5rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   PRINT
───────────────────────────────────────────────────────────────────── */
@media print {
  .byn-header,
  .byn-footer,
  .byn-dash-nav,
  .byn-toast-container,
  .byn-modal-overlay {
    display: none !important;
  }

  .byn-dash-content {
    padding: 0;
    grid-column: 1;
  }

  .byn-dash {
    grid-template-columns: 1fr;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.75rem;
    color: var(--byn-gray);
  }
}

/* ─────────────────────────────────────────────────────────────────────
   PRÉFÉRENCE MOUVEMENT RÉDUIT
───────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}