/* ==========================================================================
   NATTY ELECTRONICS — Design system (bleu & blanc)
   Palette alignée sur le logo : bleu marine, bleu acier, blanc, cuivre (accent)
   ========================================================================== */
:root {
  --natty-navy:    #133b66;   /* bleu marine profond (titres, navbar texte) */
  --natty-blue:    #1d5fa0;   /* bleu principal (boutons, liens) */
  --natty-blue-600:#19527f;   /* hover */
  --natty-sky:     #eaf2fb;   /* surface bleu très clair */
  --natty-slate:   #323b42;   /* texte logo */
  --natty-copper:  #b06a35;   /* accent cuivre (rare) */
  --natty-copper-dark: #8a5226;
  --natty-copper-bg:   #faf1e9;
  --natty-gold:    #fbbf24;   /* accent doré (inspiré FiscaliSource) */
  --natty-gold-600:#f0ad1f;
  --natty-line:    #e2e8f0;

  /* On aligne le "primary" de Bootstrap sur le bleu Natty */
  --bs-primary: var(--natty-blue);
  --bs-primary-rgb: 29, 95, 160;
  --bs-link-color: var(--natty-blue);
  --bs-link-hover-color: var(--natty-blue-600);
  --bs-body-color: #2b3440;
  --bs-border-radius: .6rem;   /* coins plus arrondis (boutons, champs) */
}

body {
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #fff;
}
h1, h2, h3, .navbar-brand, .section-title { letter-spacing: -.01em; }

/* ----- Navbar (bleu marine, assortie au logo) ------------------------------ */
:root { --natty-navbar-bg: #1e2d4a; --natty-accent-light: #6aa9e0; }

.navbar.natty-nav {
  background: var(--natty-navbar-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.natty-nav .navbar-brand img { height: 60px; width: auto; }
.natty-nav .nav-link {
  color: rgba(255, 255, 255, .85);
  font-weight: 500;
}
.natty-nav .nav-link:hover { color: #fff; }
.natty-nav .navbar-toggler {
  border-color: rgba(255, 255, 255, .35);
}

/* Bloc identité : nom + rôle (couleur distincte par rôle) */
.natty-nav .user-id-block .user-name { color: #fff; font-weight: 500; }
.natty-nav .user-id-block .user-role {
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
}
.natty-nav .user-role.role-buyer  { color: #7fc4f0; }  /* Acheteur — bleu clair */
.natty-nav .user-role.role-seller { color: #e0a96d; }  /* Vendeur — cuivre clair */
.natty-nav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.85%29' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Entrée de menu active (page courante) mise en surbrillance */
.natty-nav .navbar-nav > .nav-item > .nav-link.active {
  color: #fff;
  font-weight: 600;
  position: relative;
}
.natty-nav .navbar-nav > .nav-item > .nav-link.active::after {
  content: "";
  position: absolute;
  left: .8rem; right: .8rem; bottom: .15rem;
  height: 3px; border-radius: 3px;
  background: var(--natty-accent-light);
}
/* En vue mobile (menu déroulé), on surligne par un fond plutôt qu'un soulignement */
@media (max-width: 991.98px) {
  .natty-nav .navbar-nav > .nav-item > .nav-link.active {
    background: rgba(255, 255, 255, .12);
    border-radius: 8px;
  }
  .natty-nav .navbar-nav > .nav-item > .nav-link.active::after { display: none; }
}

/* ----- Boutons ------------------------------------------------------------- */
.btn-primary {
  --bs-btn-bg: var(--natty-blue);
  --bs-btn-border-color: var(--natty-blue);
  --bs-btn-hover-bg: var(--natty-blue-600);
  --bs-btn-hover-border-color: var(--natty-blue-600);
  --bs-btn-active-bg: var(--natty-navy);
  --bs-btn-active-border-color: var(--natty-navy);
}
.btn-outline-primary {
  --bs-btn-color: var(--natty-blue);
  --bs-btn-border-color: var(--natty-blue);
  --bs-btn-hover-bg: var(--natty-blue);
  --bs-btn-hover-border-color: var(--natty-blue);
}
.btn-light-on-dark {
  background: #fff; color: var(--natty-navy); font-weight: 600; border: none;
}
.btn-light-on-dark:hover { background: var(--natty-sky); color: var(--natty-navy); }

/* Bouton doré (accent inspiré FiscaliSource) */
.btn-gold {
  background: var(--natty-gold); color: var(--natty-navy);
  font-weight: 700; border: none;
}
.btn-gold:hover { background: var(--natty-gold-600); color: var(--natty-navy); }

.text-navy { color: var(--natty-navy) !important; }
.text-gold { color: var(--natty-gold) !important; }
.bg-navy { background-color: var(--natty-navy) !important; }
.bg-blue { background-color: var(--natty-blue) !important; }
.bg-sky { background: var(--natty-sky) !important; }

/* Bouton pilule Forum (style avec anneau blanc lumineux) */
.btn-forum-pill {
  background-color: #0d6efd;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50rem;
  padding: 0.4rem 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45), 0 4px 12px rgba(13, 110, 253, 0.35);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.btn-forum-pill:hover {
  background-color: #0b5ed7;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.75), 0 6px 16px rgba(13, 110, 253, 0.45);
}

/* Bouton « Nos formations » : même pilule que le Forum, avec un halo doré
   pulsé pour attirer l'œil sans introduire une autre forme de bouton.
   Le halo est une ombre animée : il ne modifie ni la taille ni la position du
   bouton, donc rien ne bouge autour de lui. */
.btn-training-pill {
  background-color: var(--natty-gold, #f0a500);
  color: #1b2733 !important;
  position: relative;
  animation: training-halo 2.4s ease-in-out infinite;
}
.btn-training-pill:hover {
  background-color: #ffb519;
  color: #1b2733 !important;
  animation-play-state: paused;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .8), 0 0 22px 6px rgba(240, 165, 0, .75);
}
@keyframes training-halo {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 255, 255, .45), 0 0 10px 2px rgba(240, 165, 0, .45); }
  50%      { box-shadow: 0 0 0 3px rgba(255, 255, 255, .70), 0 0 24px 8px rgba(240, 165, 0, .85); }
}
/* Respect du réglage système « animations réduites » */
@media (prefers-reduced-motion: reduce) {
  .btn-training-pill { animation: none; box-shadow: 0 0 0 3px rgba(255,255,255,.6), 0 0 18px 5px rgba(240,165,0,.7); }
}

/* ----- Formations ---------------------------------------------------------- */
.natty-hero--training {
  background: linear-gradient(135deg, var(--natty-navy) 0%, #7a4b00 100%);
}
.training-card { transition: transform .15s ease, box-shadow .15s ease; }
.training-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(19, 59, 102, .18); }
.training-card-placeholder {
  height: 170px;
  background: linear-gradient(135deg, var(--natty-navy) 0%, var(--natty-blue) 100%);
  color: rgba(255, 255, 255, .85);
  font-size: 2.5rem;
}
/* Contenu rédigé dans le back-office (mini-syntaxe) */
.rich-content h3.rich-h { font-size: 1.05rem; font-weight: 700; color: var(--natty-navy); margin: 1rem 0 .35rem; }
.rich-content p { margin-bottom: .75rem; }
.rich-content ul, .rich-content ol { margin-bottom: .75rem; padding-left: 1.4rem; }
.rich-content li { margin-bottom: .25rem; }
.training-locked {
  border: 2px dashed var(--natty-line);
  border-radius: 14px;
  background: #f7f9fc;
}

/* ----- Hero ---------------------------------------------------------------- */
.natty-hero {
  background: linear-gradient(135deg, var(--natty-navy) 0%, var(--natty-blue) 100%);
  color: #fff;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}
.natty-hero::after {           /* motif circuit discret */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.10) 0 8px, transparent 9px),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,.07) 0 6px, transparent 7px);
  pointer-events: none;
}
.natty-hero .container-fluid { position: relative; z-index: 1; }

/* Photo d'ambiance en fond du hero d'accueil : fondu vers la droite,
   le dégradé navy reste dominant côté texte. */
.natty-hero--photo {
  /* voile clair sur l'extrémité droite : atténue le bleu sous la photo */
  background-image:
    linear-gradient(to left, rgba(255,255,255,.30) 0%, rgba(255,255,255,.12) 34%, rgba(255,255,255,0) 64%),
    linear-gradient(135deg, var(--natty-navy) 0%, var(--natty-blue) 100%);
}
.natty-hero--photo::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("../img/fond.jpg");
  background-size: cover;
  background-position: center 35%;
  background-repeat: no-repeat;
  opacity: .55;
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,.80) 38%, rgba(0,0,0,0) 78%);
          mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,.80) 38%, rgba(0,0,0,0) 78%);
  pointer-events: none;
}
@media (max-width: 767.98px) {
  /* Sur mobile le texte occupe toute la largeur : on adoucit encore la photo */
  .natty-hero--photo::before {
    opacity: .18;
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
            mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
  }
}

/* Barre de recherche en pilule dans le hero (style FiscaliSource) */
.hero-search {
  background: #fff;
  border-radius: 9999px;
  padding: .35rem .35rem .35rem 1.25rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
  max-width: 640px;
}
.hero-search input {
  border: none; outline: none; box-shadow: none;
  background: transparent; flex: 1; min-width: 0;
  color: var(--natty-navy); font-size: 1rem;
}
.hero-search input::placeholder { color: #9aa6b2; }
.hero-search .btn {
  border-radius: 9999px; padding-left: 1.4rem; padding-right: 1.4rem;
  background: var(--natty-navy); border: none; color: #fff; font-weight: 600;
}
.hero-search .btn:hover { background: var(--natty-blue-600); }

/* ----- Onglets d'authentification (actif rempli = forte distinction) ------- */
.auth-tabs { border-bottom: none; gap: .35rem; }
.auth-tabs .nav-link {
  font-weight: 700;
  color: #64707c;
  background: #eef1f5;
  border: 1px solid var(--natty-line);
  border-radius: .6rem .6rem 0 0;
  transition: background .12s ease, color .12s ease;
}
.auth-tabs .nav-link:hover { color: var(--natty-navy); background: #e6eaf0; }

/* Acheteur = bleu plein (valeurs hex littérales pour une cascade fiable) */
.auth-tabs .nav-link.tab-tint-blue.active {
  color: #fff;
  background: #1d5fa0;
  border-color: #1d5fa0;
  box-shadow: 0 4px 12px rgba(29, 95, 160, .35);
}
/* Vendeur = cuivre plein */
.auth-tabs .nav-link.tab-tint-copper.active {
  color: #fff;
  background: #b06a35;
  border-color: #b06a35;
  box-shadow: 0 4px 12px rgba(176, 106, 53, .35);
}
/* Bandeau de contenu accordé à l'onglet actif */
.auth-tabs + .card .card-body,
.auth-tabs + .tab-content { transition: background .15s ease; }

/* ----- Segments Acheteur / Vendeur (forte distinction) -------------------- */
.acct-segments {
  display: flex;
  gap: .6rem;
}
.acct-seg {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .85rem .5rem;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  cursor: pointer;
  border: 2px solid #cfd6de;
  border-radius: .7rem;
  background: #f3f5f8;
  color: #5b6671;
  transition: background .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.acct-seg:hover { border-color: #aab4bf; color: var(--natty-navy); }

/* Acheteur sélectionné = bleu nuit plein */
.btn-check:checked + .acct-buyer {
  background: #143a63;
  border-color: #143a63;
  color: #fff;
  box-shadow: 0 6px 16px rgba(20, 58, 99, .4);
}
/* Vendeur sélectionné = cuivre foncé plein */
.btn-check:checked + .acct-seller {
  background: #7a4420;
  border-color: #7a4420;
  color: #fff;
  box-shadow: 0 6px 16px rgba(122, 68, 32, .4);
}
.btn-check:focus-visible + .acct-seg { outline: 2px solid var(--natty-blue-600); outline-offset: 2px; }

/* ----- Cartes -------------------------------------------------------------- */
.card { border: 1px solid var(--natty-line); border-radius: 12px; }
.category-card {
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--natty-blue);
  box-shadow: 0 8px 20px rgba(19, 59, 102, .12);
}
.category-card .cat-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--natty-sky); color: var(--natty-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin: 0 auto .6rem;
}
.product-card:hover { box-shadow: 0 6px 18px rgba(19, 59, 102, .10); }
.price-tag { color: var(--natty-blue); font-weight: 700; }

/* ----- Tuiles de catégories (bleu dégradé, texte & icônes blancs) ---------- */
.cat-tile {
  display: block;
  background: linear-gradient(135deg, var(--natty-navy) 0%, var(--natty-blue) 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 1.4rem 1rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cat-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(19, 59, 102, .30);
  color: #fff;
}
.cat-tile-icon {
  width: 58px; height: 58px; border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; margin: 0 auto .7rem;
}
.cat-tile-title { color: #fff; font-weight: 600; }

/* ----- Pastille d'icône blanche réutilisable (style catégories accueil) ---- */
.natty-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .7rem;
  background: linear-gradient(135deg, var(--natty-navy) 0%, var(--natty-blue) 100%);
  color: #fff;
  font-size: 1.5rem; line-height: 1;
  box-shadow: 0 6px 16px rgba(19, 59, 102, .22);
}
.natty-icon i { color: #fff; }
.natty-icon-sm { width: 40px; height: 40px; font-size: 1.1rem; margin-bottom: 0; }
/* Variante cuivre (vendeur / accents) */
.natty-icon-copper {
  background: linear-gradient(135deg, #7a4420 0%, var(--natty-copper) 100%);
  box-shadow: 0 6px 16px rgba(122, 68, 32, .22);
}

/* ----- Galerie d'images produit (miniatures) ------------------------------ */
.gallery-thumb {
  border: 2px solid var(--natty-line);
  opacity: .7;
  transition: opacity .12s ease, border-color .12s ease;
}
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: var(--natty-blue); opacity: 1; }

/* ----- Menu latéral des catégories (catalogue) ---------------------------- */
.cat-filter {
  border: 1px solid var(--natty-line);
  border-radius: var(--bs-border-radius);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(19, 59, 102, .06);
}
.cat-filter .list-group-item {
  border: 0;
  border-bottom: 1px solid var(--natty-line);
  border-radius: 0;
  background: #fff;
  color: var(--natty-navy);
  font-weight: 500;
  display: flex; align-items: center; gap: .65rem;
  padding: .72rem .9rem;
  transition: background .12s ease, color .12s ease;
}
.cat-filter .list-group-item:last-child { border-bottom: 0; }
.cat-filter .list-group-item .bi {
  color: var(--natty-blue);
  font-size: 1.05rem;
  width: 1.25rem; text-align: center;
  transition: color .12s ease;
}
.cat-filter .list-group-item:hover { background: var(--natty-sky); color: var(--natty-navy); }
.cat-filter .list-group-item:focus-visible {
  z-index: 2; outline: 2px solid var(--natty-blue); outline-offset: -2px;
}
.cat-filter .list-group-item.active {
  background: linear-gradient(135deg, var(--natty-navy) 0%, var(--natty-blue) 100%);
  border-color: transparent;
  color: #fff;
}
.cat-filter .list-group-item.active .bi { color: #fff; }

/* ----- Liens / divers ------------------------------------------------------ */
a { color: var(--natty-blue); }
a:hover { color: var(--natty-blue-600); }
.section-title {
  color: var(--natty-navy); font-weight: 700;
  border-left: 4px solid var(--natty-blue); padding-left: .6rem;
}

/* ----- Pages légales (formatage limité) ------------------------------------ */
.legal-content p { margin-bottom: .9rem; line-height: 1.6; }
.legal-content .legal-lg {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--natty-navy);
  display: inline-block;
  margin: .3rem 0;
}

/* ----- Pastille d'aide « ? » + infobulle ----------------------------------- */
.info-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--natty-sky);
  color: var(--natty-blue);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  transition: background .15s ease, color .15s ease;
}
.info-hint:hover,
.info-hint:focus-visible {
  background: var(--natty-blue);
  color: #fff;
  outline: none;
}

/* ----- Footer (dégradé bleu, style FiscaliSource) -------------------------- */
.natty-footer {
  background: linear-gradient(120deg, var(--natty-navy) 0%, var(--natty-blue) 100%);
  color: #dce6f2;
}
.natty-footer a { color: #fff; text-decoration: none; }
.natty-footer a:hover { color: var(--natty-sky); text-decoration: underline; }
