/* ============================================================================
   styles.css — Portail pilote CEPS09 (pilot.ceps09.com)
   « EFB night-mode » : le portail est l'écran d'accueil nocturne de la
   famille d'apps (elles-mêmes en day-mode, cf. briefing-deco/public/theme.css,
   mais leurs écrans de CONNEXION sont déjà sur ce dégradé nuit — continuité).
   Sobre et plat : hiérarchie par filets 1 px, lueurs discrètes réservées à
   l'interactif. Discipline couleur héritée des apps sœurs : cyan = interactif ·
   ambre = action de connexion (comme leurs portails) · vert = connecté ·
   rouge = erreur. Type : IBM Plex superfamily, valeurs en mono tabulaire.
   Signature : ligne d'horizon + échelle de tangage en fond, façon horizon
   artificiel de nuit.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans+Condensed:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* ciel nuit — mêmes teintes que les overlays de connexion des apps sœurs */
  --night-0: #070d15;
  --night-1: #0b1622;
  --night-2: #13283f;

  /* panneaux / instruments */
  --panel:        rgba(16, 28, 42, .92);
  --panel-line:   rgba(120, 160, 200, .18);
  --panel-line-2: rgba(120, 160, 200, .30);
  --inset:        #0b1622;

  /* encre */
  --ink:    #e8eef5;
  --ink-2:  #9db1c6;
  --muted:  #6c819a;

  /* accents (vocabulaire des apps sœurs) */
  --cyan:      #3fb6d6;
  --cyan-soft: rgba(63, 182, 214, .35);
  --amber:     #e8a020;
  --amber-2:   #d18e16;
  --amber-ink: #1a1206;
  --ok:        #86e0a8;
  --err:       #ff9a8b;
}

* { box-sizing: border-box; }

/* Les display: des classes (flex/grid) écraseraient l'attribut hidden —
   même correctif que les apps sœurs. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--night-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ---- Ciel : dégradé nuit + horizon artificiel --------------------------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 120% at 50% 0%, var(--night-2) 0%, var(--night-1) 55%, var(--night-0) 100%);
}

/* échelle de tangage : barreaux courts, fondus autour du centre de l'écran */
.sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(120, 160, 200, .10) 0 1px, transparent 1px 96px);
  -webkit-mask-image: radial-gradient(24% 52% at 50% 44%, #000 0%, transparent 100%);
  mask-image: radial-gradient(24% 52% at 50% 44%, #000 0%, transparent 100%);
}

/* ligne d'horizon */
.sky::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 44%;
  height: 1px;
  background: linear-gradient(90deg, transparent 12%, rgba(63, 182, 214, .22) 38% 62%, transparent 88%);
  box-shadow: 0 0 18px rgba(63, 182, 214, .16);
}

/* ---- Barre haute ---------------------------------------------------------- */

.topbar {
  background: rgba(7, 13, 21, .72);
  border-bottom: 1px solid var(--panel-line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar-inner,
.footbar-inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.brand-club {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.brand-sep {
  align-self: center;
  width: 1px;
  height: 1.1rem;
  background: var(--panel-line-2);
}

.brand-title {
  margin: 0;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.clocks {
  display: flex;
  gap: 1.4rem;
}

.clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
}

.clock-label {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.clock-value {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.clock-z {
  color: var(--muted);
  font-size: 0.85em;
  margin-left: 0.1em;
}

/* chip utilisateur (visible une fois connecté) */

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.user-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(134, 224, 168, .7);
}

.user-chip-email {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-logout {
  background: none;
  border: none;
  padding: 0;
  color: var(--err);
  font: 600 0.78rem var(--font-sans);
  cursor: pointer;
}

.user-chip-logout:hover { text-decoration: underline; }

/* ---- Contenu / états ------------------------------------------------------ */

.content {
  flex: 1;
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
}

.center-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.annunciator {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.annunciator.error { color: var(--err); }

/* ---- Panneau de connexion -------------------------------------------------- */

.panel {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 30px 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

@media (prefers-reduced-motion: no-preference) {
  .login-panel {
    animation: panel-rise 320ms ease-out;
  }
  @keyframes panel-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }
}

.panel-brand {
  margin: 0 0 4px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-cond);
}

.panel-title {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-sub {
  margin: 0 0 18px;
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.45;
}

.panel label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  margin: 12px 0 5px;
  font-weight: 600;
  font-family: var(--font-cond);
}

.panel input {
  width: 100%;
  padding: 11px 13px;
  background: var(--inset);
  border: 1px solid var(--panel-line-2);
  border-radius: 9px;
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms;
}

.panel input:focus { border-color: var(--cyan); }

.btn {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  transition: filter 150ms, opacity 150ms;
}

.btn:disabled { opacity: 0.6; cursor: default; }

.btn.primary {
  background: linear-gradient(180deg, var(--amber), var(--amber-2));
  color: var(--amber-ink);
}

.btn.primary:hover:not(:disabled) { filter: brightness(1.07); }

.btn.google {
  background: #fff;
  color: #1f2937;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 10px;
}

.btn.google:hover:not(:disabled) { filter: brightness(.96); }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--panel-line-2);
  color: var(--ink-2);
}

.btn.ghost:hover:not(:disabled) { border-color: var(--cyan); color: var(--ink); }

.or-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 2px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.or-rule::before,
.or-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--panel-line);
}

.text-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--cyan);
  font-size: 0.82rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.text-link:hover { text-decoration: underline; }

.form-msg {
  margin: 14px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  display: none;
}

.form-msg.error { display: block; color: var(--err); }
.form-msg.ok { display: block; color: var(--ok); }

.mono-callout {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  color: var(--ink);
  word-break: break-all;
}

.panel-foot {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--panel-line);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

/* ---- Grille d'applications -------------------------------------------------- */

.pages-eyebrow {
  margin: 0 0 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--panel-line);
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-2);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
  gap: 0.9rem;
}

.card {
  display: flex;
  align-items: stretch;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan-soft), 0 10px 32px rgba(0, 0, 0, .35);
}

.card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.softkey {
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 2.4rem;
  background: var(--inset);
  border: 1px solid var(--panel-line-2);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--cyan);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.card:hover .softkey {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(63, 182, 214, .25) inset;
}

.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.card-title {
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--ink-2);
}

.card-host {
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.card-arrow {
  align-self: center;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--panel-line-2);
  transition: color 120ms ease;
}

.card:hover .card-arrow { color: var(--cyan); }

/* ---- Barre basse ------------------------------------------------------------ */

.footbar {
  border-top: 1px solid var(--panel-line);
  font-size: 0.78rem;
  color: var(--muted);
}

.footbar-inner { padding: 0.7rem 1.25rem; }

.footer-host { font-family: var(--font-mono); }

/* ---- Mobile / préférences ----------------------------------------------------- */

@media (max-width: 560px) {
  .topbar-right {
    width: 100%;
    justify-content: space-between;
    padding-top: 0.55rem;
    border-top: 1px solid var(--panel-line);
    gap: 0.8rem;
  }
  .clocks { gap: 1rem; }
  .clock:first-child { align-items: flex-start; }
  .clock-value { font-size: 0.95rem; }
  .content { padding-top: 1.4rem; }
  .user-chip-email { max-width: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .softkey, .card-arrow, .btn, .panel input { transition: none; }
}
