/* Charte URPC : accent #38bdf8, fond clair #e6f0f7. Cible tactile généreuse (accessibilité). */
:root {
  --urpc-accent: #38bdf8;
  --urpc-accent-dark: #0ea5e9;
  --urpc-bg: #e6f0f7;
  --urpc-panel: #ffffff;
  --urpc-ink: #1e293b;
  --urpc-muted: #64748b;
  --urpc-line: #cbd8e6;
  --ok: #16a34a;
  --ko: #dc2626;
  --radius: 18px;
  --tap: 72px; /* hauteur minimale d'une cible tactile */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--urpc-bg);
  color: var(--urpc-ink);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 20px;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
}

#app { height: 100vh; display: flex; flex-direction: column; }

/* En-tête de marque */
.brand {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px;
  background: var(--urpc-panel);
  border-bottom: 3px solid var(--urpc-accent);
  flex-shrink: 0;
}
.brand .mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--urpc-accent);
  color: #fff; font-weight: 800; font-size: 22px;
  display: grid; place-items: center;
}
.brand .title { font-size: 22px; font-weight: 700; }
.brand .subtitle { font-size: 15px; color: var(--urpc-muted); margin-top: 2px; }

/* Corps scrollable */
.screen { flex: 1; overflow-y: auto; padding: 24px; -webkit-overflow-scrolling: touch; }
.screen h2 { font-size: 26px; margin: 0 0 6px; }
.screen .lead { color: var(--urpc-muted); margin: 0 0 22px; font-size: 18px; }

/* Boutons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: var(--tap); width: 100%;
  border: none; border-radius: var(--radius);
  background: var(--urpc-accent); color: #fff;
  font-size: 22px; font-weight: 700; cursor: pointer;
  padding: 0 24px;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); background: var(--urpc-accent-dark); }
.btn.secondary { background: var(--urpc-panel); color: var(--urpc-ink); border: 2px solid var(--urpc-line); }
.btn.ghost { background: transparent; color: var(--urpc-muted); border: 2px solid transparent; }
.btn .icon { width: 26px; height: 26px; }
.btn-row { display: flex; gap: 14px; margin-top: 18px; }

/* Grandes tuiles de choix (Wi-Fi / Ethernet) */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tile {
  background: var(--urpc-panel); border: 2px solid var(--urpc-line);
  border-radius: var(--radius); padding: 30px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  cursor: pointer; min-height: 180px; justify-content: center;
}
.tile:active { border-color: var(--urpc-accent); transform: scale(.99); }
.tile .icon { width: 56px; height: 56px; color: var(--urpc-accent); }
.tile .label { font-size: 22px; font-weight: 700; }
.tile .hint { font-size: 15px; color: var(--urpc-muted); }

/* Bannière d'état */
.status-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--urpc-panel); border: 2px solid var(--urpc-line);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 22px;
}
.status-card.online { border-color: var(--ok); }
.status-card.offline { border-color: var(--ko); }
.status-card .dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.status-card.online .dot { background: var(--ok); }
.status-card.offline .dot { background: var(--ko); }
.status-card .txt b { display: block; font-size: 19px; }
.status-card .txt span { color: var(--urpc-muted); font-size: 16px; }

/* Listes (réseaux wifi, pharmacies) */
.list { display: flex; flex-direction: column; gap: 12px; }
.row {
  display: flex; align-items: center; gap: 16px;
  background: var(--urpc-panel); border: 2px solid var(--urpc-line);
  border-radius: var(--radius); padding: 16px 20px; min-height: var(--tap);
  cursor: pointer; text-align: left;
}
.row:active { border-color: var(--urpc-accent); }
.row .grow { flex: 1; min-width: 0; }
.row .primary { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 15px; color: var(--urpc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .apb { font-variant-numeric: tabular-nums; color: var(--urpc-accent-dark); font-weight: 700; font-size: 16px; }
.row .icon { width: 28px; height: 28px; color: var(--urpc-accent); flex-shrink: 0; }

/* Barre de signal wifi */
.signal { display: flex; align-items: flex-end; gap: 3px; height: 24px; }
.signal i { width: 5px; background: var(--urpc-line); border-radius: 2px; }
.signal i.on { background: var(--urpc-accent); }
.signal i:nth-child(1){height:8px} .signal i:nth-child(2){height:14px}
.signal i:nth-child(3){height:19px} .signal i:nth-child(4){height:24px}

/* Recherche */
.searchbar { display: flex; align-items: center; gap: 12px; background: var(--urpc-panel);
  border: 2px solid var(--urpc-line); border-radius: var(--radius); padding: 0 18px; margin-bottom: 16px; }
.searchbar .icon { width: 26px; height: 26px; color: var(--urpc-muted); }
.searchbar input { flex: 1; border: none; outline: none; font-size: 20px; padding: 18px 0; background: transparent; color: var(--urpc-ink); }

/* Diagnostic */
.diag { display: flex; flex-direction: column; gap: 12px; }
.diag .item { display: flex; align-items: center; gap: 16px; background: var(--urpc-panel);
  border: 2px solid var(--urpc-line); border-radius: var(--radius); padding: 16px 20px; }
.diag .badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.diag .badge.ok { background: var(--ok); } .diag .badge.ko { background: var(--ko); }
.diag .badge .icon { width: 24px; height: 24px; }
.diag .grow b { display: block; font-size: 19px; }
.diag .grow span { color: var(--urpc-muted); font-size: 16px; }

/* Clavier virtuel */
.kb { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.kb .pw-display { background: var(--urpc-panel); border: 2px solid var(--urpc-accent);
  border-radius: 12px; padding: 16px 18px; font-size: 24px; min-height: 60px;
  font-variant-numeric: tabular-nums; letter-spacing: 2px; word-break: break-all; }
.kb-row { display: flex; gap: 8px; justify-content: center; }
.key { flex: 1; min-width: 0; min-height: 60px; border-radius: 10px; border: 2px solid var(--urpc-line);
  background: var(--urpc-panel); font-size: 22px; font-weight: 600; cursor: pointer; color: var(--urpc-ink); }
.key:active { background: var(--urpc-accent); color: #fff; }
.key.wide { flex: 2; }
.key.accent { background: var(--urpc-accent); color: #fff; }

/* Spinner */
.center { height: 100%; display: grid; place-items: center; text-align: center; }
.spin { animation: spin 1s linear infinite; width: 56px; height: 56px; color: var(--urpc-accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mode affichage : iframe plein écran + bouton retour discret */
.display-wrap { position: fixed; inset: 0; background: #000; }
.display-wrap iframe { width: 100%; height: 100%; border: none; }
#escape-zone { position: fixed; top: 0; right: 0; width: 90px; height: 90px; z-index: 9999; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--urpc-ink); color: #fff; padding: 14px 24px; border-radius: 999px;
  font-size: 17px; z-index: 10000; }

.stale-banner { background: #fef3c7; color: #92400e; border: 2px solid #fcd34d;
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 16px; }
