@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Literata:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Couleurs — bleu nuit / or / turquoise Caraïbes */
  --ink: #1B2A4A;          /* bleu nuit profond — texte, structure */
  --ink-soft: #3E4C6B;     /* variante plus douce pour texte secondaire */
  --gold: #B8901F;         /* or chandelle — accents, liens actifs */
  --gold-soft: #E8D9AE;    /* or pâle — fonds de surbrillance discrets */
  --teal: #1F6E5C;         /* vert turquoise — succès, progression */
  --teal-soft: #CFE8DE;    /* turquoise pâle — fonds succès */
  --paper: #FBF7EE;        /* parchemin chaud — fond de lecture */
  --paper-raised: #FFFFFF; /* cartes, surfaces élevées */
  --border: #E4DCC8;       /* bordures discrètes sur parchemin */
  --coral: #C2542E;        /* accent chaud secondaire — HT/alerte douce */

  --font-display: 'Fraunces', Georgia, serif;
  --font-reading: 'Literata', Georgia, serif;
  --font-ui: 'Inter', system-ui, sans-serif;

  --radius: 10px;
  --shadow-soft: 0 2px 10px rgba(27, 42, 74, 0.07);
  --shadow-lift: 0 6px 24px rgba(27, 42, 74, 0.12);
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Ruban tricolore — signature visuelle : trois fils EN/FR/HT tissés */
.ribbon {
  height: 4px;
  background: linear-gradient(90deg,
    var(--teal) 0 33.3%,
    var(--gold) 33.3% 66.6%,
    var(--coral) 66.6% 100%);
}

header.app-header {
  background: var(--ink);
  color: var(--paper);
  padding: 1.1rem 1.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-ui);
}
header.app-header a { color: var(--gold-soft); text-decoration: none; font-weight: 500; }
header.app-header a:hover { color: var(--gold); }
header.app-header .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: .01em;
}
header.app-header .user-tag { font-size: .88rem; opacity: .85; }

main.container { max-width: 760px; margin: 2rem auto; padding: 0 1.4rem 4rem; }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); font-weight: 600; }
h2.section-title {
  font-size: 1.35rem;
  margin: 2.2rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* Boutons */
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: .92rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #14213A; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--ink); }

/* Cartes */
.card {
  background: var(--paper-raised);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}
.card:hover { box-shadow: var(--shadow-lift); }
.card h3 { margin: 0 0 .5rem; font-size: 1.1rem; }

.bar-bg { background: var(--gold-soft); border-radius: 20px; height: 8px; overflow: hidden; margin: .6rem 0; }
.bar-fill { background: var(--teal); height: 100%; border-radius: 20px; transition: width .3s ease; }
.meta { font-size: .82rem; color: var(--ink-soft); font-family: var(--font-ui); }

/* Langue selector */
.langbar { display: flex; gap: .4rem; }
.langbar a {
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 600;
  padding: .35rem .8rem;
  border-radius: 20px;
  text-decoration: none;
  background: var(--paper-raised);
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.langbar a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Lecteur biblique */
.reader {
  font-family: var(--font-reading);
  font-size: 1.15rem;
  line-height: 2;
  color: var(--ink);
  background: var(--paper-raised);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}
.verse { position: relative; cursor: pointer; padding: 4px 6px; border-radius: 4px; display: block; margin-bottom: .35rem; }
.verse:hover { background: var(--gold-soft); }
.vnum {
  font-family: var(--font-ui);
  font-size: .68rem;
  font-weight: 700;
  color: var(--gold);
  vertical-align: super;
  margin-right: 4px;
}
.hl-yellow { background: #FBEBAE; }
.hl-green  { background: var(--teal-soft); }
.hl-blue   { background: #C9E1F0; }
.hl-pink   { background: #F3D3E0; }

/* Grilles (livres, chapitres) */
.grid-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.grid-books a {
  display: block;
  background: var(--paper-raised);
  padding: .8rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: .92rem;
  border: 1px solid var(--border);
  transition: all .12s ease;
}
.grid-books a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.grid-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: .5rem; }
.grid-chapters a {
  display: flex; align-items: center; justify-content: center;
  height: 50px; background: var(--paper-raised);
  border-radius: var(--radius); text-decoration: none;
  color: var(--ink); font-family: var(--font-display); font-weight: 600;
  border: 1px solid var(--border);
}
.grid-chapters a:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

/* Login */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
  background: var(--paper-raised);
  padding: 2.4rem 2.2rem;
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  width: 340px;
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--teal), var(--gold), var(--coral)) 1;
}
.auth-card h1 {
  font-size: 1.5rem;
  margin: 0 0 .3rem;
}
.auth-card .tagline {
  font-family: var(--font-reading);
  font-style: italic;
  color: var(--ink-soft);
  font-size: .92rem;
  margin-bottom: 1.6rem;
}
.auth-card input {
  width: 100%; padding: .65rem .8rem; margin-bottom: .8rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: var(--font-ui); font-size: .95rem;
}
.auth-card input:focus { outline: none; border-color: var(--gold); }
.auth-card .error { color: var(--coral); font-size: .85rem; margin-bottom: 1rem; }

/* Popover de surlignage */
#popover {
  position: absolute; background: var(--paper-raised);
  border-radius: 10px; box-shadow: var(--shadow-lift);
  padding: .6rem; display: none; z-index: 10;
  border: 1px solid var(--border);
}
#popover button {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; margin: 2px; cursor: pointer;
  box-shadow: 0 0 0 1px var(--border);
}

/* Nav bas de page (chapitre précédent/suivant) */
.nav-chapters {
  display: flex; justify-content: space-between;
  max-width: 760px; margin: 1.4rem auto 0; padding: 0;
  font-family: var(--font-ui); font-weight: 600; font-size: .9rem;
}
.nav-chapters a { text-decoration: none; color: var(--gold); }
.nav-chapters a:hover { color: var(--ink); }

@media (max-width: 600px) {
  main.container { padding: 0 1rem 3rem; }
  .reader { padding: 1.4rem 1.2rem; font-size: 1.05rem; }
}
