/* ==========================================================
   12 - Retour en haut, session, page de connexion, notifications
   ========================================================== */

/* --- Bouton retour en haut --- */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--shadow-md), 0 1px 0 rgba(255,255,255,0.14) inset;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.85);
  transition: opacity .24s var(--ease), transform .24s var(--ease), background .18s;
  z-index: 200;
}
.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.scroll-top-btn:hover { background: var(--ink-2); transform: translateY(-2px) scale(1.04); }
.scroll-top-btn svg { width: 20px; height: 20px; }

/* ==========================================================
   Page de connexion
   ========================================================== */
body.login-page {
  height: auto;
  overflow: auto;
  min-height: 100vh;
  background: var(--page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

/* Numeral geant en filigrane, echo editorial discret derriere la carte */
.year-mark {
  position: fixed;
  z-index: 0;
  left: -4vw;
  bottom: -9vw;
  font-family: var(--display);
  font-weight: 800;
  font-size: 46vw;
  line-height: .78;
  color: var(--t1);
  opacity: .035;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
}

/* Signature de marque : trait diagonal dans l'orange Moto Axxe */
.accent-line {
  width: 46px;
  height: 2px;
  background: var(--brand-axxe);
  border-radius: var(--r-full);
  transform: rotate(-3.5deg);
  margin-bottom: 14px;
  opacity: 0;
  animation: login-rise .6s var(--ease-out) .05s forwards;
}

.login-header {
  width: 100%;
  max-width: 400px;
  text-align: center;
  margin-bottom: 1.75rem;
  opacity: 0;
  animation: login-rise .6s var(--ease-out) .12s forwards;
}
.login-logo {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto .9rem;
}
.login-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--t2);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: 2rem 1.75rem 1.75rem;
  opacity: 0;
  animation: login-rise .62s var(--ease-out) .2s forwards;
}

/* Onglets de la carte de connexion (portee limitee a la page login) */
.login-page .tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.login-page .tab-btn {
  background: none;
  border: none;
  padding: .9rem 1rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--t3);
  cursor: pointer;
  transition: color .18s;
  position: relative;
}
.login-page .tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transition: transform .24s var(--ease);
}
.login-page .tab-btn.active { color: var(--blue); }
.login-page .tab-btn.active::after { transform: scaleX(1); }

.login-page .tab-panel { display: none; padding: 1.75rem; }
.login-page .tab-panel.active { display: block; }

.form-group {
  margin-bottom: 1rem;
  opacity: 0;
  animation: login-rise .5s var(--ease-out) forwards;
  animation-delay: .3s;
}
.form-group:nth-of-type(2) { animation-delay: .36s; }
.form-group label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .45rem;
}
.form-label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-group input {
  width: 100%;
  padding: .75rem .9rem;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  font-size: .95rem;
  color: var(--t1);
  background: var(--surface-2);
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none;
}
.form-group input:focus {
  border-color: var(--blue);
  box-shadow: var(--ring);
  background: var(--surface);
}

.alert {
  padding: .75rem .9rem;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  opacity: 0;
  animation: login-rise .5s var(--ease-out) .3s forwards;
}
.alert-error   { background: var(--red-soft);   color: var(--red);   border: 1px solid color-mix(in srgb, var(--red) 22%, transparent); }
.alert-success { background: var(--green-soft); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 22%, transparent); }

/* Bouton pleine largeur : uniquement sur la page de connexion */
.login-page .btn-primary {
  width: 100%;
  padding: .85rem 1rem;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -0.014em;
  cursor: pointer;
  box-shadow: var(--shadow-sm), 0 1px 0 rgba(255,255,255,0.14) inset;
  transition: background .18s, transform .12s, box-shadow .18s;
  margin-top: .35rem;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: login-rise .5s var(--ease-out) .44s forwards;
}
.login-page .btn-primary:hover  { background: var(--ink-2); box-shadow: var(--shadow-md), 0 1px 0 rgba(255,255,255,0.14) inset; }
.login-page .btn-primary:active { transform: scale(.98); }
.login-page .btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.16) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .55s var(--ease-out);
}
.login-page .btn-primary:hover::after { transform: translateX(120%); }

.role-hint {
  margin-top: 1rem;
  font-size: .8rem;
  color: var(--t4);
  text-align: center;
  opacity: 0;
  animation: login-rise .5s var(--ease-out) .5s forwards;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .year-mark, .accent-line, .login-header, .login-card,
  .alert, .form-group, .login-page .btn-primary, .role-hint {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 440px) {
  .login-card { border-radius: var(--r-lg); padding: 1.5rem 1.25rem 1.25rem; }
  .year-mark { font-size: 62vw; }
}

/* ==========================================================
   Sidebar liste : responsive
   ========================================================== */
@media (max-width: 1099px) {
  #listSidebarWrapper { width: 176px; }
}
@media (max-width: 749px) {
  #listView { flex-direction: column; gap: 16px; }
  #listSidebarWrapper {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--page);
    margin-top: -14px;
    padding: 14px 0 12px;
  }
  .lsb-anim-links { margin-top: 8px; }
  #listSidebar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border-radius: var(--r-md);
    overflow: hidden;
  }
  .lsb-month {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .lsb-month:not(:last-child) { border-bottom: 3px solid transparent; border-right: 1px solid var(--border); }
  .lsb-month.active { border-bottom-color: var(--blue); border-left: none; }
  .lsb-month-name { font-size: 11px; }
  .lsb-all-btn { grid-column: 1 / -1; border-top: 1px solid var(--border); padding: 8px 12px; }
  .lsb-anim-links { flex-direction: row; margin-top: 8px; }
  .lsb-anim-btn { flex: 1; }
}

/* ==========================================================
   Panneau "Notifier quelqu'un"
   ========================================================== */
.notify-section {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.notify-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  background: var(--blue);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.014em;
  color: #fff;
  text-align: left;
  transition: background 0.18s;
  font-family: inherit;
}
.notify-toggle:hover { background: var(--blue-press); color: #fff; }
.notify-toggle.open {
  background: var(--blue-press);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.notify-toggle .notify-chevron { margin-left: auto; transition: transform 0.24s var(--ease); }
.notify-toggle.open .notify-chevron { transform: rotate(180deg); }

.notify-panel {
  display: none;
  padding: 15px;
  background: var(--surface);
}
.notify-panel.open { display: block; }
.notify-users-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 170px;
  overflow-y: auto;
}
.notify-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  user-select: none;
}
.notify-user-item:hover { border-color: color-mix(in srgb, var(--blue) 40%, transparent); background: color-mix(in srgb, var(--blue) 4%, transparent); }
.notify-user-item:has(.notify-user-cb:checked) {
  border-color: color-mix(in srgb, var(--blue) 50%, transparent);
  background: var(--blue-soft);
}
.notify-user-item input[type="checkbox"] { flex-shrink: 0; accent-color: var(--blue); }
.notify-user-info { display: flex; flex-direction: column; gap: 2px; }
.notify-pseudo { font-size: 13px; font-weight: 600; color: var(--t1); }
.notify-email  { font-size: 11px; color: var(--t4); }

/* ==========================================================
   Mode presentation : vue epuree pour projeter en reunion
   ========================================================== */
/* Icone agrandir/reduire animee, meme technique que le bouton "Copier" */
.pres-icon { position: relative; display: inline-block; width: 14px; height: 14px; flex-shrink: 0; }
.pres-icon svg {
  position: absolute; inset: 0;
  transition: opacity 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pres-icon-shrink { opacity: 0; transform: scale(0.6); }
.presentation-toggle-btn.active .pres-icon-expand { opacity: 0; transform: scale(0.6); }
.presentation-toggle-btn.active .pres-icon-shrink { opacity: 1; transform: scale(1); }
.presentation-toggle-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* Chrome masque : recherche, ajout, historique, utilisateurs, profil,
   barre d'onglets mobile. La barre de filtres (.subbar) reste
   volontairement affichee. Le bouton de sortie (#presentationToggleBtn)
   reste volontairement visible. */
body.presentation-mode .topbar-search,
body.presentation-mode .topbar-add-btn,
body.presentation-mode a.topbar-history-btn,
body.presentation-mode button.topbar-history-btn:not(#presentationToggleBtn),
body.presentation-mode .topbar-user,
body.presentation-mode .mobile-tabbar,
body.presentation-mode .mobile-sheet-backdrop,
body.presentation-mode .scroll-top-btn {
  display: none !important;
}
body.presentation-mode .topbar { justify-content: center; }
body.presentation-mode .topbar-title-block { text-align: center; }
/* Le bouton reste a l'extreme droite de la topbar plutot que colle au titre */
body.presentation-mode #presentationToggleBtn { margin-left: auto; }

/* Les cartes respirent un peu plus, plus lisibles a distance */
body.presentation-mode .op-card-name { font-size: 24px; }

/* Sidebar des mois -> deuxieme barre horizontale sous les filtres, sur
   toutes les largeurs (meme principe que la version tablette existante,
   mais sans les liens Animations/Documentation qui n'ont pas leur place
   dans une barre de navigation). */
body.presentation-mode .main.main--list #listView { flex-direction: column; gap: 0; }
body.presentation-mode .main.main--list #listSidebarWrapper {
  position: sticky;
  top: 0;
  width: 100%;
  max-height: none;
  z-index: 20;
  background: var(--page);
  padding: 10px 0 14px;
  margin: 0 0 4px;
  overflow: visible;
}
body.presentation-mode #listSidebarWrapper::before { display: none; }
body.presentation-mode #listSidebarWrapper .lsb-anim-links,
body.presentation-mode #listSidebarWrapper .lsb-doc-link { display: none; }
/* Mois en pastilles a la suite, meme esprit que .filter-pill plutot
   qu'une grille de cases. */
body.presentation-mode .main.main--list #listSidebar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  max-height: none;
  flex: none;
}
body.presentation-mode .lsb-month {
  flex: 0 0 auto;
  gap: 8px;
  padding: 7px 15px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-full);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
body.presentation-mode .lsb-month:not(:last-child) { border-bottom: 1px solid var(--border-2); }
body.presentation-mode .lsb-month.current { border-color: var(--blue); }
body.presentation-mode .lsb-month-load { display: none; }
/* "Afficher tout" n'a plus lieu d'etre : tous les mois sont deja affiches */
body.presentation-mode .lsb-all-btn { display: none; }
body.presentation-mode .month-heading { font-size: 26px; }
body.presentation-mode .month-heading-current { font-size: 30px; }
