/* =========================================================
   G'Apps — Site web (toutes fonctions) — Feuille de styles
   Charte : corail #ff5657 · police Roboto
   ========================================================= */

:root {
  --coral: #ff5657;
  --coral-dark: #ec3b46;
  --coral-light: #ff6f6f;
  --ink: #15161c;
  --muted: #6b6c78;
  --bg: #f1f1f3;
  --card: #ffffff;
  --border: #e6e6ea;
  --radius: 20px;
  --shadow: 0 12px 30px rgba(21, 22, 28, 0.07);
  --sidebar-w: 264px;
  --green: #16a34a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
.material-symbols-outlined { font-size: 22px; line-height: 1; user-select: none; }
img { display: block; }

/* ---------- Logo ---------- */
.logo-gapps {
  width: 46px; height: 46px; flex: none;
  background: var(--coral); color: #fff;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-weight: 900; line-height: .8;
}
.logo-gapps span { font-size: 18px; }
.logo-gapps small { font-size: 7px; letter-spacing: 1px; }
.logo-gapps--sm { width: 40px; height: 40px; }
.logo-gapps--sm span { font-size: 15px; }
.logo-gapps--sm small { font-size: 6px; }

/* =========================================================
   STRUCTURE
   ========================================================= */
.layout { display: flex; min-height: 100vh; }

/* ---------- Menu latéral (ordinateur) ---------- */
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 22px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar__brandname { font-size: 19px; font-weight: 900; }
.sidebar__nav { padding: 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.navitem {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: 13px;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  width: 100%; text-align: left;
  transition: background .12s ease, color .12s ease;
}
.navitem:hover { background: var(--bg); }
.navitem.is-active {
  background: rgba(255, 86, 87, 0.12);
  color: var(--coral); font-weight: 800;
}
.navitem.is-active .material-symbols-outlined { color: var(--coral); }
.navitem .material-symbols-outlined { color: var(--muted); }
.sidebar__foot {
  margin-top: auto; padding: 20px;
  font-size: 11px; color: var(--muted);
}

/* ---------- Zone principale ---------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px; height: 64px;
}
.topbar__menu { display: none; color: var(--ink); }
.cobrand { display: flex; align-items: center; gap: 8px; }
.cobrand__org-logo {
  width: 40px; height: 40px; border-radius: 11px;
  object-fit: cover; background: var(--bg);
}
.cobrand__via { font-size: 11px; color: var(--muted); font-weight: 600; }
.topbar__org { font-weight: 800; font-size: 16px; }
.topbar__demo {
  margin-left: auto;
  background: rgba(255, 86, 87, 0.12); color: var(--coral-dark);
  font-size: 11px; font-weight: 700;
  padding: 5px 11px; border-radius: 20px;
}

.view {
  flex: 1;
  width: 100%; max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px 80px;
}

/* ---------- Animation d'apparition des écrans ---------- */
.view--in { animation: viewIn .26s cubic-bezier(.22,.61,.36,1) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Les cartes se révèlent en cascade légère */
.view--in .card { animation: itemIn .34s ease both; }
.view--in .card:nth-child(1) { animation-delay: .02s; }
.view--in .card:nth-child(2) { animation-delay: .06s; }
.view--in .card:nth-child(3) { animation-delay: .10s; }
.view--in .card:nth-child(4) { animation-delay: .14s; }
.view--in .card:nth-child(5) { animation-delay: .18s; }
.view--in .card:nth-child(6) { animation-delay: .22s; }
.view--in .card:nth-child(n+7) { animation-delay: .26s; }
@keyframes itemIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .view--in, .view--in .card { animation: none; }
}

/* ---------- Barre de navigation (mobile) ---------- */
.mobilenav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: var(--coral);
  padding: 8px 6px;
  justify-content: space-around;
}
.mobilenav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 9.5px; font-weight: 700;
  padding: 4px 8px; border-radius: 12px;
}
.mobilenav button.is-active { color: #fff; }
.mobilenav button.is-active .material-symbols-outlined {
  background: #fff; color: var(--coral);
  border-radius: 50%; padding: 5px;
}

.scrim {
  display: none;
  position: fixed; inset: 0; z-index: 35;
  background: rgba(0, 0, 0, 0.4);
}

/* =========================================================
   ÉLÉMENTS COMMUNS
   ========================================================= */
.page-title { font-size: 25px; font-weight: 900; }
.page-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.section-title {
  font-size: 17px; font-weight: 800; margin: 26px 0 12px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-weight: 700; font-size: 14px;
  border-radius: 28px; padding: 11px 18px;
  transition: transform .12s ease, background .12s ease, opacity .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--coral); color: #fff;
  box-shadow: 0 8px 18px rgba(255, 86, 87, 0.34);
}
.btn--primary:hover { background: var(--coral-dark); }
.btn--primary:disabled { opacity: .55; cursor: default; transform: none; }
.btn--ghost { border: 1.6px solid var(--border); color: var(--ink); }
.btn--ghost:hover { border-color: var(--coral); color: var(--coral); }
.btn--block { width: 100%; padding: 14px; }
.btn--lg { padding: 14px 26px; font-size: 15px; }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--coral); font-weight: 700; font-size: 13.5px;
  margin-bottom: 16px;
}

.loader { display: flex; justify-content: center; padding: 70px 0; }
.spinner {
  width: 38px; height: 38px;
  border: 4px solid var(--border); border-top-color: var(--coral);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  text-align: center; color: var(--muted);
  padding: 64px 20px; font-size: 14.5px;
}
.empty .material-symbols-outlined {
  font-size: 54px; opacity: .45; display: block; margin: 0 auto 12px;
}

/* ---------- Grille générique ---------- */
.grid { display: grid; gap: 16px; }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--media { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }

/* ---------- Carte standard ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .14s ease, box-shadow .14s ease;
}
.card--link { cursor: pointer; }
.card--link:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(21, 22, 28, 0.13);
}
.card__media {
  height: 150px; flex: none;
  background: linear-gradient(135deg, var(--coral-light), var(--coral-dark));
  background-size: cover; background-position: center;
}
.card__body { padding: 14px 16px 16px; }
.card__title {
  font-size: 15.5px; font-weight: 800; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__text {
  margin-top: 6px; font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  margin-top: 12px; display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
}
.card__meta .material-symbols-outlined { font-size: 15px; }

/* ---------- Accueil ---------- */
.hero {
  border-radius: var(--radius); padding: 30px 26px;
  min-height: 170px;
  background: linear-gradient(135deg, #ffd9a0, var(--coral), var(--coral-dark));
  display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff;
}
.hero span { font-size: 13px; opacity: .9; }
.hero strong { font-size: 26px; font-weight: 900; }

.modules {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
}
.module {
  background: var(--card); border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 8px; text-align: center;
  transition: transform .12s ease;
}
.module:hover { transform: translateY(-3px); }
.module__icon {
  width: 46px; height: 46px; margin: 0 auto 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--coral-light), var(--coral-dark));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 7px 15px rgba(255, 86, 87, 0.4);
}
.module__icon .material-symbols-outlined { color: #fff; font-size: 23px; }
.module__label { font-size: 11px; font-weight: 700; }

.newsrow { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.newsrow .card { width: 230px; flex: none; }

.alert-banner {
  background: var(--coral); color: #fff;
  border-radius: 16px; padding: 14px 16px;
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 6px;
}
.alert-banner b { font-size: 14px; }
.alert-banner p { font-size: 12.5px; opacity: .92; }

.linkbtn { color: var(--coral); font-weight: 700; font-size: 13px; }

/* ---------- Détail (article, fiche, etc.) ---------- */
.detail { max-width: 780px; }
.detail__media {
  width: 100%; height: 300px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--coral-light), var(--coral-dark));
  background-size: cover; background-position: center;
  margin-bottom: 18px;
}
.detail__title { font-size: 26px; font-weight: 900; line-height: 1.25; }
.detail__date { color: var(--muted); font-size: 13px; margin-top: 6px; }
.detail__content { margin-top: 16px; font-size: 15px; line-height: 1.75; }
.detail__content img { max-width: 100%; border-radius: 12px; margin: 8px 0; }
.detail__content p { margin-bottom: 10px; }

.infocard {
  background: var(--card); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px; margin-top: 14px;
}
.inforow {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 0;
}
.inforow + .inforow { border-top: 1px solid var(--border); }
.inforow__ic {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  background: rgba(255, 86, 87, 0.12);
  display: flex; align-items: center; justify-content: center;
}
.inforow__ic .material-symbols-outlined { color: var(--coral); font-size: 19px; }
.inforow__lbl { font-size: 11px; font-weight: 600; color: var(--muted); }
.inforow__val { font-size: 13.5px; font-weight: 600; }

.answer {
  margin-top: 16px; padding: 16px;
  background: #eaf7ee; border: 1px solid var(--green);
  border-radius: 14px;
}
.answer b { color: #15803d; font-size: 13.5px; }
.answer p { margin-top: 6px; font-size: 14px; }

/* ---------- Pastilles / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}
.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge--new { color: #6366f1; background: rgba(99,102,241,.13); }
.badge--seen { color: #0ea5a4; background: rgba(14,165,164,.13); }
.badge--progress { color: #f59e0b; background: rgba(245,158,11,.13); }
.badge--done { color: var(--green); background: rgba(22,163,74,.13); }
.badge--muted { color: var(--muted); background: rgba(107,108,120,.12); }
.badge--coral { color: var(--coral); background: rgba(255,86,87,.13); }

.chip {
  font-size: 12.5px; font-weight: 700;
  padding: 9px 15px; border-radius: 24px;
  border: 1.4px solid var(--border); background: var(--card); color: var(--ink);
  transition: all .12s ease;
}
.chip.is-on { background: var(--coral); color: #fff; border-color: var(--coral); }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700;
  background: rgba(255,86,87,.12); color: var(--coral);
}

/* ---------- Formulaires ---------- */
.field-label { display: block; font-weight: 700; font-size: 13px; margin: 16px 0 7px; }
.field {
  width: 100%; font-family: inherit; font-size: 14px;
  padding: 12px 14px; border: 1.4px solid var(--border);
  border-radius: 12px; background: #fff; color: var(--ink);
  resize: vertical;
}
.field:focus { outline: none; border-color: var(--coral); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.formcard {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; max-width: 640px;
}
.note { font-size: 13px; margin-top: 12px; }
.note--ok { color: var(--green); font-weight: 700; }
.note--err { color: var(--coral-dark); font-weight: 700; }
.note--info { color: var(--muted); }

/* ---------- Choix sélectionnables (sondage / vote) ---------- */
.choice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin-bottom: 10px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 14px; width: 100%; text-align: left;
  transition: border-color .12s ease;
}
.choice:hover { border-color: var(--coral-light); }
.choice.is-on { border-color: var(--coral); border-width: 1.8px; }
.choice__txt { flex: 1; font-size: 14px; font-weight: 600; }
.choice .material-symbols-outlined { color: var(--muted); }
.choice.is-on .material-symbols-outlined { color: var(--coral); }

/* ---------- Barres de résultat ---------- */
.result { margin-bottom: 12px; }
.result__head {
  display: flex; justify-content: space-between;
  font-size: 13.5px; font-weight: 700; margin-bottom: 7px;
}
.result__pct { color: var(--coral); font-weight: 800; }
.bar {
  height: 9px; border-radius: 8px; background: var(--bg); overflow: hidden;
}
.bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--coral-light), var(--coral-dark));
}

/* ---------- Galerie médias ---------- */
.media-tile {
  aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: #e6e6ea; position: relative; cursor: pointer;
}
.media-tile img { width: 100%; height: 100%; object-fit: cover; }
.media-tile__video {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #2a2b33, var(--ink));
  display: flex; align-items: center; justify-content: center;
}
.media-tile__video .material-symbols-outlined { color: #fff; font-size: 40px; }

/* ---------- Visionneuse plein écran ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
}
.viewer img, .viewer video { max-width: 92%; max-height: 88%; border-radius: 10px; }
.viewer__close {
  position: absolute; top: 20px; right: 24px;
  color: #fff; background: rgba(255,255,255,.15);
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Calendrier (agenda) ---------- */
.calendar {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; max-width: 460px;
}
.calendar__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.calendar__title { font-weight: 800; font-size: 15px; text-transform: capitalize; }
.calendar__nav {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--coral);
}
.calendar__nav:hover { background: var(--bg); }
.calendar__grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}
.calendar__dow {
  text-align: center; font-size: 10.5px; font-weight: 700;
  color: var(--muted); padding: 4px 0;
}
.calendar__day {
  aspect-ratio: 1; border-radius: 9px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; position: relative;
}
.calendar__day:hover { background: var(--bg); }
.calendar__day.is-empty { visibility: hidden; }
.calendar__day.is-today { color: var(--coral); font-weight: 800; }
.calendar__day.is-selected { background: var(--coral); color: #fff; }
.calendar__day.has-event::after {
  content: ''; position: absolute; bottom: 5px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--coral-dark);
}
.calendar__day.is-selected.has-event::after { background: #fff; }

/* ---------- Profil ---------- */
.avatar {
  width: 62px; height: 62px; border-radius: 20px; flex: none;
  background: linear-gradient(135deg, var(--coral-light), var(--coral-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 21px; font-weight: 800;
}
.optiontile {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 14px;
  padding: 14px; margin-bottom: 10px; width: 100%; text-align: left;
}
.optiontile__ic {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: rgba(255, 86, 87, 0.12);
  display: flex; align-items: center; justify-content: center;
}
.optiontile__ic .material-symbols-outlined { color: var(--coral); font-size: 19px; }

/* =========================================================
   RESPONSIVE — bascule mobile
   ========================================================= */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; z-index: 45; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  .sidebar.is-open { transform: translateX(0); }
  .topbar__menu { display: flex; }
  .mobilenav { display: flex; }
  .scrim.is-open { display: block; }
  .view { padding: 20px 16px 96px; }
  .detail__media { height: 210px; }
  .detail__title { font-size: 22px; }
  .field-row { grid-template-columns: 1fr; }
  .page-title { font-size: 22px; }
  .hero strong { font-size: 22px; }
  .formcard { padding: 20px; }
}
