/* ═══════════════════════════════════════════════════════════
   session.css — la porte d'entrée et les panneaux de compte.
   Même grammaire que l'accueil : le bandeau lagon en fond, une
   carte blanche posée dessus, capitales espacées et pilules.
   ═══════════════════════════════════════════════════════════ */

/* ── Porte d'entrée ────────────────────────────────────── */
.gate {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 2rem 1.1rem calc(2rem + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: linear-gradient(165deg, #003D52 0%, #00697F 42%, #109FB0 78%, #58C6C4 100%);
}

/* Les mêmes voiles clairs que le bandeau de l'accueil. */
.gate::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 78% 108%, rgba(255,255,255,.40) 0%, rgba(255,255,255,0) 58%),
    radial-gradient(80% 55% at 12% 6%, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 62%);
  pointer-events: none;
}

.gate__panel {
  position: relative;
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: 0 2px 6px rgba(0,32,42,.18), 0 40px 70px -32px rgba(0,32,42,.55);
  padding: 2rem 1.7rem 1.7rem;
}

/* Un filet lagon en haut de la carte, comme les cartes de l'accueil. */
.gate__panel::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #00566A, #23A8B4, #7ED4C4);
  border-radius: var(--r-m) var(--r-m) 0 0;
}

.gate__foot {
  position: relative;
  max-width: 26rem;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: .76rem;
  font-weight: 300;
  text-align: center;
}

.ghead { margin-bottom: 1.5rem; text-align: center; }

.ghead h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -.012em;
  line-height: 1.15;
  color: var(--ink);
}

.ghead h1 em { font-style: normal; color: var(--accent); }

.ghead p {
  margin: .5rem auto 0;
  max-width: 30ch;
  color: var(--ink-soft);
  font-size: .875rem;
  font-weight: 300;
  line-height: 1.5;
}

/* ── Formulaires ───────────────────────────────────────── */
.gform { display: block; }

.gf { margin-bottom: 1rem; }

.gf label {
  display: block;
  margin-bottom: .35rem;
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.gf input {
  width: 100%;
  padding: .68rem .75rem;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
}

.gf input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.gbtn {
  display: block;
  width: 100%;
  margin-top: 1.25rem;
  padding: .8rem 1rem;
  font: inherit;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s;
}

.gbtn:hover:not(:disabled) { background: var(--accent-deep); }
.gbtn:disabled { opacity: .55; cursor: default; }

.gfoot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  margin-top: 1.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
}

.gsep { color: var(--line); }

.glink {
  padding: .15rem .2rem;
  font: inherit;
  font-size: .82rem;
  color: var(--accent);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  cursor: pointer;
}

.glink:hover { border-bottom-color: currentColor; }
.glink--danger { color: var(--rouge); }

/* ── Messages ──────────────────────────────────────────── */
.gmsg:empty { display: none; }
.gmsg { margin-top: .3rem; }

.gnote {
  margin: .6rem 0 0;
  padding: .6rem .75rem;
  font-size: .83rem;
  font-weight: 300;
  line-height: 1.5;
  border-left: 3px solid var(--line);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  background: var(--surface-2);
  color: var(--ink-soft);
}

.gnote--bad  { border-left-color: var(--rouge); background: var(--rouge-wash); color: var(--ink); }
.gnote--good { border-left-color: var(--jade);  background: var(--jade-wash);  color: var(--ink); }
.gnote--warn { border-left-color: var(--accent); background: var(--accent-wash); color: var(--ink); }

/* ── Indicateur de synchronisation ─────────────────────── */
.syncdot {
  align-self: center;
  width: 8px;
  height: 8px;
  margin-right: .45rem;
  border-radius: 50%;
  background: var(--jade);
  flex: none;
}

.syncdot--saving  { background: var(--accent); animation: syncpulse 1.1s ease-in-out infinite; }
.syncdot--error   { background: var(--rouge); }
.syncdot--offline { background: var(--ink-faint); }

@keyframes syncpulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
  .syncdot--saving { animation: none; }
}

/* ── Panneaux (compte, partage) ────────────────────────── */
.sheetwrap {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  background: rgba(10, 32, 40, .52);
  backdrop-filter: blur(2px);
}

.sheetbox {
  width: 100%;
  max-width: 27rem;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-lift);
}

.sheethead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: 1.1rem 1.2rem .9rem;
  border-bottom: 1px solid var(--line-soft);
}

.sheethead h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink);
}

.sheet { padding: 1.2rem; }

.sheet__id {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin: 0 0 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.sheet__id strong { font-size: 1rem; font-weight: 600; color: var(--ink); }
.sheet__id span { font-family: var(--mono); font-size: .78rem; color: var(--ink-faint); }

.sheet__hint {
  margin: 0 0 1rem;
  font-size: .84rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink-soft);
}

.sheet .toolbtn { width: 100%; text-align: left; }
.sheet .gform { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }

/* ── Liste des personnes d'une ardoise partagée ────────── */
.sharelist { margin: 0; padding: 0; list-style: none; }

.sharelist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .65rem 0;
  border-bottom: 1px dotted var(--line);
}

.sharelist li:last-child { border-bottom: 0; }
.sharelist strong { display: block; font-size: .92rem; font-weight: 600; color: var(--ink); }

.sharemail {
  display: block;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--ink-faint);
}

.sharerole {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.shareitem--pending strong { color: var(--ink-soft); font-weight: 400; }
.shareitem--pending .sharerole { color: var(--ink-faint); }

/* ── Écran étroit ──────────────────────────────────────── */
@media (max-width: 480px) {
  .gate { padding: 1.4rem 1rem; }
  .gate__panel { padding: 1.6rem 1.2rem 1.3rem; }
  .ghead h1 { font-size: 1.35rem; }
}

/* ── Marque de la porte d'entrée ───────────────────────── */
.gmark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto .85rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
}

.gmark svg { width: 24px; height: 24px; display: block; }

/* ── Vitrine : visiteur non connecté ───────────────────────
   La page de présentation reste visible ; on masque seulement ce qui
   n'a pas de sens sans compte. */
.is-showcase .topbar,
.is-showcase .rail,
.is-showcase .rail__veil,
.is-showcase .fabs,
.is-showcase .topbar__menu,
.is-showcase #btnPrint { display: none !important; }

.topbar__cta {
    font: inherit;
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .5rem 1rem;
    margin-left: .4rem;
    cursor: pointer;
    background: #00768C;
    color: #fff;
    transition: background .15s ease, color .15s ease;
}
.topbar__cta:hover { background: #005C6E; }

.topbar__cta--ghost {
    background: transparent;
    color: #00768C;
    border-color: currentColor;
}
.topbar__cta--ghost:hover { background: rgba(0, 118, 140, .1); }

@media (max-width: 520px) {
    .topbar__cta--ghost { display: none; }
}

/* ── Mot de passe : bouton « œil » ─────────────────────── */
.gpw { position: relative; }
.gf .gpw input { padding-right: 2.9rem; }
.gpw__eye {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 2.8rem;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0 var(--r-s) var(--r-s) 0;
  color: var(--ink-faint);
  cursor: pointer;
}
.gpw__eye:hover,
.gpw__eye[aria-pressed="true"] { color: var(--accent); }
.gpw__eye:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gpw__eye svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
/* Edge ajoute son propre œil : on garde le nôtre seulement. */
.gpw input::-ms-reveal,
.gpw input::-ms-clear { display: none; }

/* ── Justificatifs (photos, captures, PDF) ─────────────── */
.pieces {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: .55rem;
  margin: .2rem 0 .6rem;
}
.pieces:empty { display: none; }

.piece {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  text-decoration: none;
}
.piece img { display: block; width: 100%; height: 100%; object-fit: cover; }
.piece__pdf {
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--rouge);
}
.piece__x {
  position: absolute;
  top: 4px; right: 4px;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  padding: 0;
  font-size: 16px; line-height: 1;
  color: #fff;
  background: rgba(10, 32, 40, .72);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.piece--busy { font-size: .72rem; color: var(--ink-faint); }
.piece--busy span { animation: syncpulse 1.1s ease-in-out infinite; }

.pieces--view { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: .4rem; }
.piece__cell { display: flex; flex-direction: column; gap: .3rem; }
.piece__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .1rem .5rem;
}
.piece__actions .glink { font-size: .75rem; text-decoration: none; }

.pieces__add { margin-top: .1rem; }
.entry__clip { white-space: nowrap; }
