/* =========================================================
   RESET GLOBAL & VARIABLES
   ========================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #00d4ff;
  --bg-dark: #020617;
  --text-light: #e5e7eb;
}

/* =========================================================
   BASE : BODY / TYPO / BACKGROUND
   ========================================================= */

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
  background: radial-gradient(circle at 0% 0%, #0f172a 0, #020617 55%);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   TOP BAR / HEADER
   ========================================================= */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  position: relative;
  z-index: 10;
}

/* Pastille KUCK (logo + texte + badge) */
.brand-pill {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  max-width: 460px;
}

/* Logo KUCK dans la pastille */
.top-bar .brand-pill > img {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
}

/* Bloc texte (KUCK + sous-titre) */
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #00d4ff;
  margin-bottom: 5px;
}

.brand-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: #cbd5f5;
}

/* Badge "Demo" à droite de la pastille */
.badge-beta {
  margin-left: auto;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.15);
}

/* Boutons de langue (FR / EN) */
.lang-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.lang-btn.active {
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.15);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

.lang-btn:hover:not(.active) {
  color: #00d4ff;
  background: rgba(0, 212, 255, 0.08);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
  text-shadow: 0 0 6px rgba(0, 212, 255, 0.4);
}

.lang-btn:active {
  transform: scale(0.95);
}

/* =========================================================
   CONTENU : TEXTE PRINCIPAL & POINTS
   ========================================================= */

.main-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.1fr);
  gap: 36px;
  padding: 0 40px 40px;
  align-items: center;
}

.copy-block {
  max-width: 520px;
  position: relative;
  z-index: 5;
}

/* Petit badge au-dessus du titre (ex : "Démo WebAR…") */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(37, 99, 235, 0.55);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: #93c5fd;
  margin-bottom: 14px;
}

/* Titre principal */
h1 {
  font-size: clamp(32px, 4vw, 40px);
  line-height: 1.1;
  margin-bottom: 16px;
}

h1 span {
  color: #00d4ff;
}

/* Sous-titre / paragraphe principal */
.subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: #9ca3af;
  margin-bottom: 22px;
}

/* Liste des points (puces) */
.points {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}

.point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #cbd5f5;
}

/* Icône carrée à gauche de chaque point */
.point-icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* Message d’aide sous le bouton (scan QR etc.) */
.qr-guidance {
  margin-top: 16px;
  text-align: center;
}

.guidance-text {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
  padding: 8px 16px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 8px;
  display: inline-block;
  transition: all 0.2s ease;
}

.guidance-text:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-1px);
}

/* =========================================================
   CARTE VIEWER (BLOC DE DROITE)
   ========================================================= */

.viewer-card {
  position: relative;
  border-radius: 26px;
  padding: 14px;
  background: radial-gradient(circle at top left, #1d293b 0, #020617 45%);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.95);
  overflow: hidden;
  min-height: 320px;
}

/* Header de la carte (badge "Prévisualisation" + état AR) */
.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: #9ca3af;
  font-size: 12px;
}

.viewer-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Statut AR prête + éventuels autres indicateurs */
.viewer-meta {
  font-size: 11px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.viewer-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.viewer-meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

/* Composant <model-viewer> */
model-viewer {
  width: 100%;
  height: min(60vh, 480px); /* hauteur par défaut (mobile / tablette) */
  border-radius: 20px;
  overflow: hidden;
  background: #020617;

  /* Désactiver le highlight UI intégré & remonter un peu le modèle */
  --model-viewer-ui-hover-highlight: none;
  object-position: 50% 40%;
}

/* Footer du viewer (légendes : glisser / pincer) */
.viewer-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #9ca3af;
}

.viewer-footer-legend {
  display: flex;
  gap: 8px;
  align-items: center;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.legend-dot.blue {
  background: #60a5fa;
}

.legend-dot.green {
  background: #22c55e;
}

/* =========================================================
   TEXTE D'INSTRUCTION AR (BANNIÈRE AU-DESSUS DU VIEWER)
   ========================================================= */

.ar-direct-hint {
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.15),
    rgba(37, 99, 235, 0.15)
  );
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 14px;
  font-weight: 500;
  color: #e5e7eb;
  text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
  animation: pulse-hint 2s ease-in-out infinite;
}

.ar-direct-hint .ar-button-name {
  color: #00d4ff;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* Animation de respiration de la bannière d'instruction */
@keyframes pulse-hint {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 212, 255, 0.3);
  }
}

/* =========================================================
   BOUTON AR DANS MODEL-VIEWER
   ========================================================= */

.ar-button {
  background: #00d4ff;
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(0, 212, 255, 0.7);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

/* Effet hover sur le bouton AR */
.ar-button:hover {
  transform: translateX(-50%) translateY(-1px);
  background: #00b8e6;
  box-shadow: 0 18px 44px rgba(0, 212, 255, 0.88);
}

/* =========================================================
   CTA PRINCIPAL : BOUTON "TÉLÉCHARGER LE QR CODE"
   ========================================================= */

.cta-main {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  position: relative;
  overflow: hidden;

  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.55),
    0 0 20px rgba(37, 99, 235, 0.3);
  transition: all 0.18s ease;
  animation: pulse-download 3s ease-in-out infinite;
}

.cta-main:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 50%, #1e3a8a 100%);
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.75),
    0 0 30px rgba(37, 99, 235, 0.5);
}

.cta-main:active {
  opacity: 0.9;
}

/* Animation légère sur le bouton de téléchargement */
@keyframes pulse-download {
  0%,
  100% {
    box-shadow: 0 16px 38px rgba(37, 99, 235, 0.55),
      0 0 20px rgba(37, 99, 235, 0.3);
  }
  50% {
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.65),
      0 0 25px rgba(37, 99, 235, 0.4);
  }
}

.cta-main span {
  font-size: 18px;
}

/* =========================================================
   SECTION BOUTONS QR (CTA + SECONDAIRE)
   ========================================================= */

.qr-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

@media (min-width: 900px) {
  .qr-actions {
    flex-direction: row;
    justify-content: center;
    gap: 16px;
  }
}

/* Bouton secondaire (si besoin) */
.cta-secondary {
  background: rgba(0, 212, 255, 0.15);
  color: #00d4ff;
  border: 1px solid rgba(0, 212, 255, 0.3);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.18s ease;
  backdrop-filter: blur(8px);
}

.cta-secondary:hover {
  background: rgba(0, 212, 255, 0.25);
  border-color: rgba(0, 212, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
}

/* =========================================================
   CLASSE UTILITAIRE : "DESKTOP ONLY"
   ========================================================= */

.desktop-only {
  display: block;
}

/* Cache les éléments .desktop-only sur les écrans <= 900px */
@media (max-width: 900px) {
  .desktop-only {
    display: none !important;
  }
}

/* =========================================================
   RESPONSIVE : MOBILE / TABLETTE (< 900px)
   ========================================================= */

@media (max-width: 900px) {
  .top-bar {
    padding: 14px 18px;
    justify-content: center;
  }

  .top-bar .brand-pill > img {
    width: 38px;
    height: 38px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .badge-beta {
    font-size: 10px;
    padding: 3px 8px;
  }

  .qr-actions {
    margin-top: 20px;
  }

  .main-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 18px 26px;
    gap: 20px;
  }

  /* En mobile, on passe le viewer au-dessus ou en-dessous du texte
     en jouant sur l'ordre si nécessaire. Actuellement : viewer en premier. */
  .viewer-card {
    order: -1;
  }

  model-viewer {
    height: 340px;
  }

  .cta-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Variante possible (commentée) pour inverser l'ordre :
   mettre le texte avant le viewer en mobile.

@media (max-width: 900px) {
  .viewer-card {
    order: 2;
  }
  .copy-block {
    order: 1;
  }
}
*/

/* =========================================================
   RESPONSIVE : DESKTOP "PLEIN ÉCRAN" (>= 900px)
   ========================================================= */

@media (min-width: 900px) {
  html,
  body {
    height: 100vh;
    overflow: hidden; /* Pas de scroll sur desktop, tout tient dans la hauteur */
  }

  .main-layout {
    padding: 0 40px 16px; /* On réduit un peu le padding bas */
  }

  model-viewer {
    height: min(50vh, 420px); /* Hauteur réduite par rapport au mobile */
  }
}
