/* ---------------------------------------------------------------------------
   Feuille de style des pages d'entree — Babyphone, chalet de Gstaad (site 1317-sa).

   La palette est celle de l'appli Babyphone : bleu nuit, fraise, vert du
   calice. Elle est SOMBRE en toutes circonstances, y compris si le telephone
   est en theme clair : l'appli l'est, et une page claire suivie d'une
   interface sombre eblouit la nuit, precisement quand on ecoute une chambre.
   --------------------------------------------------------------------------- */

:root {
  /* Reprises du :root de l'appli Babyphone (public/style.css). */
  --bg: #0f1420;
  --surface: #182033;
  --surface-2: #1f2a42;
  --border: #2a3550;
  --border-soft: rgba(255, 255, 255, .06);
  --ink: #e6ebf5;
  --ink-soft: #8a95ad;
  --ink-faint: #5f6b85;
  --berry: #e8576a;           /* la fraise du logo */
  --berry-ink: #2a0a10;
  --leaf: #3ccf8e;            /* le calice */
  --star: #ffe3a3;            /* l'etoile */

  /* Noms historiques, conserves pour ne pas reecrire toutes les regles. */
  --text: var(--ink);
  --muted: var(--ink-soft);
  --accent: var(--berry);
  --accent-text: var(--berry-ink);
  --gold-1: var(--star);
  --gold-2: var(--berry);
  --danger: #ef5a5a;
  --ok: var(--leaf);

  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at top, #1c2640 0%, transparent 62%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, 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;
}

/* L'hebreu : polices systeme qui ont les lettres hebraiques. La page entiere
   bascule en droite-a-gauche via html[dir=rtl], pose par brand.js. */
html[dir="rtl"] body {
  font-family: -apple-system, "SF Hebrew", "Arial Hebrew", "Segoe UI",
               "Noto Sans Hebrew", Arial, sans-serif;
}

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 nom le couperait 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; border-radius: 22%; box-shadow: 0 6px 22px -8px rgba(232, 87, 106, .55); }
.brand-text { min-width: 0; }
.brand .lang-toggle { grid-column: 1 / -1; justify-self: end; }

/* Le nom, compose comme l'en-tete de l'appli : sobre, blanc, graisse moyenne. */
.brand-name {
  font-weight: 500;
  font-size: clamp(24px, 6.4vw, 32px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}


.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 11px;
  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(--berry); color: var(--berry-ink); }
/* « עב » est en hebreu dans un bouton de page latine : police hebraique. */
.lang-toggle button[lang="he"] {
  font-family: -apple-system, "SF Hebrew", "Arial Hebrew", "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 13px;
}

/* ---------------------------------------------------------------------------
   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; }
/* Un code d'invitation reste en caracteres latins, meme sur une page en hebreu :
   sans cela le tiret de XXXX-XXXX saute a l'autre bout du champ. */
html[dir="rtl"] input.code { direction: ltr; text-align: center; }

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; }
button.ghost:hover { border-color: var(--ink-faint); }

/* 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(224, 85, 85, .16); color: #f08a8a; }
.msg.ok { background: rgba(60, 207, 142, .14); color: #7fe0b3; }
.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: #f08a8a;
  background: rgba(224, 85, 85, .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: #9fc0ff; }
