/* =============================================================
   UrgencIA — page d'accueil urgenc-ia.fr
   Deux cadres « verre » sur une photo de bureau ; thème jour/nuit
   piloté par l'attribut data-theme (accueil.js, position du soleil).
   ============================================================= */

:root {
  /* Palette UrgencIA (tokens « ocean » de la landing et de l'app) — PF 03/10 */
  --navy: #0d3b4c;            /* ocean-dark : « Urgenc », traits de la marque, titres */
  --accent: #0284c7;          /* ocean : « IA », chevrons */
  --ink: #0d3b4c;             /* accroche */
  --ink-soft: #475569;        /* mentions discrètes */
  --title: #0d3b4c;
  --sub: #475569;
  --about: #0d3b4c;
  --link: #0369a1;            /* ocean-mid : lien contacts */
  --link-line: rgba(3, 105, 161, .45);
  --glass: rgba(255, 255, 255, .50);
  --glass-border: rgba(255, 255, 255, .80);
  --glass-shadow: 0 24px 60px rgba(20, 40, 90, .16);
  --row: rgba(255, 255, 255, .86);
  --row-border: rgba(255, 255, 255, .95);
  --row-ink: #0d3b4c;
  --tile: #ffffff;
  /* Boutons « Accéder à » : palette UrgencIA (ocean profond → teal), comme
     les boutons de la page de présentation (choix PF 03/10) */
  --btn-a: #0369a1;   /* ocean-mid */
  --btn-b: #3d8b80;   /* teal */
  --btn-shadow: 0 10px 26px rgba(3, 105, 161, .35);
  --bg-fallback: #dfe8f3;
  --font: 'Lato', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif; /* choix PF 03/10 */
}

html[data-theme="night"] {
  --navy: #ffffff;            /* le blanc de nuit est validé par PF */
  --accent: #7dd3fc;          /* ocean clair (même teinte que « IA » dans l'Espace équipe) */
  --ink: #ffffff;
  --ink-soft: #b9c6e0;
  --title: #ffffff;
  --sub: #c9d4ea;
  --about: #ffffff;
  --link: #7dd3fc;
  --link-line: rgba(125, 211, 252, .5);
  --glass: rgba(18, 30, 62, .46);
  --glass-border: rgba(255, 255, 255, .26);
  --glass-shadow: 0 24px 60px rgba(0, 0, 0, .38);
  --row: rgba(255, 255, 255, .90);
  --row-border: rgba(255, 255, 255, .95);
  --bg-fallback: #0f1b3a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-fallback);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 1.8s ease-in-out;
}
/* Passage progressif d'un mode à l'autre : tout ce qui change de couleur fond */
.wordmark, .wordmark em, .logo::before, .tagline, .about, .theme-btn,
.card h2, .card .sub, .legal, .contact {
  transition: color 1.2s ease-in-out, background-color 1.2s ease-in-out, border-color 1.2s ease-in-out;
}
a { color: inherit; text-decoration: none; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

/* ─── Fonds ─────────────────────────────────────────────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-layer {
  position: absolute; inset: 0;
  background-position: center; background-size: cover;
  transition: opacity 1.8s ease-in-out;
}
.bg-layer img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bg-day   { background-image: url('/img/accueil/fond_jour_lqip.jpg'); }
.bg-night { background-image: url('/img/accueil/fond_nuit_lqip.jpg'); opacity: 0; }
html[data-theme="night"] .bg-night { opacity: 1; }

/* ─── Interrupteur : la lampe de la photo ───────────────── */
.lamp {
  position: fixed; z-index: 1;
  border: 0; padding: 0; background: transparent; cursor: pointer;
  border-radius: 45% 45% 30% 30% / 35% 35% 20% 20%;
  -webkit-tap-highlight-color: transparent;
}
.lamp::before {
  content: ''; position: absolute; left: -12%; right: -12%; top: -8%; height: 62%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 130, .55), rgba(255, 214, 130, 0));
  opacity: 0; transition: opacity .45s ease;
  pointer-events: none;
}
.lamp:hover::before, .lamp:focus-visible::before { opacity: 1; }
.lamp:focus-visible { outline-offset: -3px; }
/* Seuls les éléments cliquables passent au-dessus de la zone lampe : un
   conteneur pleine largeur (main, header) la masquerait entièrement. */
.top > *, .cards, .bottom > * { position: relative; z-index: 2; }

/* ─── Barre haute ───────────────────────────────────────── */
.top {
  display: flex; align-items: center; justify-content: flex-end; gap: 22px;
  padding: 22px 36px 0;
}
.about { font-size: 16px; font-weight: 500; color: var(--about); padding: 8px 2px; }
.about:hover { text-decoration: underline; text-underline-offset: 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px; border-radius: 999px;
  background: linear-gradient(135deg, var(--btn-a) 0%, var(--btn-b) 100%);
  color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap;
  box-shadow: var(--btn-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.pill svg { width: 18px; height: 18px; }
.pill:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(3, 105, 161, .42); }

.theme-btn {
  display: none; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--about); font: inherit; font-size: 13.5px; font-weight: 600;
  margin-right: auto;
}
.theme-btn svg { width: 16px; height: 16px; }
.theme-btn .ico-moon { display: none; }
html[data-theme="night"] .theme-btn .ico-sun { display: none; }
html[data-theme="night"] .theme-btn .ico-moon { display: block; }

/* ─── Marque ────────────────────────────────────────────── */
main {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 30px; padding: 12px 24px 20px;
}
.brand { text-align: center; }
/* Lockup : « UrgencIA » + marque officielle. Tout est en em de .logo :
   la marque fait 2em de haut (largeur 2em × 1048/608 = 3.447em), sa ligne
   ECG passe à 0.661 × 2em = 1.322em du haut et démarre à 25/1048 de sa
   largeur (0.082em) de son bord gauche. Le soulignement est donc tracé
   depuis .logo lui-même (pas depuis le mot : les métriques de police ne
   jouent pas) : centre à 1.322em, fin à 3.447em − 0.082em = 3.365em du
   bord droit. Le mot est simplement posé .2em sous le haut. */
.logo { position: relative; display: inline-flex; align-items: flex-start; font-size: clamp(44px, 6.2vw, 68px); }
.logo::before {
  content: ''; position: absolute; left: .04em; right: 3.365em; top: 1.307em; height: .03em;
  background: var(--navy); border-radius: 1px;
}
.wordmark {
  position: relative; display: inline-block; margin-top: .2em;
  font-size: 1em; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--navy);
}
.wordmark em { font-style: italic; color: var(--accent); }
.mark {
  position: relative; flex: none; height: 2em; aspect-ratio: 1048 / 608; margin-left: -.14em;
  background: url('/img/accueil/logo-anneau.png') center / contain no-repeat;
}
.mark::after {
  content: ''; position: absolute; inset: 0; background: var(--navy);
  -webkit-mask: url('/img/accueil/logo-traits.png') center / contain no-repeat;
          mask: url('/img/accueil/logo-traits.png') center / contain no-repeat;
  transition: background-color 1.2s ease-in-out;
}
.tagline {
  margin-top: 4px;
  font-size: clamp(17px, 2vw, 24px); font-weight: 500; color: var(--ink);
  letter-spacing: -.1px;
}

/* ─── Cadres « verre » ──────────────────────────────────── */
.cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 470px));
  gap: 30px; width: 100%; max-width: 980px; justify-content: center;
}
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 28px 30px 30px;
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
          backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: var(--glass-shadow);
  display: flex; flex-direction: column;
  transition: background-color 1.2s ease-in-out, border-color 1.2s ease-in-out, box-shadow 1.2s ease-in-out;
}
.card-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.tile {
  flex: none; width: 66px; height: 66px; border-radius: 16px;
  background: var(--tile); color: var(--row-ink);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(20, 40, 90, .10);
}
.tile svg { width: 36px; height: 36px; }
.card h2 {
  font-size: clamp(24px, 2.5vw, 30px); font-weight: 800; line-height: 1.1;
  letter-spacing: -.5px; color: var(--title);
}
.card .sub { margin-top: 4px; font-size: 15px; color: var(--sub); }

.rows { display: grid; gap: 10px; margin-bottom: 22px; }
/* Enveloppe repliable (n'agit que sur smartphone, cf. media query) */
.rows-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s ease; }
.rows-wrap > .rows { min-height: 0; overflow: hidden; }
/* Cartouche résumé : masqué sur grand écran */
.rows-summary {
  display: none; width: 100%; align-items: center; gap: 12px; text-align: left;
  min-height: 50px; padding: 0 14px 0 16px; margin-bottom: 12px; border-radius: 12px;
  background: var(--row); border: 1px solid var(--row-border);
  color: var(--row-ink); font: inherit; font-size: 16px; font-weight: 500; cursor: pointer;
}
.rows-summary span { flex: 1; }
.rows-summary .chev-down { width: 20px; height: 20px; flex: none; color: #0284c7; transition: transform .3s ease; }
.card.open .rows-summary .chev-down { transform: rotate(180deg); }
.row {
  display: flex; align-items: center; gap: 16px;
  min-height: 54px; padding: 0 16px 0 16px; border-radius: 12px;
  background: var(--row); border: 1px solid var(--row-border);
  color: var(--row-ink); font-size: 17px; font-weight: 500;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.row .ic { width: 26px; height: 26px; flex: none; color: var(--row-ink); }
.row .chev { width: 18px; height: 18px; margin-left: auto; flex: none; color: #0284c7; }
.row:hover { background: #fff; transform: translateX(3px); box-shadow: 0 6px 18px rgba(20, 40, 90, .14); }
/* Lignes informatives (bloc Découvrir) : même habillage, sans navigation */
.rows-static { list-style: none; }
.row-static { cursor: default; }
.row-static:hover { background: var(--row); transform: none; box-shadow: none; }

.cta {
  position: relative; margin-top: auto;
  display: flex; align-items: center; justify-content: center;
  min-height: 58px; padding: 0 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--btn-a) 0%, var(--btn-b) 100%);
  color: #fff; font-size: 19px; font-weight: 600; text-align: center;
  box-shadow: var(--btn-shadow);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.cta .chev { position: absolute; right: 22px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); }
.cta:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 30px rgba(3, 105, 161, .42); }

/* ─── Pied ──────────────────────────────────────────────── */
.bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 36px 24px;
}
.legal {
  font-size: 12.5px; color: rgba(255, 255, 255, .9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);   /* le plateau est sombre dans les deux modes */
}
.legal a:hover { text-decoration: underline; }
.contact {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 17px; font-weight: 600; color: var(--link);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--link-line);
}
.contact svg { width: 18px; height: 18px; }
.contact:hover { text-decoration-color: currentColor; }

/* ─── Réactivité ────────────────────────────────────────── */
@media (max-width: 980px) {
  .cards { grid-template-columns: minmax(0, 470px); }
  /* La lampe sort du cadre ou passe sous les cartes : bouton de secours */
  .lamp { display: none; }
  .theme-btn { display: inline-flex; }
}
@media (max-width: 720px) {
  .top { padding: 12px 16px 0; gap: 12px; }
  .about { display: none; }
  .pill { padding: 10px 14px; font-size: 14px; }
  .theme-btn span { display: none; }
  main { gap: 16px; padding: 10px 16px 16px; }
  .tagline { font-size: 16px; margin-top: 2px; }
  .cards { gap: 14px; }
  .card { padding: 18px 18px 18px; border-radius: 20px; }
  .card-head { gap: 14px; margin-bottom: 14px; }
  .tile { width: 54px; height: 54px; border-radius: 14px; }
  .tile svg { width: 28px; height: 28px; }
  .card h2 { font-size: 23px; }
  .card .sub { font-size: 14px; }
  /* Listes repliées derrière le cartouche résumé : les deux blocs tiennent à l'écran */
  .rows-summary { display: flex; }
  .rows-wrap { grid-template-rows: 0fr; }
  .card.open .rows-wrap { grid-template-rows: 1fr; }
  .rows { margin-bottom: 0; }
  .rows-wrap { margin-bottom: 0; transition: grid-template-rows .35s ease, margin-bottom .35s ease; }
  .card.open .rows-wrap { margin-bottom: 14px; }
  .row { font-size: 16px; min-height: 50px; }
  .cta { font-size: 17px; min-height: 52px; }
  .bottom { flex-direction: column-reverse; align-items: center; padding: 6px 16px 20px; }
}
@media (max-width: 560px) {
  .logo { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-layer, .card, body, .row, .cta, .pill, .lamp::before, .rows-wrap, .rows-summary .chev-down,
  .wordmark, .wordmark em, .logo::before, .tagline, .about, .theme-btn,
  .card h2, .card .sub, .legal, .contact { transition: none; }
}
