/* ============================================
   LAWSTRAVELS - Stylesheet v6
   Design: vif, coloré, dégradés, mode sombre auto
   Mobile-first, PWA-ready, accessible 15-70 ans
   ============================================ */

:root {
  /* --- Couleurs de marque --- */
  --violet:      #7C3AED;
  --violet-deep: #4C1D95;
  --blue:        #2563EB;
  --cyan:        #06B6D4;
  --pink:        #EC4899;
  --amber:       #F59E0B;
  --emerald:     #10B981;

  --brand-blue:      var(--violet-deep);
  --brand-blue-soft: var(--violet);
  --brand-gold:      var(--amber);
  --brand-gold-dark: #D97706;

  /* --- Dégradés signature --- */
  --grad-hero:   linear-gradient(135deg, #7C3AED 0%, #DB2777 55%, #F59E0B 100%);
  --grad-urgent: linear-gradient(135deg, #F43F5E 0%, #F59E0B 100%);
  --grad-map:    linear-gradient(135deg, #06B6D4 0%, #2563EB 60%, #7C3AED 100%);
  --grad-gold:   linear-gradient(135deg, #F59E0B 0%, #EC4899 100%);
  --grad-brand:  linear-gradient(135deg, #7C3AED 0%, #2563EB 100%);
  /* Dégradé réservé au TEXTE : sans ambre, qui devient illisible sur fond clair */
  --grad-text:   linear-gradient(135deg, #7C3AED 0%, #DB2777 100%);

  /* Halo de survol */
  --glow:        #FF2D9B;
  --glow-soft:   rgba(255, 45, 155, 0.22);
  --glow-strong: rgba(255, 45, 155, 0.55);

  /* --- Surfaces --- */
  --bg:          #F4F4FB;
  --bg-mesh-1:   rgba(124, 58, 237, 0.10);
  --bg-mesh-2:   rgba(236, 72, 153, 0.08);
  --card-bg:     #FFFFFF;
  --card-soft:   #FAFAFF;
  --text:        #16121F;
  --text-muted:  #6B6880;
  --border:      #E7E5F2;
  --glass:       rgba(255, 255, 255, 0.72);

  /* --- Niveaux de risque --- */
  --risk-green:    #059669;
  --risk-green-bg: #D1FAE5;
  --risk-orange:   #D97706;
  --risk-orange-bg:#FEF3C7;
  --risk-red:      #E11D48;
  --risk-red-bg:   #FFE4E6;

  --shadow:    0 2px 10px rgba(76, 29, 149, 0.07), 0 1px 2px rgba(76, 29, 149, 0.05);
  --shadow-lg: 0 14px 40px rgba(76, 29, 149, 0.16);
  --shadow-col:0 8px 24px rgba(124, 58, 237, 0.28);

  --radius:    20px;
  --radius-sm: 14px;
  --header-h:  60px;
  --nav-h:     78px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Fond sombre volontairement plus clair qu'un bleu nuit :
       lisible le soir, sans donner l'impression d'un écran éteint. */
    --bg:         #1A1730;
    --bg-mesh-1:  rgba(124, 58, 237, 0.20);
    --bg-mesh-2:  rgba(236, 72, 153, 0.13);
    --card-bg:    #241F3E;
    --card-soft:  #2C2749;
    --text:       #F3F1FA;
    --text-muted: #AFA9C6;
    --border:     #3A3360;
    --glass:      rgba(36, 31, 62, 0.78);

    --risk-green-bg:  rgba(5, 150, 105, 0.18);
    --risk-orange-bg: rgba(217, 119, 6, 0.18);
    --risk-red-bg:    rgba(225, 29, 72, 0.18);

    --shadow:    0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  font-family: "Segoe UI Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Halos colorés en fond de page */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(52vw 52vw at 88% -6%, var(--bg-mesh-1), transparent 62%),
    radial-gradient(46vw 46vw at -12% 22%, var(--bg-mesh-2), transparent 60%),
    radial-gradient(40vw 40vw at 60% 108%, rgba(6, 182, 212, 0.10), transparent 62%);
  pointer-events: none;
  z-index: 0;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font: inherit; outline: none; color: var(--text); }
::selection { background: var(--violet); color: #fff; }

/* ============== HEADER ============== */
/* La barre passait sous l'horloge et les icônes système du téléphone.
   env(safe-area-inset-*) réserve la place de la barre d'état et de la
   barre de navigation gestuelle — sans effet sur navigateur de bureau. */
#app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  display: flex; align-items: center; gap: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 100;
}
.logo { flex: 1; display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; }
/* Le vrai logo, pas un carré générique */
.logo-mark {
  width: 34px; height: 34px; border-radius: 12px;
  display: block; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(15, 37, 64, 0.35);
}
.logo-text {
  letter-spacing: -0.4px;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
#lang-switcher {
  background: var(--card-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
#lang-switcher option { color: #000; background: #fff; }
.btn-icon {
  width: 38px; height: 38px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  background: var(--card-soft);
  border: 1px solid var(--border);
  transition: transform 0.15s, background 0.2s;
}
.btn-icon:hover { background: var(--violet); color: #fff; border-color: transparent; }
.btn-icon:active { transform: scale(0.92); }
.hidden { display: none !important; }

/* ============== MAIN ============== */
#app-main {
  position: relative; z-index: 1;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
}
.screen { display: none; padding: 20px 16px; }
.screen.active { display: block; animation: fadeUp 0.35s cubic-bezier(.22,.61,.36,1); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============== HERO ============== */
.hero {
  background: var(--grad-hero);
  color: #fff;
  padding: 30px 22px;
  border-radius: 26px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-col);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(255,255,255,0.28), transparent 60%),
    radial-gradient(50% 80% at 0% 100%, rgba(0,0,0,0.18), transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: "⚖";
  position: absolute;
  right: -14px; top: -34px;
  font-size: 170px;
  opacity: 0.14;
  pointer-events: none;
}
.hero h1 { font-size: 27px; font-weight: 800; line-height: 1.22; margin-bottom: 9px; letter-spacing: -0.5px; position: relative; }
.hero p { font-size: 14.5px; opacity: 0.93; line-height: 1.5; position: relative; }
.hero-orange { background: var(--grad-urgent); }
.hero-orange::after { content: "⏰"; }
.hero-gold { background: var(--grad-map); }
.hero-gold::after { content: "🌍"; }

/* ============== QUICK ACTIONS (home) ============== */
.quick-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.quick-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 15px;
  text-align: left;
  display: flex; flex-direction: column;
  gap: 3px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.25s;
  min-height: 118px;
  overflow: hidden;
}
.quick-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--grad-brand);
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.quick-card:active { transform: scale(0.97); }
.quick-card .qc-icon {
  font-size: 24px; width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-soft);
  margin-bottom: 6px;
}
.quick-card .qc-title { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -0.2px; }
.quick-card .qc-sub { font-size: 12.5px; color: var(--text-muted); line-height: 1.35; }
.quick-card.quick-urgent::before { background: var(--grad-urgent); }
.quick-card.quick-urgent .qc-icon { background: var(--risk-red-bg); }
.quick-card.quick-map::before { background: var(--grad-map); }
.quick-card.quick-map .qc-icon { background: rgba(6, 182, 212, 0.16); }

/* ============== SEARCH ============== */
.search-box { position: relative; margin-bottom: 26px; }
.search-box .search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--violet);
}
#search-input, #leaving-search {
  width: 100%;
  padding: 15px 16px 15px 46px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg);
  font-size: 15px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
#search-input::placeholder, #leaving-search::placeholder { color: var(--text-muted); }
#search-input:focus, #leaving-search:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

.section-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ============== COUNTRY GRID ============== */
.countries-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.country-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s;
  border: 1px solid var(--border);
  overflow: hidden;
}
.country-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-brand);
  opacity: 0; transition: opacity 0.2s;
}
.country-card:hover::before { opacity: 1; }
.country-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent; }
.country-card:active { transform: scale(0.97); }
.country-card .flag {
  font-size: 30px; margin-bottom: 10px;
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--card-soft);
  display: flex; align-items: center; justify-content: center;
}
.country-card .cname { font-weight: 800; font-size: 15px; color: var(--text); letter-spacing: -0.2px; }
.country-card .ccapital { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.country-card .risk-dots { display: flex; gap: 3px; margin-top: 11px; flex-wrap: wrap; }
.risk-dot { width: 7px; height: 7px; border-radius: 50%; }
.risk-dot.green  { background: var(--risk-green); }
.risk-dot.orange { background: var(--risk-orange); }
.risk-dot.red    { background: var(--risk-red); }

/* ============== COUNTRY PAGE ============== */
.country-header {
  background: var(--grad-brand);
  color: #fff;
  padding: 26px 22px;
  border-radius: 26px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-col);
}
.country-header::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(70% 100% at 100% 0%, rgba(255,255,255,0.25), transparent 60%);
}
.country-header .flag-big {
  font-size: 46px; margin-bottom: 10px;
  width: 76px; height: 76px; border-radius: 24px;
  background: rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  backdrop-filter: blur(6px);
}
.country-header h2 { font-size: 27px; font-weight: 800; margin-bottom: 14px; letter-spacing: -0.6px; position: relative; }
.country-header .info-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; font-size: 13px;
  position: relative;
}
.country-header .info-item {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.16);
  padding: 9px 11px; border-radius: 13px;
  backdrop-filter: blur(6px);
}
.country-header .info-item .label { opacity: 0.8; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.7px; display: block; font-weight: 700; }
.country-header .info-item .value { font-weight: 700; margin-top: 2px; }

/* ============== TOP 3 ============== */
.top3-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.top3-box::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-gold);
}
.top3-header { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.top3-icon {
  font-size: 18px; width: 34px; height: 34px; border-radius: 12px;
  background: var(--risk-orange-bg);
  display: flex; align-items: center; justify-content: center;
}
.top3-header h3 {
  font-size: 13px; font-weight: 800;
  color: var(--text);
  text-transform: uppercase; letter-spacing: 1px;
}
.top3-list { display: flex; flex-direction: column; gap: 9px; }
.top3-item {
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  display: flex; align-items: flex-start; gap: 11px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.top3-item:hover { box-shadow: var(--shadow); transform: translateX(2px); }
.top3-item:active { transform: scale(0.98); }
.top3-item.green  { border-left-color: var(--risk-green); }
.top3-item.orange { border-left-color: var(--risk-orange); }
.top3-item.red    { border-left-color: var(--risk-red); }
.t3-icon { font-size: 20px; flex-shrink: 0; }
.t3-body { flex: 1; min-width: 0; }
.t3-name { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 3px; }
.t3-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.t3-pill { padding: 4px 9px; border-radius: 20px; font-size: 10px; font-weight: 800; text-transform: uppercase; flex-shrink: 0; letter-spacing: 0.4px; }
.top3-item.green .t3-pill  { background: var(--risk-green-bg);  color: var(--risk-green); }
.top3-item.orange .t3-pill { background: var(--risk-orange-bg); color: var(--risk-orange); }
.top3-item.red .t3-pill    { background: var(--risk-red-bg);    color: var(--risk-red); }

/* ============== THEMES LIST ============== */
.themes-list { display: flex; flex-direction: column; gap: 10px; }
.theme-row {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
  transition: transform 0.15s, box-shadow 0.2s;
}
.theme-row:hover { transform: translateX(3px); box-shadow: var(--shadow-lg); }
.theme-row:active { transform: scale(0.98); }
.theme-row.green  { border-left-color: var(--risk-green); }
.theme-row.orange { border-left-color: var(--risk-orange); }
.theme-row.red    { border-left-color: var(--risk-red); }
.theme-row .icon {
  font-size: 22px; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--card-soft);
  display: flex; align-items: center; justify-content: center;
}
.theme-row.green .icon  { background: var(--risk-green-bg); }
.theme-row.orange .icon { background: var(--risk-orange-bg); }
.theme-row.red .icon    { background: var(--risk-red-bg); }
.theme-row .body  { flex: 1; min-width: 0; }
.theme-row .tname { font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -0.2px; }
.theme-row .tsummary { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.theme-row .pill { padding: 5px 11px; border-radius: 20px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; flex-shrink: 0; letter-spacing: 0.4px; }
.theme-row.green .pill  { background: var(--risk-green-bg);  color: var(--risk-green); }
.theme-row.orange .pill { background: var(--risk-orange-bg); color: var(--risk-orange); }
.theme-row.red .pill    { background: var(--risk-red-bg);    color: var(--risk-red); }

/* ============== THEME DETAIL (fiche approfondie) ============== */
.theme-detail { display: flex; flex-direction: column; gap: 16px; }

.td-hero {
  border-radius: 26px;
  padding: 26px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-col);
}
.td-hero.green  { background: linear-gradient(135deg, #059669 0%, #10B981 100%); }
.td-hero.orange { background: linear-gradient(135deg, #D97706 0%, #F59E0B 100%); }
.td-hero.red    { background: linear-gradient(135deg, #BE123C 0%, #F43F5E 100%); }
.td-hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(70% 100% at 100% 0%, rgba(255,255,255,0.26), transparent 60%);
  pointer-events: none;
}
.td-hero .td-icon {
  font-size: 32px;
  width: 62px; height: 62px; border-radius: 20px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  position: relative;
}
.td-hero h2 { font-size: 25px; font-weight: 800; letter-spacing: -0.5px; position: relative; }
.td-hero .td-where { font-size: 14px; opacity: 0.9; margin-top: 4px; position: relative; }
.td-hero .risk-badge {
  display: inline-block; margin-top: 14px;
  padding: 8px 18px; border-radius: 50px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.3);
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; font-size: 12px;
  position: relative;
  backdrop-filter: blur(6px);
}
.td-summary {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 15.5px; line-height: 1.6;
  box-shadow: var(--shadow);
  font-weight: 500;
}

/* Sections de la fiche */
.td-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.td-section-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.td-section-head:hover { background: var(--card-soft); }
.td-section-head .chip {
  width: 36px; height: 36px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.td-section-head h3 { flex: 1; font-size: 15px; font-weight: 800; letter-spacing: -0.2px; }
.td-section-head .caret {
  color: var(--text-muted); font-size: 13px;
  transition: transform 0.25s;
}
.td-section.open .caret { transform: rotate(180deg); }
.td-section-body { display: none; padding: 0 18px 18px; }
.td-section.open .td-section-body { display: block; animation: fadeUp 0.25s ease; }

.td-section.ok      .chip { background: var(--risk-green-bg);  color: var(--risk-green); }
.td-section.no      .chip { background: var(--risk-red-bg);    color: var(--risk-red); }
.td-section.penalty .chip { background: var(--risk-orange-bg); color: var(--risk-orange); }
.td-section.customs .chip { background: rgba(6,182,212,0.16);  color: #0891B2; }
.td-section.tips    .chip { background: rgba(124,58,237,0.14); color: var(--violet); }
.td-section.cases   .chip { background: rgba(236,72,153,0.14); color: var(--pink); }

.td-list { display: flex; flex-direction: column; gap: 9px; }
.td-li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; line-height: 1.55;
  padding: 11px 13px;
  background: var(--card-soft);
  border-radius: 13px;
  border: 1px solid var(--border);
}
.td-li .bullet { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.td-section.ok  .td-li { border-left: 3px solid var(--risk-green); }
.td-section.no  .td-li { border-left: 3px solid var(--risk-red); }
.td-section.penalty .td-li { border-left: 3px solid var(--risk-orange); }

/* Tableau des substances */
.sub-groups { display: flex; flex-direction: column; gap: 16px; }
.sub-group-title {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.sub-table { display: flex; flex-direction: column; gap: 7px; }
.sub-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.sub-main { flex: 1; min-width: 0; }
.sub-name { font-size: 14px; font-weight: 700; letter-spacing: -0.1px; }
.sub-aka { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.sub-status {
  flex-shrink: 0; padding: 5px 11px; border-radius: 20px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
  white-space: nowrap;
}
.status-legal     { background: var(--risk-green-bg);  color: var(--risk-green); }
.status-tolerated { background: rgba(132, 204, 22, 0.18); color: #4D7C0F; }
.status-rx        { background: rgba(37, 99, 235, 0.15); color: #1D4ED8; }
.status-banned    { background: var(--risk-orange-bg); color: var(--risk-orange); }
.status-severe    { background: var(--risk-red-bg);    color: var(--risk-red); }
.status-death     { background: #1F1F2E; color: #FF6B81; border: 1px solid #FF6B81; }
@media (prefers-color-scheme: dark) {
  .status-tolerated { color: #A3E635; }
  .status-rx { color: #93C5FD; }
}

/* Bandeau fiabilité de la donnée */
.td-note {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 12.5px; line-height: 1.5;
  color: var(--text-muted);
  background: var(--card-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}
.verified-chip, .estimated-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 3px 8px; border-radius: 20px;
}
.verified-chip  { background: var(--risk-green-bg); color: var(--risk-green); }
.estimated-chip { background: var(--card-soft); color: var(--text-muted); border: 1px solid var(--border); }

/* Bloc urgence en bas de fiche */
.td-emergency {
  background: linear-gradient(135deg, rgba(225,29,72,0.10), rgba(124,58,237,0.10));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px 19px;
}
.td-emergency h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 11px; }
.td-emergency .em-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.td-emergency .em-row:last-child { border-bottom: none; }
.td-emergency .em-row .k { color: var(--text-muted); }
.td-emergency .em-row .v { font-weight: 700; }

/* ============== LEAVING TOMORROW ============== */
.leaving-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 26px 22px;
  box-shadow: var(--shadow-lg);
  margin-top: 20px;
  text-align: center;
}
.leaving-flag { font-size: 56px; }
.leaving-card h2 { font-size: 24px; margin-top: 6px; letter-spacing: -0.5px; }
.leaving-subtitle {
  font-size: 12px; color: var(--risk-red);
  text-transform: uppercase; letter-spacing: 1px; font-weight: 800;
  margin: 12px 0 18px;
}
.leaving-list { list-style: none; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.leaving-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius-sm);
}
.leaving-item.green  { border-left-color: var(--risk-green); }
.leaving-item.orange { border-left-color: var(--risk-orange); }
.leaving-item.red    { border-left-color: var(--risk-red); }
.li-icon { font-size: 22px; flex-shrink: 0; }
.li-name { font-weight: 800; margin-bottom: 4px; font-size: 14px; }
.li-pill { font-size: 10px; padding: 3px 8px; border-radius: 10px; font-weight: 800; text-transform: uppercase; margin-left: 6px; }
.li-pill.green  { background: var(--risk-green-bg);  color: var(--risk-green); }
.li-pill.orange { background: var(--risk-orange-bg); color: var(--risk-orange); }
.li-pill.red    { background: var(--risk-red-bg);    color: var(--risk-red); }
.li-text { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.btn-full {
  display: block; width: 100%;
  margin-top: 18px;
  padding: 15px;
  background: var(--grad-brand);
  color: #fff;
  font-weight: 800;
  border-radius: 16px;
  font-size: 15px;
  box-shadow: var(--shadow-col);
  transition: transform 0.15s, filter 0.2s;
}
.btn-full:hover { filter: brightness(1.08); }
.btn-full:active { transform: scale(0.98); }

/* ============== WORLD MAP ============== */
.legend {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 14px;
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.legend-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: middle; }
.legend-dot.green  { background: var(--risk-green); }
.legend-dot.orange { background: var(--risk-orange); }
.legend-dot.red    { background: var(--risk-red); }
.legend-unlocked {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: #C8A96A; color: #0F2540;
  font-size: 10px; font-weight: 800; margin-right: 5px; vertical-align: middle;
}
.map-hint {
  text-align: center; font-size: 12.5px; color: var(--text-muted);
  margin: 10px 0 0; line-height: 1.5;
}
#world-map-container {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;   /* le zoom se fait dans le viewBox, pas par défilement */
}
.world-map-svg {
  width: 100%; height: auto; display: block;
  touch-action: none;          /* on gère nous-mêmes pincement et glissement */
  cursor: grab;
  user-select: none;
}
.world-map-svg:active { cursor: grabbing; }

/* Boutons de zoom */
.map-controls {
  position: absolute; right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 7px; z-index: 2;
}
.map-btn {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text); font-size: 19px; font-weight: 800; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: background .2s, transform .12s;
}
.map-btn:hover { background: var(--violet); color: #fff; border-color: transparent; }
.map-btn:active { transform: scale(0.92); }
/* Cases de la carte : le survol doit annoncer que c'est cliquable, et le
   contour rose fluo est le repère visuel commun à toute l'app. */
.map-tile { transition: transform .16s ease; transform-box: fill-box; transform-origin: center; }
.map-tile .tile-face { transition: stroke .16s ease, stroke-width .16s ease; }
.map-tile .tile-veil { transition: fill-opacity .16s ease; }

.map-tile:hover,
.map-tile:focus-visible { transform: scale(1.07); outline: none; }

.map-tile:hover .tile-face,
.map-tile:focus-visible .tile-face {
  stroke: #FF2FB4;
  stroke-width: 4.5;
  filter: drop-shadow(0 0 7px rgba(255,47,180,.95))
          drop-shadow(0 0 16px rgba(255,47,180,.55));
}
/* Au survol le voile s'efface : le pays verrouillé « s'allume » */
.map-tile:hover .tile-veil,
.map-tile:focus-visible .tile-veil { fill-opacity: .06; }

/* ============== BOTTOM NAV (flottante) ============== */
#bottom-nav {
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  height: 68px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  display: flex;
  gap: 5px;
  padding: 7px;
  z-index: 100;
  box-shadow: 0 -4px 34px rgba(124, 58, 237, 0.20), var(--shadow-lg);
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 17px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.1px;
  transition: background 0.22s, color 0.22s, transform 0.12s;
}
.nav-btn svg { width: 24px; height: 24px; }
.nav-btn:hover { background: var(--card-soft); color: var(--violet); }
/* L'onglet actif est une pastille pleine en dégradé : impossible à rater */
.nav-btn.active {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--shadow-col);
}
.nav-btn.active svg { fill: #fff; }
.nav-btn:active { transform: scale(0.94); }

/* ============== DESKTOP ============== */
@media (min-width: 768px) {
  .screen { max-width: 940px; margin: 0 auto; padding: 34px 24px; }
  .hero h1 { font-size: 36px; }
  .countries-grid { grid-template-columns: repeat(4, 1fr); }
  #app-header { padding: 0 32px; }
  .logo-text { font-size: 21px; }
  .quick-actions { grid-template-columns: 1fr 1fr; max-width: 620px; }
  #bottom-nav { max-width: 520px; margin: 0 auto; }
  .pricing-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
}

/* ============== ACCESSIBILITÉ ============== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; border-radius: 8px; }

/* ============== SURVOL : CONTOUR ROSE FLUO ============== */
/* Un halo rose lumineux sur tout ce qui est cliquable, pour qu'on voie
   immédiatement ce qui réagit. Désactivé sur écran tactile, où il n'y a
   pas de survol et où l'effet resterait collé après un appui. */
@media (hover: hover) {
  .quick-card:hover, .country-card:hover, .theme-row:hover, .top3-item:hover,
  .pricing-card:hover, .btn-full:hover, .pc-cta:hover, .btn-upgrade:hover,
  .fav-card:hover, .legal-links a:hover, .nav-btn:hover, .btn-icon:hover,
  .td-section-head:hover, .sub-row:hover, .leaving-item:hover,
  .btn-ghost:hover, .btn-mini:hover, .btn-google-app:hover, .unlock-chip:hover,
  #lang-switcher:hover, #search-input:hover, #leaving-search:hover {
    outline: 2px solid var(--glow);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--glow-soft), 0 0 20px var(--glow-strong);
    transition: outline-color .15s, box-shadow .2s;
  }
  .nav-btn.active:hover { outline-color: #fff; }

  /* Cas particulier des blocs dépliants d'une fiche : leur conteneur
     `.td-section` porte `overflow: hidden`, qui rogne tout outline dessiné
     à l'extérieur. Le halo était donc bien appliqué mais invisible.
     On dessine l'anneau EN DEDANS de l'en-tête, où rien ne le coupe. */
  .td-section-head:hover,
  .sub-row:hover {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--glow),
                inset 0 0 20px var(--glow-soft);
  }
  .td-section-head:hover { background: var(--card-soft); }

  /* En prime, le halo extérieur autour de la carte entière quand le
     navigateur sait résoudre :has(). Sans lui, l'anneau intérieur suffit. */
  .td-section:has(.td-section-head:hover) {
    box-shadow: 0 0 0 3px var(--glow-soft), 0 0 24px var(--glow-strong);
    border-color: var(--glow);
  }
}

/* ============== PORTE D'ENTRÉE : COMPTE OBLIGATOIRE ============== */
/* Tant qu'aucun compte n'est ouvert, l'app reste visible mais inerte
   derrière la fenêtre de connexion : on voit ce qu'on obtient, sans
   pouvoir s'en servir ni contourner la fenêtre. */
body.auth-locked #app-main,
body.auth-locked #bottom-nav {
  filter: blur(5px) saturate(0.6);
  pointer-events: none;
  user-select: none;
}
body.auth-locked #auth-modal { pointer-events: auto; }

/* ============== PLAN / PAYWALL / PROFIL ============== */
.plan-badge { margin-top: 14px; position: relative; }
.badge-free, .badge-lifetime {
  display: inline-block; padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 800; letter-spacing: 0.5px;
}
.badge-free { background: rgba(255,255,255,0.22); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.badge-lifetime { background: #fff; color: var(--violet-deep); }

.country-card.locked { opacity: 0.9; }
.country-card.locked .flag { filter: grayscale(0.5); }
.lock-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--grad-brand); color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; box-shadow: var(--shadow-col);
}

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(12, 10, 21, 0.75);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.modal.show { display: flex; }
.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 30px 24px;
  max-width: 480px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.32s cubic-bezier(.22,.61,.36,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(0.94); } to { opacity: 1; transform: none; } }
.modal-icon { font-size: 52px; margin-bottom: 10px; }
.modal-content h2 { margin-bottom: 12px; font-size: 23px; letter-spacing: -0.5px; }
.modal-content p { color: var(--text-muted); line-height: 1.55; margin-bottom: 22px; font-size: 14.5px; }

/* ============== CONNEXION INTÉGRÉE ============== */
.auth-content { text-align: left; }
.auth-logo { text-align: center; margin-bottom: 12px; }
.auth-logo img { border-radius: 18px; }
.auth-content h2 { text-align: center; margin-bottom: 6px; }
.auth-content p { text-align: center; margin-bottom: 20px; }
.auth-fields { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.auth-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  font-weight: 800; color: var(--text-muted); margin-top: 10px;
}
#auth-email, #auth-password {
  width: 100%; padding: 14px 15px;
  background: var(--card-soft);
  border: 1.5px solid var(--border);
  border-radius: 14px; font-size: 16px;   /* 16px : empêche le zoom auto sur iOS */
  transition: border-color .2s, box-shadow .2s;
}
#auth-email:focus, #auth-password:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}
.auth-error {
  min-height: 18px; margin: 10px 0 4px;
  font-size: 13px; font-weight: 600; color: var(--risk-red); line-height: 1.4;
}
.btn-google-app {
  width: 100%; margin-top: 10px; padding: 13px;
  background: var(--card-soft); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 14px;
  font-size: 14.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color .2s;
}
.btn-google-app:hover { border-color: var(--violet); }
.auth-switch {
  margin-top: 18px; text-align: center;
  font-size: 13.5px; color: var(--text-muted);
}
.auth-link {
  color: var(--violet); font-weight: 800; font-size: 13.5px;
  text-decoration: underline; margin-left: 4px;
}
.auth-close {
  display: block; width: 100%; margin-top: 14px; padding: 10px;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
}
.auth-close:hover { color: var(--text); }

/* Pricing */
.pricing-target { text-align: center; padding: 20px 0 16px; }
.pricing-flag { font-size: 52px; }
.pricing-cname { font-size: 20px; font-weight: 800; margin-bottom: 12px; }
.pricing-target h2 {
  font-size: 26px; margin-bottom: 8px; letter-spacing: -0.6px;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.pricing-target p { color: var(--text-muted); font-size: 14.5px; }
.pricing-grid { display: grid; gap: 14px; margin: 26px 0; }
.pricing-card {
  position: relative;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.25s;
}
.pricing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
/* Carte Premium : fond plein en dégradé, texte blanc — lisible partout */
.pricing-card.pricing-lifetime {
  background: var(--grad-hero);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-col);
}
.pricing-card.pricing-lifetime .pc-name { color: rgba(255,255,255,0.85); }
.pricing-card.pricing-lifetime .pc-desc { color: rgba(255,255,255,0.92); }
.pricing-card.pricing-lifetime .pc-price {
  color: #fff;
  background: none;
  -webkit-text-fill-color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.pricing-card.pricing-lifetime .pricing-badge {
  background: #fff; color: var(--violet-deep); box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.pricing-card.pricing-free { border-color: var(--risk-green); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--grad-hero); color: #fff;
  padding: 5px 14px; border-radius: 20px; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  box-shadow: var(--shadow-col);
}
.pc-name { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
/* Prix en couleur pleine : un dégradé de texte devient illisible
   dès que la partie claire du dégradé tombe sur le chiffre. */
.pc-price {
  font-size: 40px; font-weight: 800; margin: 8px 0; letter-spacing: -1.5px;
  color: var(--violet-deep);
}
@media (prefers-color-scheme: dark) { .pc-price { color: #C4B5FD; } }
.pc-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; min-height: 38px; line-height: 1.45; }
.pc-cta {
  display: block; width: 100%;
  padding: 13px;
  background: var(--card-soft); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-weight: 800; font-size: 14px;
  transition: transform 0.15s, filter 0.2s;
}
.pc-cta:active { transform: scale(0.98); }
.pc-cta.primary { background: var(--grad-hero); color: #fff; border-color: transparent; box-shadow: var(--shadow-col); }
.pc-cta.primary:hover { filter: brightness(1.08); }
.pricing-note { text-align: center; font-size: 12px; color: var(--text-muted); padding: 12px; line-height: 1.5; }

/* Profil */
#profile-content h2 { margin-bottom: 20px; font-size: 26px; letter-spacing: -0.6px; }
.profile-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px 19px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.profile-section h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.1px;
  color: var(--text-muted); font-weight: 800; margin-bottom: 12px;
}
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.plan-label { font-size: 17px; font-weight: 800; }
.btn-upgrade {
  background: var(--grad-hero); color: #fff;
  padding: 9px 17px; border-radius: 20px; font-weight: 800; font-size: 13px;
  box-shadow: var(--shadow-col);
  transition: transform 0.15s, filter 0.2s;
}
.btn-upgrade:hover { filter: brightness(1.08); }
.btn-upgrade:active { transform: scale(0.97); }
.unlocked-list, .favorites-list { display: flex; flex-wrap: wrap; gap: 8px; }
.unlock-chip {
  background: var(--card-soft); padding: 7px 12px; border-radius: 16px;
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--border);
}
.all-unlocked { color: var(--risk-green); font-weight: 800; }
.fav-card {
  background: var(--card-soft); padding: 9px 15px; border-radius: 20px;
  font-size: 14px; font-weight: 700;
  border: 1px solid var(--violet);
  transition: background 0.2s, color 0.2s;
}
.fav-card:hover { background: var(--violet); color: #fff; }
.legal-links { display: flex; flex-direction: column; gap: 9px; }
.legal-links a {
  color: var(--text); text-decoration: none;
  padding: 12px 14px; background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 14px; font-weight: 600;
  transition: background 0.2s, transform 0.15s;
}
.legal-links a:hover { background: var(--violet); color: #fff; transform: translateX(3px); }
.profile-debug { border-left: 4px solid var(--risk-orange); }
.btn-mini {
  padding: 8px 14px; background: var(--risk-red); color: #fff;
  border-radius: 10px; font-size: 12px; font-weight: 700;
}
.btn-ghost {
  padding: 8px 14px; background: var(--card-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; font-size: 12px; font-weight: 700;
}
.btn-ghost:hover { border-color: var(--violet); color: var(--violet); }

/* Bloc compte */
#account-section { border-left: 4px solid var(--violet); }
.account-email { font-size: 15px; font-weight: 800; word-break: break-all; }
.account-hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin: 6px 0 12px; }
.account-plan {
  display: inline-block; margin: 4px 0 12px;
  padding: 6px 13px; border-radius: 20px;
  background: var(--card-soft); border: 1px solid var(--violet);
  font-size: 13px; font-weight: 800; color: var(--violet);
}
.account-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* Accès hors ligne */
#offline-section { border-left: 4px solid var(--risk-green); }
.offline-row { display: flex; align-items: flex-start; gap: 11px; }
.offline-dot {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
  background: var(--risk-green);
  box-shadow: 0 0 0 4px var(--risk-green-bg);
}
.offline-state { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; }
.legal-publisher {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-muted); line-height: 1.6;
}
.legal-publisher a { color: var(--violet); }

/* Fiche pays : divers */
.fav-btn {
  margin-top: 14px; padding: 9px 16px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff; border-radius: 20px;
  font-size: 13px; font-weight: 700;
  position: relative;
  backdrop-filter: blur(6px);
}
.fav-btn:hover { background: rgba(255,255,255,0.34); }
.country-verified {
  margin-top: 24px; text-align: center;
  font-size: 12px; color: var(--text-muted);
  padding: 12px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ============== RTL (arabe) ============== */
html[dir="rtl"] .country-card .risk-dots { justify-content: flex-end; }
html[dir="rtl"] .country-card .ccapital { text-align: right; }
html[dir="rtl"] .top3-item,
html[dir="rtl"] .theme-row,
html[dir="rtl"] .td-li,
html[dir="rtl"] .sub-row { flex-direction: row-reverse; }
html[dir="rtl"] .theme-row,
html[dir="rtl"] .top3-item,
html[dir="rtl"] .leaving-item { border-left: none; border-right: 4px solid var(--border); }
html[dir="rtl"] .theme-row.green,  html[dir="rtl"] .top3-item.green,  html[dir="rtl"] .leaving-item.green  { border-right-color: var(--risk-green); }
html[dir="rtl"] .theme-row.orange, html[dir="rtl"] .top3-item.orange, html[dir="rtl"] .leaving-item.orange { border-right-color: var(--risk-orange); }
html[dir="rtl"] .theme-row.red,    html[dir="rtl"] .top3-item.red,    html[dir="rtl"] .leaving-item.red    { border-right-color: var(--risk-red); }
html[dir="rtl"] .quick-card::before { left: auto; right: 0; }
html[dir="rtl"] .search-box .search-icon { left: auto; right: 16px; }
html[dir="rtl"] #search-input, html[dir="rtl"] #leaving-search { padding: 15px 46px 15px 16px; }
html[dir="rtl"] .section-title::after { background: linear-gradient(270deg, var(--border), transparent); }

/* ============== BARRE DU HAUT — WEB UNIQUEMENT ============== */
/* Sur le web, les onglets remontent dans l'en-tête et un bouton de compte
   apparaît à droite. `setupWebTopNav()` déplace le noeud #bottom-nav dans
   #app-header et pose la classe `web-topnav` sur <body>.
   L'application native garde sa barre en bas : rien ici ne s'y applique. */
body.web-topnav #app-header {
  gap: 10px;
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
}
body.web-topnav .logo { flex: 0 0 auto; }
body.web-topnav .logo-text { display: none; }   /* le sigle suffit, la place va aux onglets */

/* La barre reprend sa place dans le flux de l'en-tête */
body.web-topnav #bottom-nav {
  position: static;
  height: auto;
  flex: 1 1 auto;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  gap: 6px;
  z-index: auto;
}
body.web-topnav .nav-btn {
  flex: 0 1 auto;
  flex-direction: row;            /* icône et texte côte à côte : plus compact en haut */
  gap: 7px;
  padding: 8px 14px;
  border-radius: 13px;
  font-size: 13px;
  border: 2px solid transparent;  /* réservé pour que le contour rose ne décale rien */
}
body.web-topnav .nav-btn svg { width: 18px; height: 18px; }

/* Onglet actif : fond violet, comme avant, plus le contour rose demandé */
body.web-topnav .nav-btn.active {
  background: var(--grad-brand);
  color: #fff;
  border-color: var(--glow);
  box-shadow: 0 0 0 3px var(--glow-soft), 0 0 18px var(--glow-strong);
}
body.web-topnav .nav-btn:hover:not(.active) {
  background: var(--card-soft);
  border-color: var(--glow);
  color: var(--violet);
}

/* Le contenu n'a plus de barre en bas à éviter */
body.web-topnav .screen { padding-bottom: 28px; }

/* Bouton connexion / déconnexion, à droite de la barre */
body.web-topnav #header-auth {
  flex: 0 0 auto;
  padding: 8px 15px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  background: var(--grad-hero);
  color: #fff;
  border: 2px solid transparent;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
/* Une fois connecté, se déconnecter est une action secondaire : on la
   sort du dégradé pour qu'elle n'attire plus l'oeil comme un appel à l'action. */
body.web-topnav #header-auth.is-in {
  background: var(--card-soft);
  color: var(--text);
  border-color: var(--border);
}
body.web-topnav #header-auth:hover {
  border-color: var(--glow);
  box-shadow: 0 0 0 3px var(--glow-soft), 0 0 18px var(--glow-strong);
  transform: translateY(-1px);
}
body.web-topnav #header-auth:active { transform: translateY(0); }

/* Écrans étroits : on garde les onglets en haut mais sans les libellés,
   sinon la barre déborde. */
@media (max-width: 720px) {
  body.web-topnav .nav-btn span { display: none; }
  body.web-topnav .nav-btn { padding: 8px 11px; }
  body.web-topnav #lang-switcher { padding: 6px 7px; font-size: 12px; }
  body.web-topnav #header-auth { padding: 8px 11px; font-size: 12px; }
}

/* ============== « DEMAIN » : MES FAVORIS / MES PAYS / À RETENIR ============== */
/* Chaque bloc respire : on doit voir d'un coup d'oeil qu'il y en a trois. */
.lv-section { margin: 0 0 40px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.lv-section:last-child { border-bottom: none; padding-bottom: 8px; margin-bottom: 12px; }
.lv-section:first-child { margin-top: 26px; }
.lv-title {
  font-size: 17px; font-weight: 800; letter-spacing: -0.3px;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.lv-empty {
  color: var(--text-muted); font-size: 14px; line-height: 1.6;
  background: var(--card-soft); border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm); padding: 16px 18px;
}

/* Vignettes de pays : une ligne qui défile plutôt qu'une grille, pour que
   « mes pays » reste lisible même avec beaucoup d'entrées. */
.lv-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.lv-chip {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 15px 11px 12px;
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  cursor: pointer; text-align: left; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
/* Le survol doit dire « je suis cliquable » sans ambiguite : contour rose
   franc, halo, et un fond legerement teinte. */
.lv-chip:hover, .lv-chip:focus-visible {
  border-color: var(--glow);
  background: linear-gradient(135deg, rgba(255,45,155,.10), rgba(124,58,237,.07));
  box-shadow: 0 0 0 4px var(--glow-soft), 0 0 26px var(--glow-strong);
  transform: translateY(-3px);
  outline: none;
}
.lv-chip:hover .lv-name { color: var(--violet-deep); }
.lv-chip:active { transform: translateY(-1px); }
.lv-flag { font-size: 26px; line-height: 1; }
.lv-txt { display: flex; flex-direction: column; }
.lv-name { font-weight: 800; font-size: 14.5px; color: var(--text); }
.lv-sub { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.lv-recent-label { margin: 12px 0 8px; }

.lv-premium {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grad-gold); color: #fff;
  padding: 10px 17px; border-radius: 999px;
  font-weight: 800; font-size: 14px; box-shadow: var(--shadow-col);
}

/* Le pense-bête : ce qu'il faut avoir en tête en descendant de l'avion */
.lv-card {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-lg);
}
.lv-remember-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.lv-flag-big { font-size: 42px; line-height: 1; }
.lv-remember-name { font-size: 19px; font-weight: 800; letter-spacing: -0.4px; }

.lv-rules { list-style: none; padding: 0; margin: 0 0 16px; }
.lv-rule {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--risk-red-bg); border-radius: var(--radius-sm);
  border-left: 4px solid var(--risk-red);
}
.lv-rule-ok { background: var(--risk-green-bg); border-left-color: var(--risk-green); }
.lv-rule-icon { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.lv-rule strong { display: block; font-size: 14px; margin-bottom: 2px; }
.lv-rule-txt { font-size: 13.5px; line-height: 1.55; color: var(--text); }

.lv-facts {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
  font-size: 13px; color: var(--text-muted);
}
.lv-facts span {
  background: var(--card-soft); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 13px;
}
.lv-facts strong { color: var(--text); }
