/* =====================================================================
   Cuisine à ma Façon !  —  style.css
   Charte reprise des maquettes : orange chaleureux, rouge logo,
   cartes blanches arrondies, navigation flottante en bas.
   ===================================================================== */

:root{
  --orange:      #EF6C1B;
  --orange-d:    #DE5C0C;
  --orange-clair:#FCEEE0;
  --rouge:       #E63329;
  --vert:        #43A047;
  --vert-clair:  #E4F2E4;
  --rose-clair:  #FCE3E3;
  --jaune-clair: #FBEBD3;
  --bleu:        #1E6FE8;

  --bg:    #F5F4EF;
  --carte: #FFFFFF;
  --ink:   #1B1B1B;
  --muted: #707070;
  --line:  #ECEAE4;

  --r:     16px;   /* rayon des cartes */
  --r-s:   12px;
  --ombre: 0 2px 10px rgba(0,0,0,.05);
  --ombre-f:0 6px 22px rgba(0,0,0,.10);
  --max:   460px;  /* largeur « téléphone » sur grand écran */
}

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

html,body{
  background:var(--bg);
  color:var(--ink);
  font-family:"Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size:16px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
button{ font-family:inherit; cursor:pointer; }

/* ---- Coquille « application » centrée ---- */
.app{
  max-width:var(--max);
  margin:0 auto;
  min-height:100vh;
  background:var(--bg);
  position:relative;
  padding-bottom:96px;          /* place pour la nav flottante */
}

/* =====================================================================
   En-tête
   ===================================================================== */
.entete{
  display:grid;
  grid-template-columns:40px 1fr auto;
  align-items:center;
  gap:8px;
  padding:14px 16px 6px;
}
.entete .logo{ justify-self:center; }
.entete .logo img{ height:62px; width:auto; }
.icone-btn{
  background:none; border:none; color:var(--ink);
  width:40px; height:40px; display:flex; align-items:center; justify-content:center;
  border-radius:50%;
}
.icone-btn svg{ width:24px; height:24px; }
.entete .actions{ display:flex; gap:2px; justify-self:end; }
.point-notif{ position:relative; }
.point-notif::after{
  content:""; position:absolute; top:8px; right:9px;
  width:8px; height:8px; border-radius:50%; background:var(--orange);
}

/* =====================================================================
   Structure de page
   ===================================================================== */
.contenu{ padding:6px 16px 0; }

.titre-page{ font-size:30px; font-weight:800; letter-spacing:-.5px; }
.sous-titre{ color:var(--muted); margin-top:2px; }

.salut{ font-size:30px; font-weight:800; line-height:1.1; }
.salut .prenom{ color:var(--orange); }
.intro{ color:var(--muted); margin-top:8px; font-size:17px; }

.entete-bloc{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:12px; margin-top:6px;
}

/* =====================================================================
   Cartes & boutons génériques
   ===================================================================== */
.carte{
  background:var(--carte);
  border-radius:var(--r);
  box-shadow:var(--ombre);
}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  border:none; border-radius:var(--r-s);
  padding:16px 18px; font-size:17px; font-weight:700;
  width:100%;
}
.btn-orange{ background:var(--orange); color:#fff; box-shadow:0 6px 16px rgba(239,108,27,.30); }
.btn-orange:active{ background:var(--orange-d); }
.btn-ligne{
  background:#fff; color:var(--orange);
  border:1.5px dashed var(--orange); border-radius:var(--r-s);
}
.btn-contour{
  background:#fff; color:var(--orange);
  border:1.5px solid var(--orange); border-radius:var(--r-s);
  padding:12px 16px; font-weight:700; width:auto;
}

.pastille-plus{ font-size:22px; line-height:1; }

/* =====================================================================
   ACCUEIL — héro recette
   ===================================================================== */
.hero{
  position:relative; border-radius:var(--r); overflow:hidden;
  width:55%; aspect-ratio:1/1; box-shadow:var(--ombre);
  background:var(--orange-clair);
}
.hero img{ width:100%; height:100%; object-fit:cover; }
.hero .voile{
  position:absolute; inset:0;
  background:linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 45%);
}
.hero .titre{
  position:absolute; left:12px; bottom:30px; color:#fff;
  font-size:20px; font-weight:800; text-shadow:0 1px 6px rgba(0,0,0,.5);
}
.hero .note{
  position:absolute; left:12px; bottom:10px; color:#fff; font-weight:700;
  display:flex; align-items:center; gap:4px; font-size:15px;
}
.hero .coeur{
  position:absolute; top:10px; right:10px;
  width:34px; height:34px; border-radius:50%; background:#fff;
  display:flex; align-items:center; justify-content:center; color:var(--orange);
}

/* Menu principal (Mes recettes, Recettes du monde, …) */
.menu-liste{ display:flex; flex-direction:column; gap:14px; margin-top:22px; }
.menu-item{
  display:flex; align-items:center; gap:14px;
  background:var(--carte); border-radius:var(--r); box-shadow:var(--ombre);
  padding:18px 16px;
}
.menu-item .rond{
  width:52px; height:52px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
}
.menu-item .rond svg{ width:26px; height:26px; }
.menu-item .txt{ flex:1; }
.menu-item .txt b{ font-size:18px; }
.menu-item .txt span{ display:block; color:var(--muted); font-size:14px; }
.menu-item .fleche{ color:#c7c7c7; }
.rond.jaune{ background:var(--jaune-clair); color:var(--orange); }
.rond.orange{ background:var(--orange-clair); color:var(--orange); }
.rond.rose{ background:var(--rose-clair); color:var(--rouge); }
.rond.vert{ background:var(--vert-clair); color:var(--vert); }

.bloc-cta{ margin-top:22px; }

/* =====================================================================
   Onglets (catégories)
   ===================================================================== */
.onglets{
  display:flex; gap:8px; overflow-x:auto; padding:14px 0 4px;
  -ms-overflow-style:none; scrollbar-width:none;
}
.onglets::-webkit-scrollbar{ display:none; }
.onglet{
  white-space:nowrap; padding:10px 16px; border-radius:10px;
  background:#fff; color:var(--ink); font-weight:600; font-size:15px;
  border:1px solid var(--line);
}
.onglet.actif{ background:var(--orange); color:#fff; border-color:var(--orange); }

/* Barre de recherche */
.recherche{
  display:flex; align-items:center; gap:10px;
  background:#fff; border:1px solid var(--line); border-radius:12px;
  padding:13px 14px; color:var(--muted); margin-top:8px;
}
.recherche input{ border:none; outline:none; flex:1; font-size:15px; color:var(--ink); background:transparent; }
.barre-recherche-ligne{ display:flex; gap:10px; align-items:stretch; margin-top:8px; }
.barre-recherche-ligne .recherche{ flex:1; margin-top:0; }
.bascule-vue{ display:flex; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.bascule-vue button{ width:46px; background:#fff; border:none; color:var(--muted); display:flex; align-items:center; justify-content:center; }
.bascule-vue button.actif{ background:var(--orange); color:#fff; }

/* =====================================================================
   Liste de recettes (Mes recettes)
   ===================================================================== */
.liste-recettes{ display:flex; flex-direction:column; gap:12px; margin-top:14px; }
.recette-ligne{
  display:flex; align-items:center; gap:12px;
  background:var(--carte); border-radius:var(--r); box-shadow:var(--ombre);
  padding:10px; position:relative;
}
.recette-ligne .vignette{
  width:92px; height:80px; border-radius:12px; object-fit:cover; flex:0 0 auto;
  background:var(--orange-clair);
}
.recette-ligne .infos{ flex:1; min-width:0; }
.recette-ligne .infos h3{ font-size:18px; font-weight:700; }
.recette-ligne .meta{ color:var(--orange); font-weight:600; font-size:14px; margin-top:2px; }
.recette-ligne .meta .sep{ color:#c7c7c7; }
.recette-ligne .meta .temps{ color:var(--muted); font-weight:500; }
.recette-ligne .pers{ color:var(--muted); font-size:14px; display:flex; align-items:center; gap:5px; margin-top:4px; }
.recette-ligne .pers svg{ width:15px; height:15px; }
.actions-ligne{ display:flex; align-items:center; gap:6px; }
.coeur-btn{ background:none; border:none; color:#c9c9c9; }
.coeur-btn.actif{ color:var(--orange); }
.coeur-btn svg{ width:24px; height:24px; }
.kebab{ background:none; border:none; color:#b5b5b5; font-size:20px; padding:4px 6px; }

/* repli vignette sans photo */
.vignette-vide{
  display:flex; align-items:center; justify-content:center;
  color:var(--orange); background:var(--orange-clair);
}
.vignette-vide svg{ width:30px; height:30px; opacity:.6; }

.ajout-pointille{
  display:flex; align-items:center; justify-content:center; gap:10px;
  border:1.5px dashed var(--orange); border-radius:var(--r);
  color:var(--orange); font-weight:700; padding:18px; margin-top:14px;
}

/* =====================================================================
   FICHE RECETTE
   ===================================================================== */
.fiche-haut{ display:flex; gap:16px; margin-top:6px; }
.fiche-haut .cover{
  width:150px; height:150px; border-radius:var(--r); object-fit:cover; flex:0 0 auto;
  background:var(--orange-clair);
}
.fiche-titre{ font-size:28px; font-weight:800; line-height:1.1; }
.fiche-auteur{ display:flex; align-items:center; gap:8px; color:var(--muted); margin-top:8px; }
.fiche-auteur img{ width:28px; height:28px; border-radius:50%; }

.stats{ display:flex; gap:10px; margin-top:14px; }
.stat{
  flex:1; background:#fff; border:1px solid var(--line); border-radius:12px;
  padding:10px; text-align:center;
}
.stat .lib{ color:var(--muted); font-size:12px; display:flex; align-items:center; justify-content:center; gap:5px; }
.stat .val{ font-weight:800; margin-top:3px; }
.stat .val.facile{ color:var(--vert); }
.stat .val.moyen{ color:var(--orange); }
.stat .val.difficile{ color:var(--rouge); }

.onglets-fiche{ display:flex; gap:18px; border-bottom:1px solid var(--line); margin-top:18px; }
.onglet-fiche{ padding:12px 2px; color:var(--muted); font-weight:600; border-bottom:3px solid transparent; }
.onglet-fiche.actif{ color:var(--orange); border-color:var(--orange); }

.deux-colonnes{ display:grid; grid-template-columns:1fr; gap:18px; margin-top:16px; }

.ingredients-entete{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.ingredients-entete b{ display:flex; align-items:center; gap:8px; color:var(--orange); }

.ingredient{
  display:flex; align-items:center; gap:12px;
  padding:12px 0; border-bottom:1px solid var(--line);
}
.ingredient .photo{ width:46px; height:46px; border-radius:10px; object-fit:cover; flex:0 0 auto; background:var(--orange-clair); }
.ingredient .nom{ flex:1; }
.ingredient .nom b{ font-weight:700; }
.ingredient .nom span{ display:block; color:var(--muted); font-size:14px; }
.ingredient .appareil{ color:var(--orange); }
.ingredient .appareil svg{ width:24px; height:24px; }

.encart{ background:#F7F2EA; border-radius:var(--r); padding:16px; }
.encart h4{ display:flex; align-items:center; gap:8px; }
.encart p{ color:#5a5145; margin-top:8px; }
.encart .apercu{ width:100%; border-radius:12px; margin-top:4px; }

.bloc-action-fiche{ display:flex; flex-direction:column; gap:12px; }
.carte-action{
  background:#fff; border:1px solid var(--line); border-radius:var(--r);
  padding:16px; display:flex; align-items:center; justify-content:center; gap:10px; font-weight:700;
}
.etoiles{ color:#dcdcdc; font-size:22px; letter-spacing:2px; }
.etoile.pleine{ color:var(--orange); }

/* =====================================================================
   ETAPES
   ===================================================================== */
.etape{ display:flex; gap:14px; padding:16px 0; border-bottom:1px solid var(--line); }
.etape .num{
  flex:0 0 auto; width:34px; height:34px; border-radius:50%;
  background:var(--orange); color:#fff; font-weight:800;
  display:flex; align-items:center; justify-content:center;
}
.etape .corps{ flex:1; }
.etape .corps img{ border-radius:12px; margin-top:10px; max-height:200px; object-fit:cover; }

/* =====================================================================
   Navigation basse flottante
   ===================================================================== */
.nav-basse{
  position:fixed; left:50%; transform:translateX(-50%); bottom:0;
  width:100%; max-width:var(--max);
  background:#fff; border-top:1px solid var(--line);
  display:grid; grid-template-columns:repeat(5,1fr);
  padding:8px 6px max(8px, env(safe-area-inset-bottom));
  box-shadow:0 -2px 14px rgba(0,0,0,.05); z-index:50;
}
.nav-basse a{
  display:flex; flex-direction:column; align-items:center; gap:3px;
  color:var(--muted); font-size:12px; font-weight:600; position:relative;
}
.nav-basse a svg{ width:24px; height:24px; }
.nav-basse a.actif{ color:var(--orange); }
.nav-basse .central{ margin-top:-26px; }
.nav-basse .central .bulle{
  width:56px; height:56px; border-radius:50%; background:var(--orange);
  color:#fff; display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 18px rgba(239,108,27,.4); border:4px solid var(--bg);
}
.nav-basse .central .bulle svg{ width:28px; height:28px; }
.badge-panier{
  position:absolute; top:-4px; right:50%; margin-right:-22px;
  background:var(--rouge); color:#fff; font-size:11px; font-weight:700;
  min-width:18px; height:18px; border-radius:9px; padding:0 5px;
  display:flex; align-items:center; justify-content:center;
}

/* Etat vide */
.vide{ text-align:center; color:var(--muted); padding:60px 20px; }
.vide svg{ width:54px; height:54px; opacity:.4; margin:0 auto 12px; }

/* Petits utilitaires */
.mt-s{ margin-top:10px; }
.mt{ margin-top:18px; }
.center{ text-align:center; }

/* =====================================================================
   ASSISTANT D'AJOUT (ajouter-recette.php)
   ===================================================================== */
.assistant{ padding-bottom:30px; }
.assistant-entete{
  display:flex; align-items:center; justify-content:space-between;
  margin:2px 0 14px;
}
.assistant-entete .retour{
  width:32px; height:32px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:24px; color:var(--ink); background:var(--carte);
  box-shadow:var(--ombre); text-decoration:none;
}
.fil-etapes{ display:flex; align-items:center; gap:6px; }
.fil-etapes i{ width:22px; height:2px; background:var(--line); display:block; }
.fil-etapes .puce{
  width:26px; height:26px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:700; color:var(--muted);
  background:var(--carte); border:2px solid var(--line);
}
.fil-etapes .puce.active{ color:#fff; background:var(--orange); border-color:var(--orange); }
.fil-etapes .puce.faite{ color:#fff; background:var(--vert); border-color:var(--vert); }

.assistant-titre{ text-align:center; font-size:21px; margin:0 0 4px; }
.ss-titre{ text-align:center; color:var(--muted); margin:0 0 16px; font-size:14px; }

.alerte{
  background:var(--rose-clair); color:var(--rouge);
  border:1px solid var(--rouge); border-radius:var(--r-s);
  padding:10px 14px; margin-bottom:14px; font-size:14px;
}

/* Formulaires */
.form-recette,.form-ingredient,.form-etape{ display:flex; flex-direction:column; gap:14px; }
.champ{ display:flex; flex-direction:column; gap:6px; }
.champ > span{ font-size:14px; font-weight:600; color:var(--ink); }
.champ input[type=text],
.champ input[type=number],
.champ input[type=file],
.champ textarea{
  width:100%; box-sizing:border-box;
  border:1px solid var(--line); border-radius:var(--r-s);
  padding:12px 14px; font:inherit; background:var(--carte); color:var(--ink);
}
.champ textarea{ resize:vertical; }
.champ input:focus,.champ textarea:focus{ outline:none; border-color:var(--orange); }
.duo{ display:flex; gap:12px; }
.duo .champ{ flex:1; }

/* Zone photo de couverture */
.zone-couverture{
  display:block; position:relative; overflow:hidden;
  height:170px; border-radius:var(--r);
  background:#e9e7e1; border:1px dashed #c9c6bd; cursor:pointer;
}
.zone-couverture img{ width:100%; height:100%; object-fit:cover; }
.zone-couverture .placeholder{
  position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:8px; color:#8a857a;
}
.zone-couverture .placeholder em{ font-style:normal; font-size:14px; }

/* Pastilles de choix (catégorie / difficulté) */
.pills{ display:flex; gap:10px; flex-wrap:wrap; }
.pill{
  border:1.5px solid var(--line); background:var(--carte); color:var(--ink);
  border-radius:999px; padding:9px 18px; font:inherit; font-size:14px; cursor:pointer;
}
.pill.actif{ border-color:var(--vert); color:var(--vert); background:var(--vert-clair); font-weight:600; }

/* Compteur -/+ */
.compteur{
  display:flex; align-items:center; justify-content:space-between;
  border:1px solid var(--line); border-radius:var(--r-s); background:var(--carte);
  overflow:hidden;
}
.compteur input{
  border:none; text-align:left; padding:12px 14px; font:inherit; width:100%;
  background:transparent; color:var(--ink); -moz-appearance:textfield;
}
.compteur input::-webkit-outer-spin-button,
.compteur input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.compteur .moins,.compteur .plus{
  flex:0 0 46px; height:46px; border:none; background:transparent;
  font-size:22px; color:var(--orange); cursor:pointer;
}
.compteur .moins{ border-right:1px solid var(--line); }
.compteur .plus{ border-left:1px solid var(--line); }

/* Boutons pleine largeur */
.btn-large{
  display:block; width:100%; box-sizing:border-box; text-align:center;
  border:none; border-radius:var(--r-s); cursor:pointer;
  background:var(--orange); color:#fff; font:inherit; font-weight:700; font-size:16px;
  padding:15px; text-decoration:none; margin-top:6px;
}
.btn-large:hover{ background:var(--orange-d); }
.btn-large[disabled]{ background:#d8d5cd; cursor:not-allowed; }

/* Listes en mode édition */
.liste-ingredients-edit,.liste-etapes-edit{ display:flex; flex-direction:column; gap:10px; margin-bottom:16px; }
.liste-ingredients-edit .ingredient{
  display:flex; align-items:center; gap:12px;
  background:var(--carte); border-radius:var(--r-s); padding:10px 12px; box-shadow:var(--ombre);
}
.liste-ingredients-edit .ingredient .photo{
  width:42px; height:42px; border-radius:10px; object-fit:cover; flex:0 0 42px;
  display:flex; align-items:center; justify-content:center; background:var(--bg); color:var(--muted);
}
.liste-ingredients-edit .nom{ flex:1; display:flex; flex-direction:column; }
.liste-ingredients-edit .nom span{ color:var(--muted); font-size:13px; }
.btn-suppr{
  flex:0 0 30px; width:30px; height:30px; border-radius:50%;
  border:none; background:var(--rose-clair); color:var(--rouge);
  font-size:18px; line-height:1; cursor:pointer;
}
.vide-mini{ color:var(--muted); text-align:center; font-size:14px; padding:8px; }

.etape-edit{
  display:flex; gap:12px; align-items:flex-start;
  background:var(--carte); border-radius:var(--r-s); padding:12px; box-shadow:var(--ombre);
}
.etape-edit .num{
  flex:0 0 26px; width:26px; height:26px; border-radius:50%;
  background:var(--orange); color:#fff; font-weight:700; font-size:14px;
  display:flex; align-items:center; justify-content:center;
}
.etape-edit .corps{ flex:1; }
.etape-edit .corps p{ margin:0 0 8px; }
.photo-etape{ width:100%; max-height:160px; object-fit:cover; border-radius:10px; }

/* Bloc d'ajout dépliable */
.bloc-ajout{
  background:var(--carte); border:1px solid var(--line); border-radius:var(--r-s);
  padding:4px 14px; margin-bottom:16px;
}
.bloc-ajout > summary{ list-style:none; padding:10px 0; }
.bloc-ajout > summary::-webkit-details-marker{ display:none; }
.bloc-ajout[open] > summary{ border-bottom:1px solid var(--line); margin-bottom:14px; }
.bloc-ajout .btn-contour{ width:100%; justify-content:center; }

.barre-fin{ display:flex; gap:12px; align-items:stretch; margin-top:8px; }
.barre-fin .btn-contour{ flex:0 0 auto; }

/* Pastille photo cliquable (ingrédient existant dans l'assistant) */
.photo-upload{ flex:0 0 auto; }
.photo-edit{ position:relative; display:block; cursor:pointer; }
.photo-edit .photo{
  width:42px; height:42px; border-radius:10px; object-fit:cover; flex:0 0 42px;
  display:flex; align-items:center; justify-content:center; background:var(--bg); color:var(--muted);
}
.photo-edit .badge-appareil{
  position:absolute; right:-4px; bottom:-4px;
  width:18px; height:18px; border-radius:50%;
  background:var(--orange); color:#fff;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.photo-edit:hover .badge-appareil{ background:var(--orange-d); }

/* Lien « ajouter / changer la photo » d'une étape */
.lien-photo{
  display:inline-flex; align-items:center; gap:6px; cursor:pointer;
  color:var(--orange); font-size:13px; font-weight:600;
}
.lien-photo:hover{ color:var(--orange-d); }

/* =====================================================================
   PAGES LISTE DE COURSES, FAVORIS, PROFIL
   ===================================================================== */
.page-titre-bloc{ margin:6px 0 16px; }
.page-titre{ font-size:30px; line-height:1.1; margin:0; }
.page-soustitre{ color:var(--muted); margin:6px 0 0; }

/* --- Liste de courses --- */
.courses-groupe{ margin-bottom:18px; }
.courses-groupe-titre{
  font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.03em;
  color:var(--orange); margin:0 2px 8px;
}
.course-ligne{
  display:flex; align-items:center; gap:12px;
  background:var(--carte); border-radius:var(--r-s); padding:12px 14px;
  box-shadow:var(--ombre); margin-bottom:8px;
}
.course-ligne .case{
  flex:0 0 24px; width:24px; height:24px; border-radius:7px;
  border:2px solid var(--line); background:var(--carte); color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center; padding:0;
}
.course-ligne.cochee .case{ background:var(--vert); border-color:var(--vert); }
.course-nom{ flex:1; display:flex; flex-direction:column; }
.course-nom span{ color:var(--muted); font-size:13px; }
.course-ligne.cochee .course-nom b{ text-decoration:line-through; color:var(--muted); }
.courses-actions{ display:flex; gap:12px; margin-top:6px; }
.btn-contour.danger{ color:var(--rouge); border-color:var(--rouge); }

/* --- Profil --- */
.profil-entete{ text-align:center; padding:12px 0 6px; }
.profil-avatar{
  width:96px; height:96px; border-radius:50%; margin:0 auto 12px; overflow:hidden;
  background:var(--orange); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:40px; font-weight:700; box-shadow:var(--ombre-f);
}
.profil-avatar img{ width:100%; height:100%; object-fit:cover; }
.profil-nom{ font-size:24px; margin:0; }
.profil-mail{ color:var(--muted); margin:4px 0 10px; }
.profil-badge{
  display:inline-block; font-size:12px; font-weight:700; padding:5px 12px; border-radius:999px;
  background:var(--bg); color:var(--muted); border:1px solid var(--line);
}
.profil-badge.admin{ background:var(--orange-clair); color:var(--orange-d); border-color:transparent; }

.profil-stats{ display:flex; gap:12px; margin:20px 0; }
.stat-carte{
  flex:1; background:var(--carte); border-radius:var(--r-s); box-shadow:var(--ombre);
  padding:16px 8px; text-align:center; text-decoration:none; color:var(--ink);
}
.stat-carte b{ display:block; font-size:24px; color:var(--orange); }
.stat-carte span{ font-size:13px; color:var(--muted); }

.profil-menu{ display:flex; flex-direction:column; gap:1px; border-radius:var(--r-s); overflow:hidden; box-shadow:var(--ombre); }
.profil-item{
  display:flex; align-items:center; gap:14px; padding:16px;
  background:var(--carte); color:var(--ink); text-decoration:none;
}
.profil-item:hover{ background:var(--bg); }
.profil-item svg{ color:var(--orange); flex:0 0 auto; }
.profil-item span{ flex:1; font-weight:600; }
.profil-item .chev{ color:var(--muted); font-size:22px; font-style:normal; }
.profil-note{ color:var(--muted); font-size:13px; text-align:center; margin:20px 8px 0; }

/* =====================================================================
   MENU LATÉRAL (drawer)
   ===================================================================== */
.drawer-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.4);
  opacity:0; visibility:hidden; transition:opacity .25s; z-index:60;
}
.drawer-overlay.visible{ opacity:1; visibility:visible; }
.drawer{
  position:fixed; top:0; left:0; bottom:0; width:80%; max-width:300px;
  background:var(--carte); z-index:61; box-shadow:2px 0 18px rgba(0,0,0,.18);
  transform:translateX(-105%); transition:transform .26s ease;
  display:flex; flex-direction:column;
}
.drawer.ouvert{ transform:translateX(0); }
.drawer-tete{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 16px; border-bottom:1px solid var(--line);
}
.drawer-tete img{ height:46px; }
.drawer-fermer{
  border:none; background:transparent; font-size:30px; line-height:1;
  color:var(--muted); cursor:pointer;
}
.drawer-nav{ display:flex; flex-direction:column; padding:8px 0; flex:1; }
.drawer-nav a{
  display:flex; align-items:center; gap:14px; padding:15px 20px;
  color:var(--ink); text-decoration:none; font-weight:600;
}
.drawer-nav a:hover{ background:var(--bg); }
.drawer-nav svg{ width:21px; height:21px; color:var(--orange); flex:0 0 auto; }
.drawer-pied{
  padding:16px 20px; border-top:1px solid var(--line); margin:0;
  color:var(--rouge); font-weight:700; font-size:15px;
}
.drawer-pied span{ color:var(--muted); font-weight:400; font-size:12px; }

/* =====================================================================
   ÉDITION & RÉORDONNANCEMENT (assistant : ingrédients + étapes)
   ===================================================================== */
.fleches{ display:flex; flex-direction:column; align-items:center; gap:2px; flex:0 0 auto; }
.fleche{
  width:26px; height:22px; border:none; background:var(--bg); color:var(--orange);
  border-radius:6px; cursor:pointer; font-size:11px; line-height:1; padding:0;
  display:flex; align-items:center; justify-content:center;
}
.fleche:hover:not([disabled]){ background:var(--orange-clair); }
.fleche[disabled]{ color:var(--line); cursor:default; }

.btn-mini{
  flex:0 0 30px; width:30px; height:30px; border-radius:50%;
  border:none; background:var(--bg); color:var(--muted); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.btn-mini:hover{ background:var(--orange-clair); color:var(--orange); }
.btn-mini.editer svg{ display:block; }

/* Formulaire d'édition inline qui apparaît sous la ligne */
.edit-ligne{
  background:var(--carte); border:1px solid var(--orange);
  border-radius:var(--r-s); padding:14px; margin:-4px 0 10px;
  display:flex; flex-direction:column; gap:10px;
}
.edit-ligne input[type=text],
.edit-ligne textarea{
  width:100%; box-sizing:border-box; border:1px solid var(--line);
  border-radius:var(--r-s); padding:10px 12px; font:inherit; background:var(--bg);
}
.edit-ligne textarea{ resize:vertical; }
.edit-ligne .duo{ display:flex; gap:10px; }
.edit-ligne .duo input{ flex:1; min-width:0; }
.edit-actions{ display:flex; gap:10px; justify-content:flex-end; align-items:center; }
.btn-mini-valider{
  border:none; border-radius:var(--r-s); background:var(--orange); color:#fff;
  font:inherit; font-weight:700; padding:10px 18px; cursor:pointer;
}
.btn-mini-valider:hover{ background:var(--orange-d); }
.edit-actions .annuler{ padding:9px 16px; }

/* L'étape : flèches+num à gauche, corps, outils à droite */
.etape-edit .fleches .num{
  width:26px; height:26px; border-radius:50%;
  background:var(--orange); color:#fff; font-weight:700; font-size:14px;
  display:flex; align-items:center; justify-content:center; margin:1px 0;
}
.etape-outils{ display:flex; flex-direction:column; gap:6px; align-items:center; flex:0 0 auto; }

/* L'ingrédient : un peu d'air entre les éléments */
.liste-ingredients-edit .ingredient{ gap:10px; }
.liste-ingredients-edit .ingredient .nom{ min-width:0; }
.liste-ingredients-edit .ingredient .nom b{ overflow-wrap:anywhere; }

/* =====================================================================
   PARTAGE DE LA LISTE DE COURSES
   ===================================================================== */
.page-titre-bloc.avec-action{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.btn-partager{
  display:inline-flex; align-items:center; gap:7px; flex:0 0 auto; margin-top:4px;
  border:1.5px solid var(--orange); background:var(--carte); color:var(--orange);
  font:inherit; font-weight:700; font-size:14px; padding:9px 15px; border-radius:999px; cursor:pointer;
}
.btn-partager:hover{ background:var(--orange-clair); }

.partage-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.4);
  opacity:0; visibility:hidden; transition:opacity .2s; z-index:70;
}
.partage-overlay.visible{ opacity:1; visibility:visible; }
.partage-sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:71;
  background:var(--carte); border-radius:20px 20px 0 0; padding:10px 20px 26px;
  max-width:var(--max); margin:0 auto;
  transform:translateY(110%); transition:transform .26s ease;
  box-shadow:0 -4px 20px rgba(0,0,0,.18);
}
.partage-sheet.ouvert{ transform:translateY(0); }
.partage-poignee{ width:42px; height:4px; border-radius:2px; background:var(--line); margin:6px auto 14px; }
.partage-sheet h3{ margin:0 0 14px; font-size:17px; text-align:center; }
.partage-options{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.partage-opt{
  display:flex; align-items:center; gap:14px; width:100%; box-sizing:border-box;
  background:var(--bg); border:none; border-radius:var(--r-s); padding:14px 16px;
  font:inherit; font-size:15px; font-weight:600; color:var(--ink); text-decoration:none; cursor:pointer;
}
.partage-opt:hover{ background:var(--orange-clair); }
.partage-opt .ic{
  width:34px; height:34px; border-radius:50%; flex:0 0 34px;
  display:flex; align-items:center; justify-content:center; font-size:17px; color:#fff;
}
.partage-opt .ic.wa{ background:#25D366; }
.partage-opt .ic.ml{ background:var(--bleu); }
.partage-opt .ic.sm{ background:var(--orange); }
.partage-opt .ic.cp{ background:var(--muted); }

/* =====================================================================
   COMPTES : pages connexion / inscription, avatars, profil éditable
   ===================================================================== */
.app-auth{ padding:0 20px 40px; }
.auth-logo{ text-align:center; padding:34px 0 10px; }
.auth-logo img{ height:84px; }
.auth-carte{
  background:var(--carte); border-radius:var(--r); box-shadow:var(--ombre-f);
  padding:26px 22px; max-width:430px; margin:0 auto;
}
.auth-titre{ font-size:24px; margin:0 0 4px; text-align:center; }
.auth-sous{ color:var(--muted); text-align:center; margin:0 0 20px; }
.form-auth{ display:flex; flex-direction:column; gap:14px; }
.form-auth input{
  width:100%; box-sizing:border-box; border:1px solid var(--line);
  border-radius:var(--r-s); padding:13px 14px; font:inherit; background:var(--bg);
}
.form-auth input:focus{ outline:none; border-color:var(--orange); }
.auth-bas{ text-align:center; color:var(--muted); margin:18px 0 0; }
.auth-bas a{ color:var(--orange); font-weight:700; text-decoration:none; }

.succes{
  background:var(--vert-clair); color:#2f7d33; border:1px solid var(--vert);
  border-radius:var(--r-s); padding:10px 14px; margin-bottom:14px; font-size:14px;
}

/* Avatar générique (pastille couleur ou photo) */
.avatar{
  width:40px; height:40px; border-radius:50%; overflow:hidden; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700;
  background:#3B6FB5;
}
.avatar img{ width:100%; height:100%; object-fit:cover; }
.avatar .ini{ font-size:1.1em; }
.profil-avatar.petit{ width:64px; height:64px; font-size:26px; box-shadow:none; }

/* Bloc réglage repliable (profil) */
.bloc-reglage{
  background:var(--carte); border:1px solid var(--line); border-radius:var(--r-s);
  padding:14px 16px; margin-bottom:14px;
}
.bloc-reglage > summary{
  list-style:none; cursor:pointer; font-weight:700; font-size:16px;
  display:flex; align-items:center; justify-content:space-between;
}
.bloc-reglage > summary::-webkit-details-marker{ display:none; }
.bloc-reglage > summary::after{ content:'⌄'; color:var(--muted); font-size:20px; }
.bloc-reglage[open] > summary::after{ content:'⌃'; }

/* Choix d'avatar */
.avatar-choix{ background:var(--bg); border-radius:var(--r-s); padding:14px; }
.champ-label{ font-size:14px; font-weight:600; display:block; margin-bottom:8px; }
.avatar-apercu{ display:flex; justify-content:center; margin-bottom:12px; }
.couleurs{ display:flex; gap:14px; justify-content:center; }
.pastille-couleur{
  width:42px; height:42px; border-radius:50%; cursor:pointer; position:relative;
  display:flex; align-items:center; justify-content:center; box-shadow:var(--ombre);
}
.pastille-couleur input{ position:absolute; opacity:0; }
.pastille-couleur .check{ color:#fff; font-size:18px; opacity:0; }
.pastille-couleur input:checked ~ .check{ opacity:1; }
.pastille-couleur input:checked + .check,
.pastille-couleur:has(input:checked){ outline:3px solid var(--ink); outline-offset:2px; }

/* Bouton de déconnexion */
.btn-deconnexion{
  display:flex; align-items:center; justify-content:center; gap:10px;
  width:100%; box-sizing:border-box; margin-top:6px;
  background:var(--carte); color:var(--rouge); border:1px solid var(--line);
  border-radius:var(--r-s); padding:14px; text-decoration:none; font-weight:700;
}
.btn-deconnexion:hover{ background:var(--rose-clair); }

/* Bandeau utilisateur dans le tiroir */
.drawer-user{
  display:flex; align-items:center; gap:12px; padding:14px 20px;
  border-top:1px solid var(--line);
}
.drawer-user span{ font-weight:700; }

/* Photo de couverture cliquable (fiche recette) */
.cover-upload{ flex:0 0 auto; }
.cover-label{ position:relative; display:block; cursor:pointer; }
.cover-label .cover-badge{
  position:absolute; right:6px; bottom:6px;
  width:26px; height:26px; border-radius:50%;
  background:var(--orange); color:#fff;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 1px 4px rgba(0,0,0,.3);
}
.cover-label:hover .cover-badge{ background:var(--orange-d); }

/* =====================================================================
   CUISINE DU MONDE (partage public)
   ===================================================================== */
.monde-btn{ background:none; border:none; color:#c9c9c9; cursor:pointer; padding:0; }
.monde-btn svg{ width:23px; height:23px; }
.monde-btn.actif{ color:var(--bleu); }

/* Auteur dans le flux Cuisine du monde */
.monde-auteur{ display:flex; align-items:center; gap:7px; margin-top:6px; color:var(--muted); font-size:13px; }
.avatar.mini{ width:22px; height:22px; font-size:11px; }

/* Pastille / bouton « Cuisine du monde » sur la fiche */
.puce-monde{
  display:inline-flex; align-items:center; gap:7px; cursor:pointer;
  border:1.5px solid var(--line); background:var(--carte); color:var(--muted);
  border-radius:999px; padding:7px 13px; font:inherit; font-size:13px; font-weight:600;
}
.puce-monde.actif{ border-color:var(--bleu); color:var(--bleu); background:#eef3fb; }
button.puce-monde:hover{ border-color:var(--bleu); }

/* Case à cocher « Cuisine du monde » dans l'assistant */
.case-monde{
  display:flex; gap:12px; align-items:flex-start;
  background:var(--bg); border:1px solid var(--line); border-radius:var(--r-s);
  padding:14px; cursor:pointer;
}
.case-monde input{ width:20px; height:20px; margin-top:2px; flex:0 0 auto; accent-color:var(--bleu); }
.case-monde-corps{ display:flex; flex-direction:column; gap:3px; }
.case-monde-titre{ display:flex; align-items:center; gap:7px; font-weight:600; color:var(--ink); }
.case-monde-titre svg{ color:var(--bleu); }
.case-monde-sous{ font-size:13px; color:var(--muted); }

/* =====================================================================
   NOTATION (étoiles cliquables) + LIEN DE PARTAGE
   ===================================================================== */
.noter-bloc{ justify-content:space-between; align-items:center; }
.ma-note{ color:var(--muted); font-weight:400; font-size:13px; }
.etoiles-noter{ display:inline-flex; flex-direction:row-reverse; }
.etoile-btn{
  background:none; border:none; cursor:pointer; font-size:24px; line-height:1;
  color:#d8d5cd; padding:0 1px;
}
.etoile-btn.pleine{ color:var(--orange); }
.etoiles-noter .etoile-btn:hover,
.etoiles-noter .etoile-btn:hover ~ .etoile-btn{ color:var(--orange); }

.lien-copiable{ margin-bottom:14px; }
.lien-copiable input{
  width:100%; box-sizing:border-box; border:1px solid var(--line);
  border-radius:var(--r-s); padding:12px 14px; font:inherit; font-size:13px;
  background:var(--bg); color:var(--ink);
}

/* =====================================================================
   PAGE PUBLIQUE DE PARTAGE (recette-partage.php)
   ===================================================================== */
.logo-public{ display:flex; justify-content:center; width:100%; }
.logo-public img{ height:64px; }
.banniere-partage{
  background:var(--orange-clair); color:var(--orange-d);
  border-radius:var(--r-s); padding:10px 14px; text-align:center;
  font-size:14px; margin-bottom:16px;
}
.fiche-meta{ color:var(--muted); font-size:14px; margin-top:4px; }
.fiche-desc{ color:var(--ink); margin:14px 0; font-style:italic; }
.bloc-titre{ font-size:19px; margin:24px 0 10px; }
.ajust-pers{ display:flex; align-items:center; gap:10px; margin-bottom:12px; color:var(--muted); }
.ajust-pers b{ color:var(--ink); }
.liste-ing-public{ list-style:none; padding:0; margin:0; }
.liste-ing-public li{
  padding:10px 0; border-bottom:1px solid var(--line); display:flex; gap:10px;
}
.liste-ing-public .q{ color:var(--orange); font-weight:700; min-width:70px; flex:0 0 auto; }
.liste-etapes-public{ padding-left:0; margin:0; counter-reset:etape; list-style:none; }
.liste-etapes-public li{
  position:relative; padding:4px 0 16px 44px; margin-bottom:4px; counter-increment:etape;
}
.liste-etapes-public li::before{
  content:counter(etape); position:absolute; left:0; top:0;
  width:30px; height:30px; border-radius:50%; background:var(--orange); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700;
}
.liste-etapes-public li p{ margin:4px 0 8px; }
.cta-public{
  margin-top:30px; padding:20px; text-align:center;
  background:var(--carte); border-radius:var(--r); box-shadow:var(--ombre);
}
.cta-public p{ margin:0 0 12px; font-weight:600; }

/* =====================================================================
   MODE VISITEUR (non connecté)
   ===================================================================== */
/* Bouton Connexion dans l'en-tête */
.btn-connexion{
  display:inline-flex; align-items:center; padding:9px 18px; border-radius:999px;
  background:var(--orange); color:#fff; font-weight:700; font-size:14px;
  text-decoration:none; white-space:nowrap; box-shadow:0 2px 8px rgba(239,108,27,.28);
  transition:background .15s, transform .05s;
}
.btn-connexion:hover{ background:var(--orange-d); }
.btn-connexion:active{ background:var(--orange-d); transform:translateY(1px); }

/* L'app invité n'a pas de nav basse */
.app-invite{ padding-bottom:30px; }

/* Bandeau / encart d'invitation à créer un compte (vertical, centré) */
.cta-invite{
  display:flex; flex-direction:column; align-items:center; gap:14px;
  background:linear-gradient(180deg,#FFF7EF 0%,var(--orange-clair) 100%);
  border:1px solid #F3D9C2; border-radius:var(--r);
  padding:22px 20px; margin-bottom:18px; text-align:center;
}
.cta-invite > div{ display:flex; flex-direction:column; gap:6px; line-height:1.45; max-width:460px; }
.cta-invite b{ color:var(--orange-d); font-size:17px; }
.cta-invite span{ font-size:14px; color:#8a6a52; }
.cta-invite p{ margin:0; font-size:14px; color:#8a6a52; line-height:1.45; }
.cta-invite .btn-large{ margin:0; width:100%; max-width:320px; }
.cta-invite.vertical{ }
.lien-discret{ text-align:center; color:var(--muted); font-size:13px; text-decoration:underline; }

/* Boutons principaux : finitions (ombre douce + interaction) */
.btn-large{
  box-shadow:0 3px 12px rgba(239,108,27,.30);
  transition:background .15s, transform .05s, box-shadow .15s;
}
.btn-large:hover{ background:var(--orange-d); }
.btn-large:active{ transform:translateY(1px); box-shadow:0 2px 7px rgba(239,108,27,.28); }
.btn-contour{ transition:background .15s, transform .05s; }
.btn-contour:hover{ background:var(--orange-clair); }
.btn-contour:active{ transform:translateY(1px); }

/* Badge « Recette du monde » cliquable (lien vers Cuisine du monde) */
a.puce-monde{ text-decoration:none; }
a.puce-monde.actif:hover{ background:#e3edfb; }
