/* Pages web publiques Stature — charte graphique reprise de Assets/UI/Theme/variables.uss */

:root {
  --brand-green: rgb(0, 143, 31);
  --bg-app: rgb(248, 248, 248);
  --bg-panel: rgb(255, 255, 255);
  --text-primary: rgb(30, 30, 30);
  --text-muted: rgb(130, 130, 130);
  --border: rgb(230, 230, 230);
  --radius: 20px;
  --radius-pill: 999px;
  --admin-blue: rgb(1, 122, 255);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: 'Onest', system-ui, sans-serif;
}

a { color: inherit; }

.topbar {
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--brand-green);
  text-decoration: none;
}

/* ── Bibliothèque ─────────────────────────────────────────────────────── */

.library { max-width: 1400px; margin: 0 auto; padding: 24px; }
.library-title { font-size: 24px; font-weight: 600; margin: 0 0 20px; }
.empty-state { color: var(--text-muted); }

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.movie-card {
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-panel);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.15s ease;
}
.movie-card:hover { transform: translateY(-2px); }

.movie-thumb { aspect-ratio: 4 / 5; background: #eee; }
.movie-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.movie-thumb-fallback { width: 100%; height: 100%; background: linear-gradient(135deg, #e0e0e0, #f0f0f0); }

.movie-card-title { padding: 10px 12px; font-size: 14px; font-weight: 500; }

/* ── Fiche mouvement (style YouTube) ──────────────────────────────────── */

.move-page { max-width: 960px; margin: 0 auto; padding: 24px; }

.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.player-media { position: relative; width: 100%; height: 100%; }
.player-video, .player-gif { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.player-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: #999; font-size: 14px;
}

.player-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0));
  padding: 8px 12px 10px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.player:hover .player-overlay,
.player-overlay.player-overlay--visible { opacity: 1; }

.player-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.ctrl-btn:hover { background: rgba(255,255,255,0.15); }

.ctrl-time { color: #eee; font-size: 12px; }
.ctrl-spacer { flex: 1; }

.ctrl-speed, .ctrl-gif-toggle {
  font-size: 12px;
  font-weight: 600;
}

/* Bouton bascule vidéo/gif : en bas à droite, au-dessus du slider de progression. */
.ctrl-gif-toggle {
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
}
.ctrl-gif-toggle.active { background: var(--brand-green); }

.ctrl-progress { cursor: pointer; padding: 4px 0; }
.ctrl-progress-track {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}
.ctrl-progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--brand-green);
  border-radius: 2px;
}
.ctrl-progress-handle {
  position: absolute; top: 50%; left: 0%;
  width: 12px; height: 12px;
  background: var(--admin-blue);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.move-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: 14px 0;
}

.action-btn {
  display: inline-block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
}
.action-btn:hover { background: #f0f0f0; }
.action-btn--small { padding: 6px 14px; font-size: 12px; }

.share-popover {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.share-popover p { margin: 0 0 8px; font-size: 13px; color: var(--text-muted); }
.share-popover textarea {
  width: 100%;
  height: 60px;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  font-size: 12px;
  margin-bottom: 8px;
}

.move-info { margin-top: 8px; }
.move-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.move-subtitle { color: var(--text-muted); margin: 0 0 12px; }

.move-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Formulaire non éditable (Propriété/Valeur) — reprend exactement le panneau droit de
   MovePopupUI côté Unity (Assets/UI/Pages/MovePopupUI.uss, .popup-right/.info-cols/
   .info-col/.info-group-title/.info-row) : fond du panneau à rgb(249,249,249) (quasi
   identique à --bg-app de cette page, donc pas de carte blanche/bordure ajoutée par-dessus),
   deux colonnes de groupes, titres en gras noir 16px, lignes clé grise/valeur noire alignée
   à droite sans ligne de séparation entre elles. */
.move-form {
  background: rgb(249, 249, 249);
  border-radius: var(--radius);
  padding: 12px 28px 24px;
}

.move-form-cols {
  display: flex;
  gap: 20px;
}
.move-form-col { flex: 1 1 0; min-width: 0; }

.move-form-group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 12px;
}
.move-form-col > .move-form-group-title:first-child { margin-top: 4px; }

.move-form-list { margin-bottom: 12px; }

.move-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.move-form-prop { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.move-form-value { font-size: 12px; color: var(--text-primary); text-align: right; }
.move-form-empty { font-size: 12px; color: var(--text-muted); margin: 0; }

@media (max-width: 640px) {
  .move-form-cols { flex-direction: column; gap: 0; }
}

.not-found { max-width: 480px; margin: 80px auto; text-align: center; }

.embed-body { margin: 0; background: #000; }
.embed-body .player { border-radius: 0; aspect-ratio: auto; height: 100vh; }

/* Balises d'intégration par média isolé (move.php) — une déclinaison par bouton, cf. embed_media.php. */
.embed-media-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.embed-media-list-title { margin: 0; font-size: 13px; color: var(--text-muted); }

/* Page embed_media.php elle-même : juste le média + la mention Stature obligatoire, pas de chrome. */
.embed-media-body {
  margin: 0;
  background: #fff;
  display: flex;
}
.embed-media-body--transparent { background: transparent; }
.embed-media-wrap {
  position: relative;
  display: block;
  width: 100%;
  text-decoration: none;
}
.embed-media-img { display: block; width: 100%; height: auto; }
.embed-media-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   Pages d'authentification (login/register/verify) — carte centrée, accent BLEU
   (--admin-blue), demande explicite du client pour l'UI d'auth (cf. auth_layout.php).
   ═══════════════════════════════════════════════════════════ */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.auth-brand {
  display: inline-block;
  font-weight: 700;
  font-size: 20px;
  color: var(--admin-blue);
  text-decoration: none;
  margin-bottom: 16px;
}
.auth-title { font-size: 22px; margin: 0 0 4px; }
.auth-subtitle { font-size: 13px; color: var(--text-muted); margin: 0 0 20px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-label { font-size: 12px; color: var(--text-primary); display: flex; flex-direction: column; gap: 6px; }
.auth-input {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-panel);
  outline: none;
}
.auth-input:focus { border-color: var(--admin-blue); }
.auth-input--code { letter-spacing: 6px; font-size: 20px; text-align: center; }
.auth-submit {
  height: 44px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: var(--admin-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.auth-submit:hover { background: rgb(0, 105, 224); }
.auth-switch { font-size: 13px; color: var(--text-muted); text-align: center; margin: 16px 0 0; }
.auth-switch a { color: var(--admin-blue); text-decoration: none; }
.auth-resend-form { text-align: center; margin-top: 12px; }
.auth-link-btn {
  border: 0;
  background: none;
  color: var(--admin-blue);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.auth-banner { border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
.auth-banner--error { background: rgba(217, 45, 32, 0.1); color: rgb(180, 35, 25); }
.auth-banner--notice { background: rgba(1, 122, 255, 0.1); color: var(--admin-blue); }
.auth-banner--dev { background: rgba(1, 122, 255, 0.08); color: var(--admin-blue); border: 1px dashed var(--admin-blue); }
