/* Pages du SSO : connexion, espace applications, accès refusé.

   Toujours claires, quel que soit le thème du système — comme Microsoft ou
   Google. La page où l'on tape son mot de passe doit être reconnaissable
   au premier coup d'œil, partout et pour tout le monde ; c'est un repère de
   confiance, pas une préférence d'affichage. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e3e7ef;
  --border-strong: #cdd3df;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8a94a6;
  --primary: #1f5eff;
  --primary-hover: #1a50db;
  --primary-soft: #edf2ff;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --shadow: 0 2px 6px rgba(15, 23, 42, .04), 0 12px 40px rgba(15, 23, 42, .08);
  --font: InterVariable, Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body {
  background-color: #eef2f9;
  background-image:
    radial-gradient(900px 700px at 8% 12%, rgba(31, 94, 255, .10), transparent 60%),
    radial-gradient(700px 600px at 92% 88%, rgba(139, 92, 246, .10), transparent 60%),
    radial-gradient(600px 500px at 80% 10%, rgba(14, 165, 233, .08), transparent 60%),
    linear-gradient(160deg, #f7f9fd 0%, #eaeff8 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.wordmark { height: 18px; display: block; }
.wordmark--dark { display: none; }

/* ── Carte centrée : connexion, accès refusé ─────────────────────────── */
.center { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.card {
  width: 100%; max-width: 440px; padding: 44px 44px 40px;
  background: #fff; border-radius: 4px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .12), 0 12px 32px rgba(15, 23, 42, .06);
}
.card__brand { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.card__brand img.logo { width: 24px; height: 24px; }
.card__brand .wordmark { height: 15px; }
.card h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; line-height: 1.3; color: #1b1b1b; }
.card .sub { margin: 0 0 22px; font-size: 15px; color: #444; }
.card .sub strong { color: #1b1b1b; font-weight: 600; }

.field { display: block; margin-bottom: 20px; }
/* L'intitulé reste pour les lecteurs d'écran ; à l'œil, le texte d'exemple suffit. */
.field span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.field input {
  width: 100%; height: 36px; padding: 6px 0; border: none; border-bottom: 1px solid #666;
  border-radius: 0; background: transparent; color: #1b1b1b; font: 15px var(--font); outline: none;
  transition: border-color .15s;
}
.field input::placeholder { color: #6b6b6b; }
.field input:focus { border-bottom: 2px solid var(--primary); padding-bottom: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 108px; height: 36px; padding: 0 16px; border-radius: 2px; border: 1px solid transparent;
  font: 600 15px var(--font); cursor: pointer; text-decoration: none !important;
  transition: background .15s, border-color .15s;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--primary:focus-visible { outline: 2px solid #1b1b1b; outline-offset: 2px; }
.btn--ghost { background: #e6e6e6; color: #1b1b1b; }
.btn--ghost:hover { background: #d4d4d4; }
.btn--block { width: 100%; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 28px; }

.links { margin: 0 0 12px; font-size: 13px; color: #1b1b1b; }
.links a { color: var(--primary); }

/* Seconde carte, sous la connexion : les autres façons de se connecter. */
.card--options { margin-top: 28px; padding: 8px 0 12px; }
.option { display: flex; align-items: center; gap: 16px; padding: 12px 44px; color: #1b1b1b !important;
  font-size: 15px; text-decoration: none !important; }
.option svg { flex-shrink: 0; }
a.option:hover { background: #f2f2f2; }
.option--title { padding-top: 14px; }
.option__group { margin: 4px 0 4px; padding: 0 44px; font-size: 13px; color: #616161; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 0; margin: -8px 0 16px; font-size: 14px; }
.alert--error { color: #e81123; }
.alert--info { color: #444; }

/* Connexion en deux temps, comme chez Microsoft : l'adresse, puis le mot
   de passe. Sans JavaScript, les deux champs restent simplement visibles. */
.js .step--password { display: none; }
.js.is-password .step--email { display: none; }
.js.is-password .step--password { display: block; }
/* Comme chez Microsoft, les autres options disparaissent au mot de passe. */
.js.is-password .card--options { display: none; }
.identity {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  margin: 0 0 14px; padding: 2px 6px 2px 0; border: none; border-radius: 2px;
  background: transparent; color: #1b1b1b; font: 15px var(--font); cursor: pointer;
}
.identity:hover { background: #f2f2f2; }
.identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* La suite d'applications, sous les cartes. */
.suite { display: flex; justify-content: center; gap: 22px; margin: 32px 0 0; padding: 0; list-style: none; }
.suite__item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: #444; }
.suite__item img { width: 40px; height: 40px; transition: transform .15s; }
.suite__item:hover img { transform: translateY(-2px); }
.suite__item--soon img { filter: grayscale(1); opacity: .5; }
.suite__item--soon span { color: #8a8a8a; }
.foot { margin-top: 18px; font-size: 12px; color: #616161; text-align: center; }

/* ── Espace applications ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 28px; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar__brand { display: flex; align-items: center; gap: 12px; }

/* ── Lanceur d'applications (neuf points) ───────────────────────────── */
.launcher { position: relative; margin-right: 4px; }
.launcher__btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%; background: transparent; color: #5f6368; cursor: pointer;
}
.launcher__btn:hover, .launcher__btn[aria-expanded="true"] { background: rgba(60, 64, 67, .08); }
.launcher__panel {
  position: absolute; left: 0; top: 48px; z-index: 10; width: 340px; padding: 18px 14px 14px;
  background: #f8fafd; border-radius: 24px;
  box-shadow: 0 4px 8px 3px rgba(60, 64, 67, .15), 0 1px 3px rgba(60, 64, 67, .3);
}
.launcher__title { margin: 0 8px 12px; font-size: 16px; font-weight: 500; color: #1f1f1f; }
.launcher__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 8px; background: #fff; border-radius: 18px;
}
.launcher__app {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px 12px;
  border-radius: 14px; color: #1f1f1f !important; text-decoration: none !important; font-size: 13px; text-align: center;
}
.launcher__app:hover { background: #eef2fb; }
.launcher__app img { width: 44px; height: 44px; }
.launcher__app span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.launcher__empty { margin: 8px; font-size: 13px; color: #5f6368; }
.topbar__brand img.logo { width: 28px; height: 28px; }
.topbar__sep { width: 1px; height: 20px; background: var(--border-strong); }
.topbar__title { font-weight: 600; color: var(--text-2); }
.me { position: relative; }
.me summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px; border-radius: 24px; }
.me summary::-webkit-details-marker { display: none; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.me__menu {
  position: absolute; right: 0; top: 50px; width: 280px; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
}
.me__who { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; min-width: 0; }
.me__who div { min-width: 0; }
.me__name { font-weight: 600; }
.me__email, .me__tenant { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page { max-width: 1040px; margin: 0 auto; padding: 48px 28px 64px; }
.page h1 { margin: 0 0 6px; font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.page .lead { margin: 0 0 36px; color: var(--text-2); }
.section-title { margin: 0 0 16px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.app {
  display: flex; flex-direction: column; gap: 14px; padding: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; color: var(--text);
  text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.app:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.app:focus-visible { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
.app-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; }
.app-icon svg { width: 26px; height: 26px; }
.app-icon--mail     { background: linear-gradient(135deg, #1f5eff, #4f8bff); }
.app-icon--drive    { background: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.app-icon--calendar { background: linear-gradient(135deg, #f97316, #fb923c); }
.app-icon--contacts { background: linear-gradient(135deg, #10b981, #34d399); }
.app-icon--admin    { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.app-icon--img      { background: none; }
.app-icon--img img  { width: 48px; height: 48px; }
.app-icon--monitoring { background: linear-gradient(135deg, #e11d48, #fb7185); }
.app-icon--app      { background: linear-gradient(135deg, #475569, #94a3b8); }
.app__name { font-weight: 600; font-size: 16px; }
.app__desc { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.empty { padding: 48px 24px; text-align: center; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 14px; }

@media (max-width: 600px) {
  /* Sur téléphone, la carte devient la page, comme chez Microsoft. */
  .center { justify-content: flex-start; padding: 0; }
  .card { max-width: none; min-height: 100vh; min-height: 100dvh; padding: 28px 24px; border-radius: 0; box-shadow: none; }
  .foot { display: none; }
  .suite { gap: 14px; margin: 24px 0 32px; }
  .suite__item img { width: 34px; height: 34px; }
  .card--options { min-height: 0; margin-top: 0; border-top: 1px solid #e6e6e6; }
  .option, .option__group { padding-left: 24px; padding-right: 24px; }
  .topbar { padding: 0 16px; }
  .topbar__sep, .topbar__title { display: none; }
  .page { padding: 32px 16px 48px; }
  .page h1 { font-size: 24px; }
  .apps { grid-template-columns: 1fr 1fr; gap: 12px; }
  .app { padding: 16px; }
  .app__desc { display: none; }
}
