/* ============================================================================
   apps.docs-entreprise.com - portail interne des applications du groupe.
   ----------------------------------------------------------------------------
   Charte (DA) - une seule construction, déclinée par teinte :
     Fond       blanc cassé chaud, halo vert de marque très dilué en haut.
     Surface    blanc pur, rayon 18, ombre douce en deux couches, sans bordure.
     Teintes    une par application, toutes à la même saturation / luminosité :
                tuile = teinte diluée (--teinte-douce), glyphe = teinte pleine
                (--teinte) ; les deux sont posées par apps.js, inversion au survol.
     Typo       système, titres 600 à interlettrage resserré, corps 0,88 rem.
     Mouvement  aucun déplacement : seules l'ombre et la tuile réagissent.
   Autonome : aucune dépendance externe (polices système, pas de CDN).
   ========================================================================== */

:root {
  /* Fond et surfaces */
  --bg:            #f5f6f3;
  --bg-halo:       rgba(112, 162, 91, .10);   /* vert de marque très dilué */
  --surface:       #ffffff;
  --surface-muted: #eef0ec;

  /* Texte */
  --text:   #1a1d19;
  --muted:  #5c635a;
  --faint:  #8b928a;

  /* Marque */
  --accent: #4d7a3a;   /* vert L'As de Trèfle assombri pour la lisibilité */
  --line:   rgba(26, 29, 25, .08);

  /* Rayons */
  --radius:      18px;
  --radius-tile: 14px;

  /* Ombres */
  --shadow:       0 1px 2px rgba(26, 29, 25, .04), 0 4px 14px rgba(26, 29, 25, .05);
  --shadow-hover: 0 2px 4px rgba(26, 29, 25, .05), 0 12px 30px rgba(26, 29, 25, .09);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 50% -10%, var(--bg-halo), transparent 62%);
  background-repeat: no-repeat;
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* La page occupe la hauteur de l'écran et le bloc entier (logo + grille) se cale
   en son centre : le logo reste ainsi juste au-dessus des cartes. */
.page {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  gap: 56px;
  padding: 48px 0;
}
.wrap { width: min(1060px, 100% - 48px); margin-inline: auto; }

/* ── En-tête ─────────────────────────────────────────────── */
.site-header {
  display: flex; flex-direction: column; align-items: center;
  gap: 22px; padding: 0 24px;
}
.brand-logo { height: 60px; width: auto; display: block; }

/* ---------- Sélecteur de société ----------
   Sobre : le portail est le même pour les trois, seule change l'enseigne dont
   on ouvre les applications. Un contrôle segmenté, sans couleur tant qu'il
   n'est pas choisi - il ne doit pas rivaliser avec les cartes. */
.scope {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-muted);
  border-radius: 999px;
}
.scope-opt {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 15px;
  border-radius: 999px;
  font: inherit;
  font-size: .82rem;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
}
.scope-opt:hover { color: var(--text); }
.scope-opt.is-on {
  background: var(--surface);
  color: var(--accent);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(26, 29, 25, .06);
}
.scope-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 560px) {
  .scope { flex-direction: column; width: min(320px, 100%); border-radius: 14px; }
  .scope-opt { border-radius: 11px; text-align: center; }
}

/* ── Grille d'applications ───────────────────────────────── */
main { display: flex; align-items: center; }
.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Carte ───────────────────────────────────────────────── */
.app-card {
  --teinte: var(--accent);            /* posées par apps.js, par application */
  --teinte-douce: var(--surface-muted);
  display: flex; flex-direction: column; gap: 18px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-decoration: none; color: inherit;
  transition: box-shadow .2s ease;
}
.app-card[href]:hover { box-shadow: var(--shadow-hover); }
.app-card.is-soon { background: var(--surface-muted); box-shadow: none; }

/* Icône monochrome sur tuile arrondie ; inversion au survol. */
.app-head { display: flex; align-items: center; gap: 14px; }
.app-tile {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-tile);
  background: var(--teinte-douce);
  color: var(--teinte);
  transition: background .2s ease, color .2s ease;
}
.app-tile svg { width: 23px; height: 23px; display: block; }
.app-card[href]:hover .app-tile { background: var(--teinte); color: #fff; }
.app-card.is-soon .app-tile { background: rgba(26, 29, 25, .05); color: var(--faint); }

.app-head h2 { font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; }
.app-card.is-soon .app-head h2 { color: var(--muted); }

.app-desc { font-size: .88rem; color: var(--muted); }

/* Pied : domaine à gauche, flèche ronde à droite. */
.app-foot {
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.app-url { font-size: .8rem; color: var(--faint); letter-spacing: .01em; }
.app-arrow {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--teinte-douce);
  color: var(--teinte);
  transition: background .2s ease, color .2s ease;
}
.app-arrow svg { width: 15px; height: 15px; display: block; }
.app-card[href]:hover .app-arrow { background: var(--teinte); color: #fff; }
.app-soon-tag {
  font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--faint);
}

/* ── Écrans étroits ──────────────────────────────────────── */
@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .page { justify-content: flex-start; gap: 36px; padding: 32px 0 40px; }
  .brand-logo { height: 46px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .app-card { padding: 20px; gap: 14px; }
}

/* ── Connexion ───────────────────────────────────────────────
   Le portail reste ouvert : ce bouton n'ouvre que le tableau de bord. Il se
   tient à droite du sélecteur, en retrait - même hauteur, même rayon, mais
   sans fond tant qu'on ne le survole pas : il ne doit pas se lire comme une
   quatrième société. */
.header-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }

.btn-compte {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 15px;
  border-radius: 999px;
  font: inherit; font-size: .82rem; font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: color .16s, box-shadow .16s, border-color .16s;
}
.btn-compte:hover { color: var(--text); box-shadow: var(--shadow); }
.btn-compte:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-compte svg { width: 15px; height: 15px; display: block; }
.btn-compte.is-on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ── Boîte de connexion ──────────────────────────────────── */
.voile {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(26, 29, 25, .34);
  display: grid; place-items: center;
  padding: 24px;
}
.voile[hidden] { display: none; }
.boite {
  width: min(380px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(26, 29, 25, .22);
  padding: 26px;
  display: flex; flex-direction: column; gap: 16px;
}
.boite h2 { font-size: 1.05rem; font-weight: 620; letter-spacing: -.01em; }
.boite p.aide { font-size: .84rem; color: var(--muted); margin-top: -8px; }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.champ input {
  font: inherit; font-size: .9rem;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text);
}
.champ input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.boite .erreur {
  font-size: .82rem; color: #a8371f;
  background: #fdf0ec; border-radius: 10px; padding: 9px 11px;
}
.boite .erreur[hidden] { display: none; }
.boite-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 2px; }
.btn {
  appearance: none; border: 0; font: inherit; font-size: .85rem; font-weight: 600;
  padding: 10px 18px; border-radius: 11px; cursor: pointer;
  transition: filter .16s, background .16s;
}
.btn-plein { background: var(--accent); color: #fff; }
.btn-plein:hover { filter: brightness(1.08); }
.btn-plein[disabled] { opacity: .6; cursor: progress; }
.btn-nu { background: transparent; color: var(--muted); }
.btn-nu:hover { background: var(--surface-muted); color: var(--text); }
