/* =========================================================
   Page de téléchargement — CSS pur, aucune dépendance.
   Tokens, métriques et composants relevés sur
   localsend.org/fr/download (thème clair).
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Bannière : #003DA5 — Boutons : #00BFF8 */
  --bg-dark: #f5f8fd;
  --bg-card: #eaf0fa;
  --banner-bg: #003da5;
  --banner-text: #ffffff;
  --button-bg: #00bff8;
  --button-bg-hover: #00a6de;
  --button-text: #00224d;
  --subtle-bg: rgba(0, 191, 248, 0.12);
  --accent-primary: #003da5;
  --accent-secondary: #cbe9fb;
  --text-main: #0b1f3a;
  --text-muted: #48566f;
  --border-color: rgba(0, 61, 165, 0.16);

  /* Pile système au lieu d'Inter : aucune requête externe */
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --container-width: 1100px;
  --section-padding: 150px 20px;
  --card-radius: 20px;
  --transition-fast: 0.2s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  font-weight: 700;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

::selection {
  background: var(--accent-secondary);
  color: var(--text-main);
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Utilitaires ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: var(--section-padding);
}

.pt-0 {
  padding-top: 0;
}

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

.text-muted {
  color: var(--text-muted);
}

.grid {
  display: grid;
  gap: 30px;
}

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

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-12 {
  margin-bottom: 3rem;
}

/* ---------- Navbar (vidée : titre centré) ---------- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: 80px;
  z-index: 1000;
  background-color: var(--banner-bg);
  color: var(--banner-text);
}

/* Le titre reste centré sur la page, pas sur l'espace restant :
   la bascule de langue est donc positionnée en absolu. */
.navbar .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.lang-switch {
  position: absolute;
  right: 20px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--banner-text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
}

.lang-switch:hover {
  background: var(--button-bg);
  border-color: transparent;
  color: var(--button-text);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ---------- En-tête de page ---------- */
.page-header {
  padding-top: 180px;
  padding-bottom: 60px;
}

.page-header h1 {
  font-size: 3.5rem;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.page-header .subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Titres de section ---------- */
.section-header {
  margin-bottom: 60px;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Carte ---------- */
.card {
  background-color: var(--bg-card);
  border: none;
  border-radius: var(--card-radius);
  padding: 30px;
  transition: transform var(--transition-slow);
}

/* ---------- Onglets OS ---------- */
.tabs-container {
  margin-top: 40px;
}

/* Radios masqués mais focusables au clavier */
.tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.tabs-header {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.28s ease, color 0.28s ease;
}

.tab-btn:hover {
  background: var(--accent-secondary);
  color: var(--accent-primary);
}

.tab-content,
.subtitle-android,
.subtitle-ios {
  display: none;
}

/* Onglet actif : le bouton de la charte */
#os-android:checked ~ main label[for="os-android"],
#os-ios:checked ~ main label[for="os-ios"] {
  background: var(--button-bg);
  color: var(--button-text);
}

/* Sous-titre et panneau correspondants */
#os-android:checked ~ main .subtitle-android,
#os-ios:checked ~ main .subtitle-ios {
  display: inline;
}

#os-android:checked ~ main #panel-android,
#os-ios:checked ~ main #panel-ios {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

/* Anneau de focus clavier reporté sur le libellé visible */
#os-android:focus-visible ~ main label[for="os-android"],
#os-ios:focus-visible ~ main label[for="os-ios"] {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Groupes de téléchargement ---------- */
.download-group h3 {
  font-size: 1.1rem;
  color: var(--accent-primary);
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.download-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.store-badge a {
  display: inline-block;
}

.store-badge img {
  display: block;
}

.download-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
}

.download-card:hover {
  transform: translateY(-5px);
}

.app-icon {
  display: inline-flex;
  font-size: 24px;
  line-height: 1;
  color: var(--accent-primary);
}

.app-icon svg {
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* ---------- QR ---------- */
/* Le PNG embarque déjà 12 % de marge par côté (60/500 px, mesuré) :
   elle tient le rôle de zone de silence, la carte n'ajoute pas de padding,
   sinon les modules se retrouvent perdus au centre du carré. */
.qr-card {
  display: inline-block;
  padding: 0;
}

/* Pas de fond forcé ici : le PNG apporte le sien. */
.qr-card img {
  display: block;
  width: 240px;
  height: 240px;
}

/* Le titre du bloc QR n'est pas un titre de groupe : casse et couleur normales */
.qr-container h3 {
  font-size: 1.25rem;
  color: var(--text-main);
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0.5rem;
}

/* ---------- Contact ---------- */
/* Carte unique : bornée et centrée, sinon elle s'étire sur les 1100 px
   du conteneur. */
.contact .grid {
  max-width: 520px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.contact-card:hover {
  transform: translateY(-5px);
}

.contact-card p {
  color: var(--text-muted);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  color: var(--accent-primary);
}

.feature-icon svg {
  width: 36px;
  height: 36px;
  fill: currentColor;
}

.read-more {
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ---------- Footer ---------- */
.footer {
  padding: 80px 0 40px;
}

/* Deux blocs seulement : la marque à gauche, le support collé à droite */
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  margin-bottom: 60px;
}

.footer-brand .logo {
  margin-bottom: 20px;
}

.footer-brand p {
  color: var(--text-muted);
  max-width: 300px;
}

.footer-links {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 30px;
  align-items: end;
  justify-content: end;
}

.footer-links h4 {
  margin-bottom: 20px;
  color: var(--text-main);
}

.footer-links ul li {
  margin-bottom: 12px;
}

.footer-links ul li a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer-links ul li a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  :root {
    --section-padding: 80px 20px;
  }

  .container {
    padding: 0 16px;
  }

  .navbar {
    height: 76px;
  }

  .logo {
    gap: 10px;
    font-size: 1.25rem;
  }

  .lang-switch {
    right: 16px;
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .page-header {
    padding-top: 130px;
    padding-bottom: 40px;
  }

  .page-header h1 {
    font-size: 2.25rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .tabs-header {
    gap: 10px;
    margin-bottom: 35px;
  }

  .tab-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-links {
    justify-content: start;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .logo {
    gap: 8px;
    font-size: 1.2rem;
  }
}

/* ---------- Accessibilité : animations réduites ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .download-card:hover,
  .contact-card:hover {
    transform: none;
  }
}
