/* =========================================================
   Libric — style-v3.css
   Direction: calme, institutionnel, lisible (mobile-first)
========================================================= */

/* -------------------------
   0) Base + tokens
------------------------- */
:root{
  --bg0:#07101c;
  --bg1:#0a1526;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --muted2: rgba(255,255,255,.60);
  --accent:#4ea6a8;
  --accent2:#7fc8ca;
  --line: rgba(255,255,255,.10);
  --line2: rgba(255,255,255,.16);
  --card: rgba(255,255,255,.035);
  --card2: rgba(255,255,255,.05);
  --shadow: 0 16px 46px rgba(0,0,0,.42);
  --radius: 18px;
  --max: 1120px;
  --pad: 20px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg0);
  line-height: 1.48;
  overflow-x:hidden;
}
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; height:auto; display:block; }

.wrap{
  width: min(var(--max), calc(100% - (var(--pad) * 2)));
  margin: 0 auto;
}
.page{ min-height:100vh; }

/* -------------------------
   Background
------------------------- */
.bg{
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1000px 750px at 18% 12%, rgba(78,166,168,.10), transparent 62%),
    radial-gradient(900px 700px at 86% 20%, rgba(127,200,202,.06), transparent 58%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%);
}

/* -------------------------
   Header
------------------------- */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7,16,28,.72);
  backdrop-filter: blur(10px);
}
@supports not ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))){
  .topbar{ background: rgba(7,16,28,.92); }
}

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 0;
}

.brand{ display:flex; align-items:center; }
.brand-icon{ width: 120px; height: auto; }

.topnav{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
  justify-content:flex-end;
}
.toplink{
  font-size: 14px;
  color: var(--muted2);
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.toplink:hover{
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,.03);
}

.topnav .btn {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

@media (max-width: 860px){
  .toplink{ display:none; }
}

/* -------------------------
   Typography
------------------------- */
.kicker{
  margin: 0 0 10px;
  color: rgba(127,200,202,.88);
  letter-spacing: .10em;
  text-transform: uppercase;
  font-size: 12px;
}
.h1{
  margin: 0 0 12px;
  line-height: 1.10;
  font-weight: 760;
  font-size: clamp(28px, 5.6vw, 46px);
}
.lead{
  margin: 0 0 16px;
  color: var(--muted);
  max-width: 62ch;
  font-size: 16px;
}

/* -------------------------
   Hero
------------------------- */
.hero{ padding: 40px 0 24px; }

.note{
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted2);
}

/* -------------------------
   Buttons
------------------------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  font-weight: 680;
  font-size: 14px;
  user-select:none;
  white-space: nowrap;
}

.btn-primary{
  background: rgba(78,166,168,.92);
  border-color: rgba(78,166,168,.55);
  color: #07101c;
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
}
.btn-primary:hover{ filter: brightness(1.03); }

.btn-ghost{
  background: rgba(255,255,255,.03);
  color: var(--text);
}
.btn-ghost:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.22);
}

/* -------------------------
   Footer
------------------------- */
.footer{
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
}
.footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  flex-wrap:wrap;
}
.foot-brand{ font-weight: 820; letter-spacing: .02em; }
.foot-note{ color: var(--muted2); font-size: 13px; margin-top: 8px; }
.inline{ color: rgba(127,200,202,.92); }
.inline:hover{ color: var(--text); }

/* -------------------------
   Mobile polish
------------------------- */
@media (max-width: 520px){
  :root{
    --pad: 16px;
    --radius: 14px;
  }
  .topbar-inner{ gap: 8px; padding: 10px 0; }
  .brand-icon{ width: 80px; }
  .topnav{ flex-wrap: nowrap; gap: 6px; }
  .topnav .btn{ height: 30px; padding: 0 9px; font-size: 11px; }
  .topnav .note{ font-size: 11px; }
  #nav-visitor > div{ gap: 6px; }

  .hero{ padding: 24px 0 16px; }
  .lead{ font-size: 15.5px; }
  .kicker{ font-size: 11px; }
  .note{ margin: 8px 0 0; }

  .footer{ margin-top: 24px; padding: 20px 0 32px; }

  .bg{
    background:
      radial-gradient(900px 650px at 30% 10%, rgba(78,166,168,.08), transparent 64%),
      linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%);
  }
}

/* =========================================
   DASHBOARD GRID MORPHING
========================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: clamp(10px, 1.5vw, 16px);
  width: min(90%, 500px);
  margin: 2rem auto;
  aspect-ratio: 1 / 1;
  max-height: 500px;
}

.dash-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 12px);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: clamp(12px, 2vw, 18px);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dash-btn:hover:not(.dash-disabled) {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.22);
}

.dash-btn[data-service="Lecture"]    { grid-column: 1; grid-row: 1; }
.dash-btn[data-service="Bureau"]     { grid-column: 2; grid-row: 1; }
.dash-btn[data-service="Messagerie"] { grid-column: 1; grid-row: 2; }
.dash-btn[data-service="Discussion"] { grid-column: 2; grid-row: 2; }

.dash-icon {
  width: clamp(48px, 8vw, 72px);
  height: clamp(48px, 8vw, 72px);
  flex-shrink: 0;
  object-fit: contain;
}
.dash-icon-sm {
  width: clamp(22px, 4vw, 32px);
  height: clamp(22px, 4vw, 32px);
  flex-shrink: 0;
  object-fit: contain;
  mix-blend-mode: screen;
}

.dash-label { font-size: clamp(13px, 2vw, 16px); font-weight: 600; }
.dash-label-sm { font-size: clamp(9px, 1.4vw, 11px); font-weight: 500; text-align: center; }

.dash-disabled { opacity: 0.4; pointer-events: none; }

/* Cloud default / subgrid */
.cloud-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 12px);
  width: 100%; height: 100%;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cloud-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(5px, 0.8vw, 8px);
  padding: clamp(8px, 1.2vw, 12px);
  width: 100%; height: 100%;
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.dash-btn[data-service="Bureau"].expanded .cloud-default {
  opacity: 0; transform: scale(0.8); pointer-events: none;
}
.dash-btn[data-service="Bureau"].expanded .cloud-subgrid {
  opacity: 1; pointer-events: all;
}
.dash-btn[data-service="Bureau"].expanded {
  background: rgba(78,166,168,.06);
  border-color: rgba(78,166,168,.3);
}

.dash-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(78,166,168,.08);
  border: 1px solid rgba(78,166,168,.25);
  border-radius: clamp(5px, 0.8vw, 8px);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  transform: scale(0.85);
  opacity: 0;
}

.dash-btn.expanded .dash-sub { transform: scale(1); opacity: 1; }
.dash-btn.expanded .dash-sub:nth-child(1) { transition-delay: 0.05s; }
.dash-btn.expanded .dash-sub:nth-child(2) { transition-delay: 0.10s; }
.dash-btn.expanded .dash-sub:nth-child(3) { transition-delay: 0.15s; }
.dash-btn.expanded .dash-sub:nth-child(4) { transition-delay: 0.20s; }
.dash-btn.expanded .dash-sub:nth-child(5) { transition-delay: 0.25s; }
.dash-btn.expanded .dash-sub:nth-child(6) { transition-delay: 0.30s; }

.dash-sub:hover {
  background: rgba(78,166,168,.18);
  border-color: rgba(78,166,168,.5);
}

@media (max-width: 520px) {
  .dashboard-grid { width: 98%; max-height: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  .dash-btn, .dash-sub { transition: none; }
}

/* =========================================
   GUIDES SWIPE
========================================= */
.guides-swipe {
  margin: 2rem auto;
  width: min(90%, 700px);
}

.guides-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: clamp(12px, 2vw, 20px);
  padding-bottom: 4px;
  scrollbar-width: none;
}
.guides-track::-webkit-scrollbar { display: none; }

.guide-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: clamp(12px, 2vw, 18px);
  padding: clamp(20px, 3vw, 32px);
  min-height: 200px;
  min-width: 0;
  word-break: break-word;
}

.guide-kicker {
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: rgba(127,200,202,.88);
  margin-bottom: 10px;
}

.guide-title {
  margin: 0 0 14px;
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 700;
  line-height: 1.2;
}

.mu1 { padding-top: 45px; }
.mu2 { padding-top: 15px; }
.mu3 { padding-top: 45px; }

.guide-text {
  margin: 0;
  color: var(--muted);
  font-size: clamp(13px, 1.8vw, 15px);
  line-height: 1.7;
}
.guide-text a { color: var(--accent2); text-decoration: underline; text-underline-offset: 3px; }
.guide-text code {
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: .9em;
  color: var(--accent2);
}

.guides-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.guides-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,.2);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}
.guides-dot.active { background: var(--accent); width: 24px; }

/* =========================================
   MEMBER LAYOUT
========================================= */
.member-layout {
  display: flex;
  align-items: stretch;
  gap: clamp(16px, 2.5vw, 32px);
  margin: 2rem auto;
  width: min(100%, var(--max));
}

.member-layout .dashboard-grid {
  flex: 0 0 auto;
  width: min(45%, 420px);
  margin: 0;
}

.member-layout .guides-swipe {
  flex: 1 1 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: 500px;
  min-width: 0;
}

.member-layout .guides-track { flex: 1; min-height: 0; }
.member-layout .guide-card { min-height: 0; height: 100%; }

@media (max-width: 720px) {
  .member-layout { flex-direction: column; }
  .member-layout .dashboard-grid {
    width: min(90%, 500px);
    margin: 0 auto;
    aspect-ratio: 1 / 1;
  }
  .member-layout .guides-swipe { width: 100%; max-height: none; }
  .member-layout .guide-card { height: auto; }
}

/* =========================================
   VISITOR LAYOUT
========================================= */
.visitor-layout {
  display: flex;
  align-items: stretch;
  gap: clamp(16px, 2.5vw, 32px);
  margin: 2rem 0;
}

.visitor-services {
  flex: 0 0 auto;
  width: min(45%, 420px);
}

.visitor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(10px, 1.5vw, 16px);
  aspect-ratio: 1 / 1;
  max-height: 420px;
  margin-bottom: clamp(16px, 2vw, 24px);
}

.visitor-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 12px);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: clamp(12px, 2vw, 18px);
  color: var(--text);
}

.visitor-layout .guides-swipe {
  flex: 1 1 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: 420px;
  min-width: 0;
}
.visitor-layout .guides-track { flex: 1; min-height: 0; }
.visitor-layout .guide-card { min-height: 100%; height: 100%; }

@media (max-width: 720px) {
  .visitor-layout { flex-direction: column; }
  .visitor-services { width: min(90%, 500px); margin: 0 auto; }
  .visitor-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr;
    aspect-ratio: auto;
    max-height: 100px;
    margin-bottom: 12px;
  }
  .visitor-tile { gap: 4px; }
  .visitor-tile .dash-label { font-size: 10px; }
  .visitor-tile .dash-icon { width: 32px; height: 32px; }
  .visitor-layout .guides-swipe { max-height: none; width: 100%; }
  .visitor-layout .guide-card { min-height: 0; height: auto; }
  .guide-card { min-height: 0; padding: 16px; }
  .mu1 { padding-top: 8px; }
  .mu2 { padding-top: 6px; }
  .mu3 { padding-top: 8px; }
  .hero { padding-bottom: 60px; }
.visitor-layout .guide-card { 
  min-height: 0 !important; 
  height: auto !important; 
}
}

