/* ============================================================
   Groupe IDRA — feuille de styles partagee
   Heritage du theme bleu nuit + cyan glow d'idra-blue.html.
   ============================================================ */

:root {
  --bg: #050810;
  --bg-2: #07101f;
  --ink: #e8eef9;
  --muted: #8a9bb4;
  --line: rgba(120, 170, 230, 0.10);
  --line-strong: rgba(120, 170, 230, 0.22);
  --accent: #5fa8ff;
  --accent-2: #7ce0ff;
  --accent-3: #2a6dd9;
  --danger: #ff6b88;
  --ok: #7cf0a8;
}

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.serif {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.mono { font-family: 'Geist Mono', monospace; }

/* --- Atmosphere / decor ---------------------------------------- */
.scene {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(95,168,255,0.18), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(42,109,217,0.20), transparent 60%),
    radial-gradient(600px 400px at 50% 50%, rgba(124,224,255,0.05), transparent 70%),
    var(--bg);
}
.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.35;
  background-image:
    linear-gradient(rgba(120,170,230,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,170,230,0.06) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
}
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
}

/* --- Composants reutilisables ---------------------------------- */
.glass {
  background: linear-gradient(180deg, rgba(15,25,45,0.55), rgba(8,15,30,0.55));
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.card {
  background: linear-gradient(180deg, rgba(14,24,42,0.6), rgba(7,14,28,0.6));
  border: 1px solid var(--line);
  border-radius: 18px;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), border-color .4s, box-shadow .4s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 30px 60px -30px rgba(95,168,255,0.25);
}

.glow-ring { position: relative; }
.glow-ring::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(124,224,255,0.55), rgba(95,168,255,0.0) 40%, rgba(95,168,255,0.0) 60%, rgba(124,224,255,0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; opacity: .9;
}

.btn-primary {
  background: linear-gradient(180deg, #6db4ff, #2a6dd9);
  color: #001026;
  box-shadow: 0 10px 30px -10px rgba(95,168,255,0.55), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform .25s, box-shadow .25s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px -12px rgba(95,168,255,0.65), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-primary:disabled {
  opacity: .55; cursor: not-allowed; transform: none;
  box-shadow: 0 6px 18px -8px rgba(95,168,255,0.3);
}

.btn-ghost {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line-strong);
  transition: background .25s, border-color .25s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: rgba(120,170,230,0.4); }

.marquee { display: flex; gap: 4rem; animation: scroll 35s linear infinite; }
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

.nav-link { position: relative; color: var(--muted); transition: color .25s; }
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0; background: var(--accent-2); transition: width .35s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.gradient-text {
  background: linear-gradient(180deg, #ffffff 0%, #c8dbf3 60%, #6fa6e6 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.hero-orb {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(124,224,255,0.35), rgba(95,168,255,0.15) 40%, transparent 70%);
  filter: blur(20px); pointer-events: none;
}

.ticker-dot { width: 6px; height: 6px; border-radius: 50%; background: #7ce0ff; box-shadow: 0 0 12px #7ce0ff; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #c8dbf3; background: rgba(95,168,255,0.06); border: 1px solid rgba(95,168,255,0.18);
}

.stat-divider { background: linear-gradient(180deg, transparent, var(--line-strong), transparent); width: 1px; }

.feature-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(124,224,255,0.10), rgba(95,168,255,0.04));
  border: 1px solid rgba(124,224,255,0.2);
  color: #c8dbf3;
}

.number { font-family: 'Geist Mono', monospace; font-feature-settings: "tnum"; letter-spacing: -0.02em; }

.beam {
  position: absolute; left: 50%; top: 60%; width: 1200px; height: 1200px; transform: translate(-50%, 0) rotate(45deg);
  background: conic-gradient(from 200deg at 50% 50%, transparent 0deg, rgba(124,224,255,0.08) 25deg, transparent 50deg);
  filter: blur(40px); pointer-events: none;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(120,170,230,0.18); border-radius: 10px; }

.cursor-blink::after { content: "▍"; margin-left: 2px; animation: blink 1.1s infinite; color: var(--accent-2); }
@keyframes blink { 50% { opacity: 0; } }

.device {
  background: linear-gradient(180deg, #0a1424, #060c18);
  border: 1px solid rgba(120,170,230,0.18);
  border-radius: 22px;
  box-shadow:
    0 60px 120px -40px rgba(95,168,255,0.25),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 6px 10px; border-radius: 8px; font-size: 11px;
  background: rgba(95,168,255,0.06); border: 1px solid rgba(95,168,255,0.15); color: #b9cdec;
}

.footer-link { color: var(--muted); transition: color .2s; }
.footer-link:hover { color: var(--ink); }

/* --- Formulaire contact ---------------------------------------- */
.form-field {
  display: flex; flex-direction: column; gap: 6px;
}
.form-field label {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-family: 'Geist Mono', monospace;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: rgba(8,15,30,0.7);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: rgba(138,155,180,0.6); }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  background: rgba(12,22,40,0.85);
  box-shadow: 0 0 0 3px rgba(124,224,255,0.12);
}
.form-field textarea { resize: vertical; min-height: 140px; }

/* --- Checkbox personnalisee : case stylee + label entier ------- */
.form-check {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(8, 15, 30, 0.7);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  transition: background .2s, border-color .2s, transform .15s;
  user-select: none;
  position: relative;
}
.form-check:hover {
  border-color: rgba(124, 224, 255, 0.45);
  background: rgba(12, 22, 40, 0.85);
}
.form-check input[type="checkbox"] {
  /* Masque le natif mais reste accessible clavier/screen reader */
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}
.form-check .form-check-box {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  background: rgba(8, 15, 30, 0.5);
  flex-shrink: 0;
  display: grid; place-items: center;
  transition: background .2s, border-color .2s, box-shadow .2s;
  position: relative;
}
.form-check .form-check-box::after {
  content: "";
  width: 10px; height: 10px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23001026' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity .2s, transform .2s;
}
.form-check input[type="checkbox"]:checked + .form-check-box {
  background: linear-gradient(140deg, #7ce0ff, #2a6dd9);
  border-color: #7ce0ff;
  box-shadow: 0 0 0 3px rgba(124, 224, 255, 0.18);
}
.form-check input[type="checkbox"]:checked + .form-check-box::after {
  opacity: 1; transform: scale(1);
}
.form-check input[type="checkbox"]:focus-visible + .form-check-box {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}
/* Label entier change d'allure quand coche (browsers modernes) */
.form-check:has(input:checked) {
  background: linear-gradient(180deg, rgba(124, 224, 255, 0.08), rgba(42, 109, 217, 0.05));
  border-color: rgba(124, 224, 255, 0.45);
}
.form-check:has(input:checked) .form-check-label {
  color: #e8eef9;
  font-weight: 500;
}

.form-status {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.form-status.show { display: block; }
.form-status.error { background: rgba(255,107,136,0.08); border: 1px solid rgba(255,107,136,0.3); color: #ffc6d1; }
.form-status.ok    { background: rgba(124,240,168,0.08); border: 1px solid rgba(124,240,168,0.3); color: #c6ffdf; }

/* --- Mobile nav (burger jusqu'a 1024px, liens desktop ensuite) -- */
@media (max-width: 1023px) {
  .nav-mobile-toggle { display: inline-flex; }
  .nav-mobile-panel {
    position: absolute; top: 70px; left: 0; right: 0;
    margin: 0 24px; padding: 14px 18px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(15,25,45,0.95), rgba(8,15,30,0.95));
    border: 1px solid var(--line);
    backdrop-filter: blur(14px);
    display: none;
  }
  .nav-mobile-panel.open { display: block; }
  .nav-mobile-panel a {
    display: block; padding: 10px 4px;
    color: var(--ink); font-size: 15px;
    border-bottom: 1px solid var(--line);
  }
  .nav-mobile-panel a:last-child { border-bottom: none; }
}
@media (min-width: 1024px) {
  .nav-mobile-toggle { display: none; }
  .nav-mobile-panel { display: none !important; }
}

/* --- Reduce motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .marquee { animation: none; }
}

/* --- Grands ecrans : 1440p / 4K --------------------------------- */
/* Tailwind .max-w-7xl = 1280px par defaut. On etire au-dela pour
   ne pas gacher l'espace sur 1440p / 1080p large / 4K.            */
@media (min-width: 1536px) {
  .max-w-7xl { max-width: 1440px !important; }
  .max-w-6xl { max-width: 1280px !important; }
  .max-w-5xl { max-width: 1100px !important; }
}
@media (min-width: 1920px) {
  .max-w-7xl { max-width: 1600px !important; }
  .max-w-6xl { max-width: 1400px !important; }
  h1.serif, h1 .serif {
    font-size: clamp(72px, 5.5vw, 120px);
    line-height: 1.02;
  }
}
@media (min-width: 2560px) {
  .max-w-7xl { max-width: 1760px !important; }
  body { font-size: 17px; }
  .hero-orb { width: 720px; height: 720px; }
}

/* --- Mobile fixes (cellulaire) --------------------------------- */
@media (max-width: 640px) {
  .hero-orb { width: 340px; height: 340px; filter: blur(30px); }
  .beam { display: none; }      /* trop lourd visuellement sur petit ecran */
  .device { padding: 6px !important; }
}
@media (max-width: 480px) {
  h1 { line-height: 1.05; }
  .pill { font-size: 10px; padding: 5px 10px; letter-spacing: 0.06em; }
  .footer-grid { gap: 24px !important; }
  /* Le device mockup en hero est purement decoratif sur mobile : masquage doux */
  .device .grid { gap: 12px !important; }
}

/* --- Image responsive par defaut ------------------------------- */
img { max-width: 100%; height: auto; }

/* --- Helper image responsive avec ratio fige ------------------- */
/* Usage:
   <picture class="img-responsive" style="aspect-ratio: 16/9">
     <source type="image/avif" srcset="x.avif">
     <source type="image/webp" srcset="x.webp">
     <img src="x.jpg" alt="..." loading="lazy" decoding="async">
   </picture>
   → Le ratio est respecte AVANT le chargement (pas de saut de mise en page),
     l'image charge en avif/webp si supporte, JPG en fallback.            */
.img-responsive {
  display: block;
  position: relative;
  width: 100%;
  overflow: hidden;
  background: rgba(8, 15, 30, 0.5);
  border-radius: 12px;
}
.img-responsive img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Skeleton shimmer pendant le chargement (effet pro) */
.img-responsive:not(:has(img.loaded))::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(
    90deg,
    rgba(120, 170, 230, 0.04) 0%,
    rgba(120, 170, 230, 0.10) 50%,
    rgba(120, 170, 230, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.img-responsive img { opacity: 0; transition: opacity .4s ease; }
.img-responsive img.loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .img-responsive img { opacity: 1; transition: none; }
  .img-responsive:not(:has(img.loaded))::before { animation: none; }
}

/* --- Liens externes : petit indicateur arrow ------------------- */
.link-ext::after {
  content: " ↗";
  font-family: 'Geist Mono', monospace;
  font-size: 0.9em;
  color: var(--accent-2);
  margin-left: 2px;
}

/* --- Iframe preview 1:1 (apercus de demos vivantes) ------------ */
/* Le sizing/scaling est pilote en JS via ResizeObserver pour rester
   parfaitement responsive et faire varier la "device width" rendue
   dans l'iframe (desktop / tablet / mobile) selon la largeur du
   conteneur. CSS = squelette uniquement.                          */
.iframe-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 16px;
  background: #050810;
  pointer-events: none;
  isolation: isolate;
}
.iframe-preview iframe {
  position: absolute;
  top: 0; left: 0;
  border: 0;
  /* width/height/transform mis a jour en JS (cf. shared.js fitIframe) */
  transform-origin: top left;
  pointer-events: none;
  background: white;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 1;
}
.iframe-preview iframe.loaded { opacity: 1; }
.iframe-preview .iframe-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.iframe-preview .iframe-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent 60%, rgba(5,8,16,0.4) 100%);
  pointer-events: none;
}

/* Variante mini pour la home (ratio different) */
.iframe-preview-mini { aspect-ratio: 16 / 11; }
