/* app/assets/stylesheets/application.css — base de l'application (les domaines auront leur propre fichier) */

:root {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-border: #334155;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-primary: #3b82f6;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
}

.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }

/* Layout */
.app-main {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
  min-height: 100dvh;
}

/* Navigation basse */
.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  z-index: 100;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  transition: color 0.15s;

  &.bottom-nav__item--active { color: var(--color-primary); }
  &.bottom-nav__item--disabled { opacity: 0.4; cursor: not-allowed; }
}

.bottom-nav__icon { width: 1.5rem; height: 1.5rem; }

/* Hors ligne : bannière + désactivation des actions réseau */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--color-warning);
  color: #1c1917;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;

  &[hidden] { display: none; }
}

html.offline [data-requires-network] {
  pointer-events: none;
  opacity: 0.5;
}

/* Flash */
.flash { padding: 0.75rem 1rem; font-size: 0.9rem; }
.flash--alert { background: #7f1d1d; color: #fca5a5; }
.flash--notice { background: #14532d; color: #bbf7d0; }

/* Auth */
.auth-container { max-width: 400px; margin: 4rem auto; padding: 2rem; }
.auth-container h1 { margin-bottom: 2rem; text-align: center; }
.auth-links { margin-top: 1rem; text-align: center; font-size: 0.875rem; }
.auth-links a { color: var(--color-text-muted); }
.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; color: var(--color-text-muted); }
.field input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 1rem;
}

/* Profils */
.profiles-container { max-width: 500px; margin: 3rem auto; padding: 1.5rem; text-align: center; }
.profiles-container h1 { margin-bottom: 2rem; }
.profiles-list { list-style: none; display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; margin-bottom: 2rem; }
.profile-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  font: inherit;
}
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}
.profile-name { font-size: 0.875rem; }

/* Boutons */
.btn { padding: 0.625rem 1.25rem; border-radius: 6px; border: none; cursor: pointer; font-size: 1rem; }
.btn--primary { background: var(--color-primary); color: white; width: 100%; }
.btn--link { background: none; color: var(--color-text-muted); text-decoration: underline; }

/* Dashboard */
.dashboard { padding: 1.5rem; }
.dashboard__header { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 2rem; }
.dashboard__title { font-size: 1.5rem; font-weight: 700; }
.dashboard__date { color: var(--color-text-muted); font-size: 0.875rem; }
.dashboard__member { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.dashboard__switch { margin-left: auto; font-size: 0.8rem; color: var(--color-text-muted); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
}
.dashboard__section { margin-bottom: 2rem; }
.dashboard__section h2 {
  font-size: 1rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.placeholder { color: var(--color-text-muted); font-style: italic; font-size: 0.875rem; }

/* Réglages */
.settings { padding: 1.5rem; max-width: 560px; }
.settings h1 { font-size: 1.25rem; margin-bottom: 1.5rem; }
.settings-menu, .members-list, .taken-colors { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.settings-menu a { color: var(--color-text); }
.members-list li { display: flex; align-items: center; gap: 0.75rem; }
.members-list a { margin-left: auto; color: var(--color-primary); }
.badge { font-size: 0.75rem; color: var(--color-text-muted); border: 1px solid var(--color-border); border-radius: 999px; padding: 0 0.5rem; }
.field select { width: 100%; padding: 0.625rem 0.75rem; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: 6px; }
.field input[type="color"] { width: 4rem; height: 2.5rem; padding: 0.125rem; }
.field-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.taken-colors { flex-direction: row; flex-wrap: wrap; margin-top: 0.5rem; font-size: 0.8rem; }
.taken-colors li { display: flex; align-items: center; gap: 0.375rem; }
.swatch { width: 1rem; height: 1rem; border-radius: 50%; display: inline-block; }
.form-errors { background: #7f1d1d; color: #fca5a5; padding: 0.75rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.875rem; }
