/* ============================================================
   QuelleLoi - Feuille de style principale
   Charte : bleu (#1560F1), navy (#0B1F3A), sauge (#7BAFA6/#A7BC9A)
   Typographie : Fraunces (display) + Inter (body)
   ============================================================ */

:root {
  /* Couleurs charte */
  --blue:        #1560F1;
  --blue-dark:   #0F4FCB;
  --navy:        #0B1F3A;
  --sage:        #7BAFA6;
  --sage-light:  #A7BC9A;
  --cream:       #F2E9D8;
  --gray-light:  #E3E6EA;

  /* Neutres */
  --bg:          #FBFAF6;   /* fond pâle chaud (cohérent avec la carte) */
  --bg-alt:      #FFFFFF;
  --surface:     #FFFFFF;
  --ink:         #0B1F3A;
  --ink-soft:    #3D4A60;
  --ink-mute:    #6B7280;
  --line:        #E3E6EA;

  /* Système */
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, 0.06);
  --shadow:    0 4px 24px rgba(11, 31, 58, 0.08);
  --shadow-lg: 0 24px 60px -20px rgba(11, 31, 58, 0.18);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   BASE
   ============================================================ */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Texture subtile : grain */
  background-image:
    radial-gradient(at 12% 8%, rgba(123, 175, 166, 0.06) 0px, transparent 50%),
    radial-gradient(at 88% 92%, rgba(21, 96, 241, 0.05) 0px, transparent 50%);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--blue-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; font-weight: 600; }

p { margin: 0 0 1em; }
mark { background: rgba(247, 226, 137, 0.55); color: inherit; padding: 0 2px; border-radius: 3px; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  background: rgba(251, 250, 246, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}
.brand-logo { width: 38px; height: 38px; flex-shrink: 0; }
.brand-text-1 { color: var(--navy); }
.brand-text-2 { color: var(--blue); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all .2s;
}
.nav-link:hover { color: var(--navy); background: rgba(11, 31, 58, 0.05); }
.nav-link--ghost { border: 1px solid var(--line); }
.nav-link--cta {
  background: var(--blue);
  color: white;
  font-weight: 600;
}
.nav-link--cta:hover { background: var(--blue-dark); color: white; }

.mobile-toggle { display: none; }

/* ============================================================
   HERO (page d'accueil)
   ============================================================ */

.hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
}

.hero-decor {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-decor::before, .hero-decor::after {
  content: ''; position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.45;
}
.hero-decor::before {
  top: -100px; right: -100px; width: 400px; height: 400px;
  background: radial-gradient(circle, var(--sage) 0%, transparent 70%);
}
.hero-decor::after {
  bottom: -120px; left: -120px; width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(21, 96, 241, 0.35) 0%, transparent 70%);
}

.hero-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cream);
  color: var(--navy);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sage); animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.3); }
}

.hero h1 {
  margin-bottom: 20px;
}
.hero h1 .accent {
  color: var(--blue);
  font-style: italic;
  font-weight: 500;
}

.hero-lead {
  font-size: 1.18rem;
  color: var(--ink-soft);
  margin-bottom: 36px;
  max-width: 540px;
}

/* Barre de recherche héro */
.search-form {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 6px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-lg);
  max-width: 580px;
  transition: box-shadow .25s, border-color .25s;
}
.search-form:focus-within {
  border-color: var(--blue);
  box-shadow: 0 24px 60px -20px rgba(21, 96, 241, 0.3), 0 0 0 4px rgba(21, 96, 241, 0.12);
}
.search-form input[type="text"] {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  padding: 16px 20px;
  color: var(--ink);
  outline: none;
}
.search-form input[type="text"]::placeholder { color: var(--ink-mute); }
.search-form button {
  background: var(--blue);
  color: white;
  border: 0;
  border-radius: calc(var(--radius-lg) - 6px);
  padding: 14px 28px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .2s, transform .15s;
}
.search-form button:hover { background: var(--blue-dark); }
.search-form button:active { transform: scale(0.97); }

.hero-examples {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--ink-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}
.hero-examples span { font-weight: 500; }
.hero-example {
  background: white;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.hero-example:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}

/* Illustration hibou mascotte */
.hero-mascot {
  position: relative;
  text-align: center;
}
.hero-mascot-card {
  background: linear-gradient(160deg, white 0%, var(--cream) 100%);
  border-radius: 32px;
  padding: 30px 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: rotate(2deg);
}
.hero-mascot-card::before {
  content: ''; position: absolute; inset: -1px;
  border-radius: 32px;
  background: linear-gradient(160deg, rgba(123, 175, 166, 0.4), transparent);
  z-index: -1;
}
.hero-mascot svg.owl { width: 100%; max-width: 280px; margin: 0 auto; }
.hero-mascot-caption {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--navy);
  margin-top: 14px;
  font-size: 0.95rem;
}

/* ============================================================
   SECTIONS
   ============================================================ */

.section { padding: 70px 0; }
.section-cream { background: linear-gradient(180deg, transparent, var(--cream) 50%, transparent); }
.section-head { text-align: center; margin-bottom: 50px; }
.section-head .eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
}
.section-head p { color: var(--ink-soft); max-width: 600px; margin: 0 auto; font-size: 1.05rem; }

/* ============================================================
   CATÉGORIES (cartes)
   ============================================================ */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.cat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: all .25s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.cat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cat-color, var(--blue));
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--cat-color, var(--blue));
  box-shadow: var(--shadow);
}
.cat-card:hover::before { transform: scaleX(1); }
.cat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cat-color, var(--blue)) 10%, white);
  color: var(--cat-color, var(--blue));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.cat-icon svg { width: 22px; height: 22px; }
.cat-card h3 {
  font-size: 1.08rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin-bottom: 4px;
}
.cat-card p { color: var(--ink-mute); font-size: 0.9rem; line-height: 1.5; margin: 0; }
.cat-card-count {
  margin-top: auto; padding-top: 10px;
  font-size: 0.8rem; color: var(--ink-mute);
  font-weight: 500;
}

/* ============================================================
   RÉSULTATS DE RECHERCHE / CARTES DE LOI
   ============================================================ */

.search-page-head {
  padding: 30px 0 20px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.search-form-wrap {
  margin-top: 16px;
}
.search-stats {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  margin-top: 20px;
  color: var(--ink-mute);
  font-size: 0.92rem;
}
.search-stats strong { color: var(--navy); }

.law-list {
  display: flex; flex-direction: column; gap: 16px;
  padding: 30px 0 60px;
}

.law-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  transition: all .25s;
  display: block;
  color: inherit;
  position: relative;
}
.law-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: inherit;
}
.law-card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cat-color-light, rgba(21, 96, 241, 0.08));
  color: var(--cat-color, var(--blue));
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.law-ref {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--ink-mute);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.law-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--navy);
}
.law-card p {
  color: var(--ink-soft); font-size: 0.97rem; line-height: 1.6; margin: 0 0 10px;
}
.law-card-meta {
  font-size: 0.82rem; color: var(--ink-mute);
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 4px;
}
.law-card-meta span { display: inline-flex; align-items: center; gap: 4px; }

.no-results {
  text-align: center; padding: 80px 20px;
  color: var(--ink-mute);
}
.no-results svg { width: 80px; height: 80px; margin-bottom: 20px; opacity: 0.5; }
.no-results h3 { color: var(--navy); margin-bottom: 8px; }

/* ============================================================
   PAGE DÉTAIL D'UNE LOI
   ============================================================ */

.law-detail {
  padding: 40px 0 80px;
}
.breadcrumb {
  font-size: 0.88rem; color: var(--ink-mute);
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb-sep { opacity: 0.5; }

.law-detail-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--line);
}
.law-detail-header {
  padding: 36px 40px 30px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--cream) 0%, transparent 100%);
}
.law-detail-header .tag { margin-bottom: 14px; }
.law-detail-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin-bottom: 12px;
}
.law-detail-meta {
  display: flex; gap: 24px; flex-wrap: wrap;
  color: var(--ink-mute); font-size: 0.9rem;
  margin-top: 18px;
}
.law-detail-meta span { display: inline-flex; align-items: center; gap: 6px; }

.law-detail-actions {
  display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); color: white; }
.btn-outline {
  background: white; color: var(--navy); border-color: var(--line);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-fav { background: white; color: var(--ink-soft); border-color: var(--line); }
.btn-fav.active { background: var(--sage); color: white; border-color: var(--sage); }
.btn-fav.active svg { fill: white; }

.law-detail-body { padding: 36px 40px; }
.law-detail-body h2 {
  font-size: 1.15rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.01em;
}
.law-resume {
  font-size: 1.12rem; line-height: 1.7;
  color: var(--ink); margin-bottom: 30px;
}
.law-officiel {
  background: #FAFAFC;
  border-left: 3px solid var(--blue);
  padding: 22px 26px;
  border-radius: 0 12px 12px 0;
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.75;
  margin-bottom: 30px;
}

/* ============================================================
   AUTH (login/register)
   ============================================================ */

.auth-page {
  min-height: calc(100vh - 220px);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 20px;
}
.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
  max-width: 440px; width: 100%;
  border: 1px solid var(--line);
}
.auth-card h1 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 6px;
}
.auth-sub {
  text-align: center; color: var(--ink-mute);
  margin-bottom: 32px;
}
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.form-field input, .form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: white;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.form-field input:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 96, 241, 0.12);
}
.btn-block { width: 100%; justify-content: center; padding: 14px; font-size: 1rem; }
.auth-alt {
  text-align: center;
  margin-top: 22px;
  color: var(--ink-mute);
  font-size: 0.92rem;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* ============================================================
   COMPTE (tabs)
   ============================================================ */

.account-page { padding: 40px 0 80px; }
.account-page h1 { margin-bottom: 6px; }
.account-page > .container > p { color: var(--ink-mute); margin-bottom: 32px; }

.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}
.tab {
  padding: 12px 20px;
  color: var(--ink-mute);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .2s;
}
.tab.active { color: var(--blue); border-color: var(--blue); }
.tab:hover { color: var(--navy); }

.history-list {
  display: flex; flex-direction: column; gap: 8px;
}
.history-item {
  background: white;
  border: 1px solid var(--line);
  padding: 14px 18px;
  border-radius: 10px;
  display: flex; justify-content: space-between; align-items: center;
  transition: all .2s;
}
.history-item:hover { border-color: var(--blue); transform: translateX(2px); }
.history-q { font-weight: 500; color: var(--navy); }
.history-meta { font-size: 0.85rem; color: var(--ink-mute); }

/* ============================================================
   FEATURES (5 piliers sous le hero, comme l'image)
   ============================================================ */

.features-strip {
  background: var(--cream);
  padding: 40px 0;
  border-top: 1px solid rgba(11, 31, 58, 0.06);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 30px;
}
.feature {
  text-align: center;
}
.feature-icon {
  width: 48px; height: 48px;
  margin: 0 auto 14px;
  color: var(--blue);
}
.feature-icon svg { width: 100%; height: 100%; }
.feature h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 8px;
}
.feature p { font-size: 0.88rem; color: var(--ink-soft); margin: 0; line-height: 1.5; }
.feature:nth-child(4) .feature-icon { color: var(--sage-light); }
.feature:nth-child(2) .feature-icon { color: var(--sage); }
.feature:nth-child(3) .feature-icon { color: var(--navy); }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.7);
  padding-top: 60px;
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  padding-bottom: 40px;
}
.footer-brand p { font-style: italic; color: rgba(255, 255, 255, 0.6); }
.footer-logo {
  display: flex; align-items: center; gap: 10px;
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.footer-logo svg { width: 32px; height: 32px; color: var(--blue); }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.footer-col h4 {
  color: white;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  font-family: var(--font-body);
  font-weight: 600;
}
.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  padding: 4px 0;
  font-size: 0.92rem;
}
.footer-col a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-mascot { order: -1; max-width: 320px; margin: 0 auto; }
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 720px) {
  .container { padding: 0 18px; }
  .header-inner { height: 64px; }
  .main-nav {
    position: fixed; inset: 64px 0 auto 0;
    background: white;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%);
    transition: transform .25s;
    box-shadow: var(--shadow);
  }
  body.nav-open .main-nav { transform: translateY(0); }
  .mobile-toggle {
    display: flex; flex-direction: column; gap: 5px;
    background: transparent; border: 0; cursor: pointer; padding: 8px;
  }
  .mobile-toggle span {
    display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px;
  }
  .hero { padding: 50px 0 40px; }
  .search-form { flex-direction: column; padding: 8px; }
  .search-form input[type="text"] { width: 100%; padding: 14px 16px; }
  .search-form button { width: 100%; justify-content: center; }
  .section { padding: 50px 0; }
  .features-grid { grid-template-columns: 1fr; }
  .law-detail-header, .law-detail-body { padding: 24px 22px; }
  .auth-card { padding: 32px 22px; }
}
