/* TLSCONNECT — portail. Couleurs reprises du logo (bleu nuit + orange). */
:root {
  --navy: #132b4c;
  --navy-2: #1c3d68;
  --orange: #ff8a1f;
  --orange-2: #ff6a1f;
  --ink: #132b4c;
  --muted: #5b6b82;
  --line: #dbe3ee;
  --bg: #f4f7fb;
  --card: #ffffff;
  --danger: #b42318;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(19, 43, 76, .06), 0 8px 24px rgba(19, 43, 76, .08);
  --shadow-hover: 0 2px 4px rgba(19, 43, 76, .08), 0 14px 34px rgba(19, 43, 76, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(255, 138, 31, .10), transparent 70%),
    linear-gradient(180deg, #ffffff 0, var(--bg) 340px);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell {
  max-width: 560px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ---------- marque ---------- */
.brand { text-align: center; margin: 4px 0 28px; animation: rise .5s ease both; }
.logo { display: block; width: 150px; height: auto; margin: 0 auto 6px; }
.wordmark { margin: 0; font-size: clamp(30px, 8vw, 40px); letter-spacing: .06em; font-weight: 800; color: var(--navy); }
.wordmark span { color: var(--orange-2); }
.tagline { margin: 6px 0 0; color: var(--muted); font-size: 17px; letter-spacing: .02em; }

/* ---------- cartes ---------- */
.apps { display: grid; gap: 16px; margin-top: 4px; }
.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 22px 20px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: rise .5s ease both;
}
.card:nth-child(2) { animation-delay: .06s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: #c5d3e6; }
.card:active { transform: translateY(0); }
.card:focus-visible, .primary:focus-visible, .ghost:focus-visible, .eye:focus-visible, .linkbtn:focus-visible, #code:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}
.tile {
  flex: none;
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--navy-2), var(--navy));
  box-shadow: inset 0 -3px 0 var(--orange);
}
.tile svg { width: 32px; height: 32px; }
.card-body { flex: 1; min-width: 0; }
.card-title { display: block; margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .03em; }
.card-desc { display: block; margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.chev { flex: none; color: var(--orange-2); transition: transform .18s ease; }
.card:hover .chev { transform: translateX(3px); }
.chip {
  display: inline-block; margin-top: 8px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  color: #0b6b3a; background: #e3f6ec;
}
.skeleton { min-height: 108px; cursor: default; background: linear-gradient(90deg, #fff 25%, #eef3f9 50%, #fff 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

/* ---------- messages ---------- */
.notice {
  margin: 0 0 16px; padding: 12px 14px;
  border-radius: 12px; font-size: 15px; line-height: 1.4;
  color: #7a4a00; background: #fff4e0; border: 1px solid #ffd9a1;
}
.notice.info { color: var(--navy); background: #e9f1fb; border-color: #c9dbf1; }
.signout { text-align: center; margin: 18px 0 0; }
.linkbtn { border: 0; background: none; padding: 8px; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--navy); }
.foot { margin-top: auto; padding-top: 28px; text-align: center; font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- fenêtre d'accès ---------- */
.modal {
  width: min(420px, calc(100vw - 32px));
  padding: 26px 24px 20px;
  border: 0; border-radius: 20px;
  color: var(--ink); background: #fff;
  box-shadow: 0 24px 70px rgba(19, 43, 76, .35);
}
.modal[open] { animation: pop .2s ease both; }
.modal::backdrop { background: rgba(19, 43, 76, .55); backdrop-filter: blur(3px); animation: fade .2s ease both; }
.modal-head { display: flex; align-items: center; gap: 14px; }
.modal-icon { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(145deg, var(--navy-2), var(--navy)); box-shadow: inset 0 -3px 0 var(--orange); }
.modal-icon svg { width: 26px; height: 26px; }
.modal-app { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .08em; color: var(--orange-2); }
.modal h2 { margin: 2px 0 0; font-size: 22px; }
.modal-desc { margin: 16px 0 14px; color: var(--muted); font-size: 15px; }
.field { position: relative; display: block; }
.field input {
  width: 100%; height: 52px; padding: 0 52px 0 16px;
  font: inherit; font-size: 18px; letter-spacing: .04em;
  color: var(--ink); background: #f7f9fc;
  border: 1.5px solid var(--line); border-radius: 12px;
}
.field input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 138, 31, .18); background: #fff; }
.field input.invalid { border-color: var(--danger); animation: shake .3s ease; }
.eye { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.eye:hover { color: var(--navy); background: #eef3f9; }
.error { margin: 10px 2px 0; font-size: 14px; font-weight: 600; color: var(--danger); }
.primary {
  width: 100%; height: 52px; margin-top: 16px;
  font: inherit; font-size: 17px; font-weight: 800; letter-spacing: .02em;
  color: #fff; background: linear-gradient(180deg, var(--orange), var(--orange-2));
  border: 0; border-radius: 12px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(255, 106, 31, .32);
  transition: transform .12s ease, filter .12s ease;
}
.primary:hover { filter: brightness(1.05); }
.primary:active { transform: translateY(1px); }
.primary[disabled] { opacity: .65; cursor: progress; }
.ghost { width: 100%; height: 46px; margin-top: 8px; font: inherit; font-size: 15px; font-weight: 600; color: var(--navy); background: none; border: 0; border-radius: 12px; cursor: pointer; }
.ghost:hover { background: #eef3f9; }

/* ---------- animations légères ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (min-width: 720px) {
  .shell { padding-top: 56px; }
  .logo { width: 170px; }
}
@media (max-width: 380px) {
  .card { padding: 18px 14px; gap: 14px; }
  .tile { width: 54px; height: 54px; }
}
