/* ==========================================================================
   OmniRoute — styles
   Page de connexion : titre centré horizontalement et verticalement.
   Zone membre : tableau de bord (modèles gratuits byNara).
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  color: #1f2430;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Conteneur plein écran (page de connexion) : centrage h + v
   -------------------------------------------------------------------------- */
.screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen--gate {
  background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 55%, #dbeafe 100%);
}

.screen--member {
  background: linear-gradient(135deg, #d1fae5 0%, #ccfbf1 55%, #cffafe 100%);
}

/* --------------------------------------------------------------------------
   Carte centrale (connexion)
   -------------------------------------------------------------------------- */
.card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(31, 36, 48, 0.12);
  backdrop-filter: blur(8px);
}

.member-title {
  margin: 0;
  text-align: center;
}

.brand {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #2b2f3a;
}

.brand--member {
  color: #14532d;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
}

.subtitle {
  margin: 10px 0 28px;
  font-size: 0.95rem;
  color: #5b6172;
}

/* --------------------------------------------------------------------------
   Formulaire (connexion)
   -------------------------------------------------------------------------- */
.field {
  text-align: left;
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5b6172;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 1rem;
  color: #1f2430;
  background: #ffffff;
  border: 1px solid #d7dbe6;
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: #7c5cff;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.btn {
  height: 44px;
  padding: 0 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background: #6d4aff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.05s;
}

.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }

.btn--primary { background: #16a34a; }
.btn--ghost {
  background: rgba(255, 255, 255, 0.85);
  color: #2b2f3a;
  border: 1px solid #cbd5e1;
}
.btn--ghost:hover { background: #fff; }

/* Bouton pleine largeur sur la page de connexion uniquement */
.card .btn { width: 100%; margin-top: 6px; }

/* --------------------------------------------------------------------------
   Messages
   -------------------------------------------------------------------------- */
.alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert--ok {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.alert--err {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.logout {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 10;
  font-size: 0.82rem;
  color: #166534;
  text-decoration: none;
  opacity: 0.75;
}

.logout:hover { opacity: 1; text-decoration: underline; }

/* --------------------------------------------------------------------------
   Zone membre — tableau de bord
   -------------------------------------------------------------------------- */
body.member {
  background: linear-gradient(160deg, #ecfdf5 0%, #f0fdfa 45%, #eff6ff 100%);
  min-height: 100dvh;
}

.topbar {
  padding: 34px 24px 8px;
  text-align: center;
}

.topbar__sub {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: #4b5563;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 12px 20px 64px;
}

.panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(203, 213, 225, 0.75);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 28px rgba(31, 36, 48, 0.06);
}

.panel--note { background: rgba(255, 255, 255, 0.6); }

.panel__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel__title--sm { font-size: 0.95rem; }

.panel__desc {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: #6b7280;
}

.panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.inline { display: inline; margin: 0; }

.hint {
  margin: 0;
  font-size: 0.78rem;
  color: #6b7280;
  flex: 1 1 260px;
}

/* Statistiques */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  border: 1px solid #dbeafe;
}

.stat__n { font-size: 1.15rem; font-weight: 700; color: #14532d; }
.stat__l { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; }

/* Liste des modèles */
.models { list-style: none; margin: 0; padding: 0; }

.model {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #eef2f7;
}

.model:last-child { border-bottom: none; }

.model--narrow { opacity: 0.72; }

.model__pick { padding-top: 2px; }

.model__pick input {
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
  cursor: pointer;
}

.model__body { flex: 1; min-width: 0; }

.model__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.model__name { font-weight: 600; font-size: 0.95rem; }

.model__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  color: #6b7280;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.model__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.76rem;
  color: #6b7280;
}

.model__state { font-weight: 600; }
.model__state--on { color: #15803d; }
.model__state--off { color: #b91c1c; }

/* Étiquettes */
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.6;
}

.tag--FF { background: #dcfce7; color: #166534; }
.tag--FP { background: #e0e7ff; color: #3730a3; }
.tag--soft { background: #f1f5f9; color: #475569; font-weight: 600; }
.tag--warn { background: #fef3c7; color: #92400e; font-weight: 600; }

/* Barre d'enregistrement */
.savebar {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 0;
  background: linear-gradient(to top, rgba(236, 253, 245, 0.98) 60%, rgba(236, 253, 245, 0));
}

.empty { font-size: 0.85rem; color: #6b7280; margin: 8px 0; }

/* Étapes explicatives */
.steps {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.6;
}

.steps code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 5px;
}

/* --------------------------------------------------------------------------
   Onglets byNara / AntSeed
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.tabs a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #d7dbe6;
}

.tabs a.is-active {
  background: #14532d;
  border-color: #14532d;
  color: #fff;
}

.tabs__hint {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Offres AntSeed
   -------------------------------------------------------------------------- */
.offers { list-style: none; margin: 0; padding: 0; }

.offer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #eef2f7;
}

.offer:last-child { border-bottom: none; }

.offer--blocked { opacity: 0.66; }

.offer__pick { padding-top: 2px; }
.offer__pick input {
  width: 18px;
  height: 18px;
  accent-color: #16a34a;
  cursor: pointer;
}

.offer__body { flex: 1; min-width: 0; }

.offer__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.offer__name { font-weight: 600; font-size: 0.95rem; }

.offer__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.74rem;
  color: #6b7280;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.offer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 5px;
  font-size: 0.78rem;
  color: #4b5563;
}

.price--in b { color: #14532d; }
.price--out b { color: #3730a3; }

.seller { font-weight: 600; color: #1f2937; }

.rep { color: #6b7280; }
.rep--low { color: #b45309; }

.caps { color: #9ca3af; font-size: 0.72rem; }

.offer__blocked {
  margin-top: 5px;
  font-size: 0.74rem;
  color: #92400e;
  background: #fef3c7;
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-block;
}

.tag--free { background: #dcfce7; color: #166534; }

@media (max-width: 560px) {
  .savebar { justify-content: stretch; }
  .savebar .btn { flex: 1 1 100%; }
}

/* --------------------------------------------------------------------------
   Nouveaux modèles : badge + filtre
   -------------------------------------------------------------------------- */
.tag--new {
  background: #fde68a;
  color: #78350f;
  border: 1px solid #fcd34d;
  animation: newPulse 2.4s ease-in-out 2;
}

/* Une fois vu pendant cette visite : le badge reste (trace de ce qui était
   nouveau), mais s'éteint — le prochain chargement ne le réaffichera pas. */
.tag--new-seen {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
  animation: none;
}

@keyframes newPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(252, 211, 77, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(252, 211, 77, 0.45); }
}

.filter-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.filter-new input {
  width: 16px;
  height: 16px;
  accent-color: #d97706;
  cursor: pointer;
}

.filter-new__count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  line-height: 1.7;
  text-align: center;
  color: #78350f;
  background: #fde68a;
}

/* Une ligne vue pendant la visite : léger retrait visuel, sans disparaître. */
[data-new="1"].is-seen { opacity: 0.72; }

/* Compteur à zéro : plus rien à lire dans la sélection courante. */
.filter-new__count--done {
  background: #dcfce7;
  color: #166534;
}
