/* TrouveTaTeam — styles communs. Les pages ajoutent leur CSS dans assets/<page>.css */
:root {
  --brand: #ff5a36;
  --brand-2: #ff8a3d;
  --brand-dark: #e2431f;
  --brand-soft: #fff0ea;
  --brand-grad: linear-gradient(135deg, #ff5a36 0%, #ff8a3d 100%);
  --violet: #6c5ce7;
  --violet-soft: #f0eeff;
  --ink: #141729;
  --ink-2: #4b5068;
  --ink-3: #8b90a7;
  --line: #ebe7e2;
  --bg: #fbf8f5;
  --bg-2: #f4efea;
  --surface: #ffffff;
  --ok: #12a372;
  --ok-soft: #e3f7ef;
  --warn: #e8a317;
  --danger: #d93b3b;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 23, 41, .05);
  --shadow: 0 1px 2px rgba(20, 23, 41, .04), 0 6px 20px -6px rgba(20, 23, 41, .10);
  --shadow-lg: 0 20px 50px -12px rgba(20, 23, 41, .25);
  --shadow-brand: 0 10px 24px -8px rgba(255, 90, 54, .55);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(255, 138, 61, .10), transparent 60%),
    radial-gradient(700px 380px at -10% 0%, rgba(108, 92, 231, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 84px; /* place pour la barre mobile */
}
@media (min-width: 760px) { body { padding-bottom: 0; } }
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 800; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: 3px solid rgba(255, 90, 54, .45); outline-offset: 2px; border-radius: 8px; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 760px) { .container { padding: 0 24px; } }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.text-grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 245, .78);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid rgba(20, 23, 41, .06);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 66px; }
.logo {
  display: inline-flex; align-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
  text-decoration: none; letter-spacing: -.03em;
}
.logo::before {
  content: ""; width: 32px; height: 32px; border-radius: 10px; flex: none; margin-right: 10px;
  background:
    radial-gradient(circle at 35% 38%, #fff 0 4px, transparent 5px),
    radial-gradient(circle at 65% 38%, #fff 0 4px, transparent 5px),
    radial-gradient(ellipse 9px 5px at 50% 68%, #fff 0 99%, transparent 100%),
    var(--brand-grad);
  box-shadow: var(--shadow-brand);
  transform: rotate(-8deg);
}
.logo span { color: var(--brand); }
.nav { display: none; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  text-decoration: none; padding: 9px 16px; border-radius: 999px; font-weight: 600;
  color: var(--ink-2); transition: background .2s var(--ease), color .2s;
}
.nav a:hover { background: rgba(20, 23, 41, .05); color: var(--ink); }
.nav a.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.nav a[href="/creer"] { background: var(--ink); color: #fff; margin-left: 6px; }
.nav a[href="/creer"]:hover { background: #262a44; }
.nav a[href="/creer"]::before { content: "＋ "; }
.header-user { margin-left: auto; font-weight: 600; font-size: .9rem; }
.header-user a {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px;
  border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 760px) {
  .nav { display: flex; }
  .header-user { margin-left: 8px; }
}

/* Barre de navigation mobile */
.tabbar {
  position: fixed; bottom: 10px; left: 12px; right: 12px; z-index: 50;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(20, 23, 41, .06); border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 8px 0 calc(6px + env(safe-area-inset-bottom) / 2);
}
.tabbar a { text-align: center; text-decoration: none; font-size: .72rem; font-weight: 700; color: var(--ink-3); padding: 2px; transition: color .2s; }
.tabbar a .ico { display: block; font-size: 1.25rem; line-height: 1.5; }
.tabbar a.active { color: var(--ink); }
.tabbar a.active:not(.create) .ico { transform: translateY(-1px); filter: drop-shadow(0 4px 6px rgba(255, 90, 54, .35)); }
.tabbar a.create .ico {
  width: 50px; height: 50px; margin: -26px auto 2px; border-radius: 18px;
  background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-size: 1.5rem;
  box-shadow: var(--shadow-brand); border: 4px solid var(--bg); transform: rotate(-6deg);
}
.tabbar a.create.active { color: var(--brand); }
@media (min-width: 760px) { .tabbar { display: none; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; padding: 10px 18px; border-radius: 999px;
  cursor: pointer; text-decoration: none; min-height: 44px; box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { background: var(--bg); border-color: #ddd6cf; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-grad); filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 14px 28px -8px rgba(255, 90, 54, .6); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 10px 22px -10px rgba(18, 163, 114, .7); }
.btn-ok:hover { background: #0f9165; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(20, 23, 41, .05); border-color: transparent; }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; min-height: 54px; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 13px; min-height: 34px; font-size: .85rem; }

/* ---------- Formulaires ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; font: inherit; color: var(--ink);
  padding: 12px 15px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: #a9adbf; }
.input:hover { border-color: #dcd5ce; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 90, 54, .14); }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }

/* ---------- Cartes, puces, badges ---------- */
.card {
  background: var(--surface); border: 1px solid rgba(20, 23, 41, .06);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; white-space: nowrap;
  color: var(--ink-2); box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: #d9d1c9; color: var(--ink); transform: translateY(-1px); }
.chip[aria-pressed="true"], .chip.active {
  background: var(--ink); border-color: var(--ink); color: #fff;
  box-shadow: 0 8px 18px -8px rgba(20, 23, 41, .6);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700;
  background: var(--bg-2); color: var(--ink-2);
}
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-dark { background: var(--ink); color: #fff; }

/* Carte de sortie (utilisée sur plusieurs pages via TTT.sortieCard). --tc = couleur du thème */
.sortie-card {
  --tc: var(--brand);
  position: relative; display: flex; gap: 14px; padding: 14px; text-decoration: none; overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.sortie-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tc); opacity: .85;
}
.sortie-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--tc) 30%, transparent); }
.sortie-card .emoji {
  flex: none; width: 64px; height: 64px; border-radius: 18px;
  background: color-mix(in srgb, var(--tc) 14%, #fff);
  display: grid; place-items: center; font-size: 2rem;
  transition: transform .3s var(--ease);
}
.sortie-card:hover .emoji { transform: rotate(-6deg) scale(1.06); }
.sortie-card .body { min-width: 0; flex: 1; }
.sortie-card .when {
  display: inline-block; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: color-mix(in srgb, var(--tc) 80%, #000); margin-bottom: 2px;
}
.sortie-card .title { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; line-height: 1.2; margin: 0 0 4px; letter-spacing: -.01em; }
.sortie-card .meta { font-size: .86rem; color: var(--ink-2); }
.sortie-card .people { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: .84rem; color: var(--ink-3); }
.sortie-card .faces { display: flex; }
.sortie-card .faces i {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; margin-left: -6px;
  display: grid; place-items: center; font-style: normal; font-size: .6rem; font-weight: 800; color: #fff;
}
.sortie-card .faces i:first-child { margin-left: 0; }
.sortie-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sortie-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .sortie-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1040px) { .sortie-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) {
  .sortie-card { flex-direction: column; padding: 18px; }
  .sortie-card .emoji { width: 100%; height: 96px; border-radius: 14px; font-size: 2.8rem;
    background: radial-gradient(120px 80px at 80% 20%, color-mix(in srgb, var(--tc) 28%, transparent), transparent),
                color-mix(in srgb, var(--tc) 12%, #fff); }
}

/* Apparition douce des listes */
@keyframes ttt-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sortie-grid > * { animation: ttt-rise .4s var(--ease) both; }
.sortie-grid > *:nth-child(2) { animation-delay: .04s; }
.sortie-grid > *:nth-child(3) { animation-delay: .08s; }
.sortie-grid > *:nth-child(4) { animation-delay: .12s; }
.sortie-grid > *:nth-child(n+5) { animation-delay: .16s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Modale & toast ---------- */
@keyframes ttt-fade { from { opacity: 0; } }
@keyframes ttt-up { from { transform: translateY(24px); opacity: 0; } }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 23, 41, .45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: end center; animation: ttt-fade .2s;
}
@media (min-width: 760px) { .modal-backdrop { place-items: center; } }
.modal {
  position: relative; background: var(--surface); width: 100%; max-width: 440px; max-height: 92vh; overflow: auto;
  border-radius: 28px 28px 0 0; padding: 28px 24px 24px; box-shadow: var(--shadow-lg);
  animation: ttt-up .3s var(--ease);
}
.modal::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--brand-grad); }
@media (min-width: 760px) { .modal { border-radius: 28px; padding: 32px; } }
.modal h2 { font-size: 1.5rem; }
.modal .close {
  float: right; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg-2);
  font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink-2); margin: -8px -6px 0 8px;
}
.modal .close:hover { background: var(--line); }
.toast {
  position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); z-index: 200;
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 999px;
  font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px);
  animation: ttt-up .3s var(--ease);
}
@media (min-width: 760px) { .toast { bottom: 32px; } }

.section { padding: 28px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title h2 { font-size: 1.45rem; margin: 0; }
.empty { text-align: center; padding: 44px 16px; color: var(--ink-3); }
.site-footer { padding: 32px 0; color: var(--ink-3); font-size: .85rem; text-align: center; }

/* Sur mobile, l'en-tête n'affiche que l'avatar de l'utilisateur */
@media (max-width: 520px) {
  .header-user a { padding: 4px; max-width: none; }
  .header-user .hu-name { display: none; }
}

/* ---------- Chargement (données serveur) ---------- */
@keyframes ttt-load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
body.ttt-loading::before {
  content: ""; position: fixed; top: 0; left: 0; z-index: 300; width: 40%; height: 3px;
  background: var(--brand-grad); border-radius: 0 3px 3px 0; animation: ttt-load 1.1s var(--ease) infinite;
}
@keyframes ttt-pulse { 50% { opacity: .55; } }
.skeleton { min-height: 118px; background: linear-gradient(90deg, var(--surface), var(--bg-2), var(--surface)); animation: ttt-pulse 1.4s ease-in-out infinite; }
.ttt-wait { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--ink-3); font-weight: 600; }
.ttt-wait::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: ttt-spin-g .8s linear infinite; }
@keyframes ttt-spin-g { to { transform: rotate(360deg); } }
.btn[aria-busy="true"] { cursor: progress; }

/* ---------- Modale d'inscription / connexion ---------- */
.ttt-err { color: var(--danger); font-size: .85rem; font-weight: 600; margin: -8px 0 14px; }
.ttt-err:empty { display: none; }
.ttt-alert {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: #fff1ee; color: #8f2a14;
  font-size: .9rem; font-weight: 600; line-height: 1.45;
}
.ttt-alert[hidden] { display: none; }
.ttt-alert .btn { display: flex; margin-top: 10px; }
.ttt-switch { text-align: center; margin: 14px 0 0; }
.ttt-link { background: none; border: 0; padding: 4px; font: inherit; font-size: .9rem; font-weight: 700; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ttt-link:hover { color: var(--ink); }
.ttt-sent { text-align: center; }
.ttt-sent-ico { font-size: 2.6rem; line-height: 1; margin: 6px 0 4px; }
