/* =========================================================================
   Bayan — composants réutilisés (navigation, boutons, cartes, puces,
   feuille modale, bannières, message temporaire, écran de chargement)
   ========================================================================= */

/* ---- Navigation du bas ---- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + var(--safe-bottom));
  z-index: 30;
  box-shadow: 0 -4px 20px rgba(20, 33, 26, 0.06);
}
.nav-btn {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn span { font-size: 11px; font-weight: 600; }
.nav-btn[aria-current="page"] { color: var(--accent); }
.nav-btn[aria-current="page"] svg { fill: var(--accent-soft); }

/* ---- Boutons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 20px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-gold { background: linear-gradient(135deg, #E8C766, #B8892E); color: #0A3D2C; }
.btn-ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-soft { background: var(--accent-soft); color: var(--on-accent-soft); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.active { color: var(--gold); }
.icon-btn.active svg path { fill: currentColor; }

/* ---- Titres de section, cartes ---- */
.section-title {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--title);
  margin: 28px 0 12px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--border);
}

/* ---- Puces ---- */
.chip {
  flex-shrink: 0;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tag-chip {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--on-accent-soft);
}
.pill-tiny {
  font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--on-accent-soft);
  white-space: nowrap;
}
.pill-tiny.medine { background: var(--medine-soft); color: var(--on-medine-soft); }
.pill-tiny.texte { background: var(--gold-soft); color: var(--on-gold-soft); }

/* ---- Onglets (Favoris) ---- */
.tabs-row { display: flex; gap: 8px; margin-bottom: 16px; }
.tab-btn {
  flex: 1; padding: 10px; text-align: center; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 13.5px;
  color: var(--text-dim); cursor: pointer;
}
.tab-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---- Feuille modale (fiches) ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--backdrop);
  z-index: 50; display: flex; align-items: flex-end;
}
.modal-sheet {
  background: var(--bg);
  width: 100%; max-width: 560px; margin: 0 auto;
  max-height: 92vh; overflow-y: auto;
  border-radius: 24px 24px 0 0;
  padding-bottom: calc(24px + var(--safe-bottom));
  animation: sheet-in .25s ease;
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { width: 40px; height: 4px; background: var(--border); border-radius: var(--radius-pill); margin: 10px auto; }

/* ---- Bannières (installation, nouvelle version) ---- */
.install-banner, .update-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
  color: var(--on-hero);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  box-shadow: var(--shadow-2);
}
.install-banner .txt { flex: 1; }
.install-banner .txt strong { display: block; font-size: 14px; }
.install-banner .txt span { font-size: 12.5px; color: var(--on-hero-dim); }
.install-banner .close { background: none; border: none; color: var(--on-hero-dim); font-size: 18px; cursor: pointer; padding: 4px; }
.update-banner {
  position: fixed; left: 12px; right: 12px; bottom: calc(80px + var(--safe-bottom));
  max-width: 536px; margin: 0 auto; z-index: 40;
}
.update-banner span { flex: 1; font-size: 13.5px; font-weight: 600; }

/* ---- Message temporaire ---- */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px);
  background: var(--hero-to); color: var(--on-hero); padding: 12px 20px; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 600; z-index: 60; opacity: 0; pointer-events: none;
  transition: all .25s ease; box-shadow: var(--shadow-2); max-width: 90%; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Écran de chargement ---- */
.loading-screen {
  position: fixed; inset: 0; background: #0A3D2C;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; z-index: 100; gap: 14px; padding: 24px; text-align: center;
}
.loading-screen .spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25); border-top-color: #E8C766;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen .lbl { font-family: var(--font-display); font-size: 16px; }

/* ---- État vide ---- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-dim); line-height: 1.6; }
.empty-state .ic { font-size: 30px; margin-bottom: 8px; }

/* ---- Connexion (« J'ai déjà acheté », écran de connexion du mode payant) ---- */
.btn-link { background: none; color: var(--text-dim); margin-top: 6px; }
.connexion { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; text-align: left; }
.connexion label { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }
.connexion input {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); font-size: 16px; background: var(--surface);
}
.connexion input:focus { border-color: var(--gold); outline: none; }
.form-message {
  margin: 4px 0 0; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--danger-soft); color: var(--danger); font-size: 13px; line-height: 1.5;
}
.login-screen {
  position: fixed; inset: 0; z-index: 90; overflow-y: auto;
  background: linear-gradient(160deg, #0A3D2C, #0B4F3C 60%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  background: var(--bg); border-radius: var(--radius-lg); padding: 30px 24px;
  max-width: 400px; width: 100%; text-align: center; box-shadow: var(--shadow-2);
}
.login-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px;
  background: linear-gradient(135deg, #E8C766, #0F5C43); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-quran); font-size: 24px;
}
.login-card h1 { font-family: var(--font-display); color: var(--title); margin: 0 0 6px; }
