/* ---------------------------------------------------------------------------
   Feuille de style des pages d'entree — Le Pavillon.

   La palette est celle de l'interface, a l'identique : le client passe de
   cette page a la sienne sans rupture visuelle. Elle est SOMBRE en toutes
   circonstances, y compris si le telephone est en theme clair — l'interface
   l'est, et une page de connexion claire suivie d'une interface sombre donne
   un eblouissement desagreable la nuit, precisement quand on consulte une
   camera.
   --------------------------------------------------------------------------- */

:root {
  --bg: #0b0f16;
  --surface: #131a24;
  --surface-2: #1a2330;
  --border: #2a3547;
  --border-soft: #212c3b;
  --ink: #f2efe6;
  --ink-soft: #9aa7b8;
  --ink-faint: #5e6c80;
  --gold-1: #e6d1a1;
  --gold-2: #c9a968;
  --gold-ink: #241a08;

  /* Noms historiques, conserves pour ne pas reecrire toutes les regles. */
  --text: var(--ink);
  --muted: var(--ink-soft);
  --accent: var(--gold-2);
  --accent-text: var(--gold-ink);
  --danger: #e3766a;
  --ok: #63b57b;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .6);
  /* Indique au navigateur de dessiner ses propres controles en sombre :
     champs de saisie, barres de defilement, menus natifs. */
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Panneaux muraux en acces guide : pas de rebond, pas de flash au toucher. */
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

main { width: 100%; max-width: 520px; margin: auto 0; }
main.wide { max-width: 860px; }

/* ---------------------------------------------------------------------------
   La marque
   --------------------------------------------------------------------------- */

/* Le selecteur de langue occupe sa propre ligne, au-dessus de la marque :
   sur un telephone, le mettre a cote du sur-titre le coupe en deux. */
.brand {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px 14px;
  margin-bottom: 26px;
}
.brand .logo-mark { width: 46px; height: 46px; flex: none; }
.brand-text { min-width: 0; }
.brand .lang-toggle { grid-column: 1 / -1; justify-self: end; }

.eyebrow {
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-2);
  font-weight: 600;
  margin: 0 0 5px;
}

.brand-name {
  font-family: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-weight: 600;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(100deg, var(--ink) 0%, var(--gold-2) 60%, var(--gold-1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lang-toggle {
  display: flex;
  gap: 4px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface);
}
.lang-toggle button {
  width: auto;
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: 700 12.5px/1 inherit;
  cursor: pointer;
}
.lang-toggle button.active { background: var(--gold-2); color: var(--gold-ink); }

/* ---------------------------------------------------------------------------
   Contenu
   --------------------------------------------------------------------------- */

h1 { font-size: 1.5rem; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 28px 0 10px; }
p.lede { color: var(--muted); margin: 0 0 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

label { display: block; font-size: 0.86rem; font-weight: 600; margin: 16px 0 6px; }
label:first-of-type { margin-top: 0; }

input {
  width: 100%;
  padding: 13px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
input::placeholder { color: var(--ink-faint); }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; }

button {
  width: 100%;
  margin-top: 20px;
  padding: 14px 16px;
  font: 600 1rem inherit;
  font-family: inherit;
  color: var(--accent-text);
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: progress; }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  margin-top: 10px;
}
button.small { width: auto; margin: 0; padding: 8px 14px; font-size: 0.85rem; }
button.danger { background: var(--danger); color: #1a0f0d; }

/* Sur fond sombre, un aplat de couleur vive fatigue : on garde une teinte
   discrete et c'est le texte qui porte la couleur. */
.msg { margin-top: 18px; padding: 12px 14px; border-radius: 10px; font-size: 0.92rem; }
.msg.error { background: rgba(227, 118, 106, .16); color: var(--danger); }
.msg.ok { background: rgba(99, 181, 123, .16); color: var(--ok); }
.msg.info { background: var(--surface-2); color: var(--muted); }
.msg[hidden] { display: none; }

.device {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--surface);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.device .grow { flex: 1 1 220px; min-width: 0; }
.device .name { font-weight: 600; }
.device .meta { font-size: 0.82rem; color: var(--muted); margin-top: 3px; }
.device.revoked { opacity: 0.5; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  margin-inline-start: 6px;
  vertical-align: 1px;
}

.tag.alerte {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(227, 118, 106, .16);
}

.codebox {
  font: 700 1.7rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 18px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  margin-top: 14px;
  color: var(--gold-1);
}

label.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  margin-top: 18px;
}
label.check input { width: auto; margin: 0; accent-color: var(--accent); }

.hint { font-size: 0.82rem; color: var(--muted); margin: 6px 0 0; }

footer { margin-top: 24px; font-size: 0.8rem; color: var(--muted); text-align: center; }
a { color: var(--gold-1); }
