:root{
  --bg0:#F6F8FF;
  --bg1:#EEF2FF;
  --glass: rgba(255,255,255,.70);
  --stroke: rgba(15,23,42,.10);
  --text: rgba(15,23,42,.92);
  --muted: rgba(15,23,42,.62);
  --shadow: 0 18px 45px rgba(15,23,42,.10);
  --shadow2: 0 10px 25px rgba(15,23,42,.08);
  --r: 18px;
  --r2: 22px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
}

.glass{
  border:1px solid var(--stroke);
  background: var(--glass);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

/* ===== Login (clair) ===== */
.page-login{
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(900px 600px at 20% 15%, rgba(99,102,241,.20), transparent 60%),
    radial-gradient(850px 550px at 85% 20%, rgba(236,72,153,.14), transparent 55%),
    radial-gradient(900px 650px at 55% 95%, rgba(34,197,94,.12), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.login-shell{
  width:min(980px,100%);
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:18px;
}
@media (max-width: 860px){ .login-shell{grid-template-columns:1fr} }

.login-card{ padding:18px; border-radius: var(--r2); box-shadow: var(--shadow2); }
.login-head{ display:flex; align-items:center; justify-content:space-between; gap:14px; }
.brand{display:flex; align-items:center; gap:12px}
.brand-mark{
  width:40px;height:40px;border-radius:14px;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.9), transparent 55%),
              linear-gradient(135deg, rgba(99,102,241,.75), rgba(236,72,153,.55));
  border:1px solid rgba(15,23,42,.10);
  box-shadow: 0 12px 30px rgba(99,102,241,.12);
}
.brand h1{margin:0;font-size:16px;letter-spacing:.2px}
.brand p{margin:4px 0 0 0;font-size:12px;color:var(--muted)}

.status-pill{
  font-size:12px; padding:8px 10px; border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
  color:var(--muted);
  display:flex; align-items:center; gap:8px;
}
.status-dot{width:8px;height:8px;border-radius:999px;background:rgba(15,23,42,.25)}
.status-dot.ok{background:#22c55e}
.status-dot.bad{background:#ef4444}

.alert{
  margin:14px 0 0 0;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(239,68,68,.25);
  background: rgba(239,68,68,.08);
  font-size:13px;
}

.login-form{ margin-top:16px; }
.label{ display:block; font-size:12px; color:var(--muted); margin:0 0 8px; }

.input-row{
  display:flex; align-items:center; gap:10px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.60);
  padding:12px;
  border-radius:14px;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
input[type="password"]{
  width:100%;
  background:transparent;
  border:0; outline:0;
  color:var(--text);
  font-size:15px;
}
.lock-ic{
  width:18px;height:18px;border-radius:6px;
  background: linear-gradient(135deg, rgba(99,102,241,.35), rgba(236,72,153,.22));
  border:1px solid rgba(15,23,42,.10);
}

.btn{
  border:1px solid rgba(15,23,42,.10);
  border-radius:14px;
  padding:12px 14px;
  cursor:pointer;
  font-weight:650;
  letter-spacing:.2px;
}
.btn.primary{
  width:100%;
  margin-top:14px;
  background: linear-gradient(135deg, rgba(99,102,241,.85), rgba(236,72,153,.70));
  color:white;
  box-shadow: 0 14px 30px rgba(99,102,241,.16);
}
.btn.primary:disabled{opacity:.55; cursor:not-allowed}
.btn.ghost{
  background: rgba(255,255,255,.55);
  color: var(--text);
}
.note{ margin:12px 0 0 0; font-size:12px; color:var(--muted); line-height:1.5 }

.login-aside .aside-card{ padding:18px; border-radius: var(--r2); box-shadow: var(--shadow2); }
.login-aside h2{margin:0;font-size:14px}
.login-aside ul{margin:10px 0 0 18px; color:var(--muted); font-size:12px; line-height:1.6}

/* ===== Desktop clair ===== */
.page-desktop{
  overflow-x: hidden;   /* on bloque juste le scroll horizontal */
  overflow-y: auto;     /* on autorise le scroll vertical */
  background:
    radial-gradient(1100px 700px at 20% 10%, rgba(99,102,241,.18), transparent 60%),
    radial-gradient(1000px 650px at 85% 18%, rgba(236,72,153,.12), transparent 55%),
    radial-gradient(1000px 750px at 55% 92%, rgba(34,197,94,.10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}
.desktop-bg{
  position:fixed; inset:0;
  background:
    radial-gradient(600px 450px at 25% 70%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(500px 380px at 80% 65%, rgba(255,255,255,.60), transparent 60%);
  pointer-events:none;
}

.topbar{
  position:fixed; left:18px; right:18px; top:18px;
  height:58px;
  display:flex; align-items:center; justify-content:space-between;
  padding:0 14px;
  z-index:50;
  border-radius: 20px;
  box-shadow: var(--shadow2);
}
.topbar-left{display:flex; align-items:center; gap:10px}
.topbar-logo{
  width:30px;height:30px;border-radius:12px;
  background: linear-gradient(135deg, rgba(99,102,241,.75), rgba(236,72,153,.55));
  border:1px solid rgba(15,23,42,.10);
}
.topbar-muted{color:var(--muted); font-size:12px}
.topbar-right{display:flex; align-items:center; gap:10px}

.chip{
  font-size:12px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
  color: var(--muted);
}

.desktop{
  position:relative;
  height:100%;
  padding:96px 18px 120px 18px;
  max-width: 1100px;
  margin: 0 auto;
}

.hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:16px 16px;
  border-radius: 24px;
  box-shadow: var(--shadow2);
}
.hero h1{margin:0; font-size:20px; letter-spacing:.2px}
.hero p{margin:6px 0 0 0; color:var(--muted); font-size:13px; line-height:1.5}
.hero-right{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.mini-card{
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
  border-radius: 18px;
  padding:10px 12px;
  min-width: 160px;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
}
.mini-title{font-size:12px; font-weight:700}
.mini-text{font-size:12px; color:var(--muted); margin-top:2px}

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

.app-icon{
  text-decoration:none;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.62);
  border-radius: 22px;
  padding:14px;
  display:flex;
  align-items:center;
  gap:12px;
  color: var(--text);
  box-shadow: 0 10px 25px rgba(15,23,42,.07);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.app-icon:hover{
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.30);
  box-shadow: 0 16px 34px rgba(15,23,42,.10);
}

.app-icon-art{
  width:54px; height:54px;
  border-radius: 18px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.70);
  box-shadow: 0 10px 20px rgba(15,23,42,.06);
  position:relative;
  overflow:hidden;
}
.caption{display:flex; flex-direction:column; gap:2px; min-width:0}
.caption-title{font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.caption-sub{font-size:12px; color:var(--muted)}
.chev{margin-left:auto; color:rgba(15,23,42,.35); font-size:20px; padding:0 4px}

/* Dock */
.dock{
  position:fixed;
  left:50%;
  bottom:18px;
  transform: translateX(-50%);
  height:66px;
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  z-index:60;
  border-radius: 22px;
  box-shadow: var(--shadow2);
}
.dock-btn{
  width:46px;height:46px;
  border-radius: 16px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.60);
  display:grid;
  place-items:center;
  transition: transform .12s ease;
}
.dock-btn:hover{transform: translateY(-1px)}
.dock-ic{
  width:26px; height:26px;
  display:block;
}

/* ====== Icônes SVG "imagées" ======
   Chaque icône est un SVG inline via background-image data: URI.
*/
.app-icon-art::after,
.dock-ic::after{
  content:"";
  position:absolute;
  inset:0;
  background-repeat:no-repeat;
  background-position:center;
  background-size: 78% 78%;
}
.dock-ic{ position:relative; }
.dock-ic::after{ background-size: 100% 100%; }

.icon-cocktail::before,
.icon-gamepad::before,
.icon-rss::before,
.icon-search::before,
.icon-travel::before{
  content:"";
  position:absolute;
  inset:-30%;
  background:
    radial-gradient(circle at 30% 20%, rgba(99,102,241,.25), transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(236,72,153,.18), transparent 55%),
    radial-gradient(circle at 55% 85%, rgba(34,197,94,.14), transparent 60%);
  transform: rotate(12deg);
}

.icon-cocktail::after{
  background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'>\
<defs><linearGradient id='g' x1='0' x2='1'><stop stop-color='%236366F1'/><stop offset='1' stop-color='%23EC4899'/></linearGradient></defs>\
<path d='M14 10h36L36 30v10l8 10H20l8-10V30L14 10z' fill='white' opacity='.92'/>\
<path d='M18 12h28l-10 12H28L18 12z' fill='url(%23g)' opacity='.55'/>\
<path d='M32 40v14' stroke='white' stroke-width='4' stroke-linecap='round'/>\
<path d='M24 56h16' stroke='white' stroke-width='4' stroke-linecap='round'/>\
<circle cx='44' cy='18' r='4' fill='%23F59E0B' opacity='.9'/>\
<path d='M44 18l6-6' stroke='%23F59E0B' stroke-width='3' stroke-linecap='round'/>\
</svg>");
}

.icon-gamepad::after{
  background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'>\
<path d='M20 24h24c8 0 14 6 14 14v2c0 6-5 10-11 8l-6-2H23l-6 2c-6 2-11-2-11-8v-2c0-8 6-14 14-14z' fill='white' opacity='.92'/>\
<path d='M24 34h8' stroke='%230F172A' stroke-opacity='.5' stroke-width='4' stroke-linecap='round'/>\
<path d='M28 30v8' stroke='%230F172A' stroke-opacity='.5' stroke-width='4' stroke-linecap='round'/>\
<circle cx='44' cy='34' r='3.5' fill='%236366F1'/>\
<circle cx='50' cy='38' r='3.5' fill='%23EC4899'/>\
</svg>");
}

.icon-rss::after{
  background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'>\
<path d='M16 46a4 4 0 1 0 0 8a4 4 0 0 0 0-8z' fill='white'/>\
<path d='M14 30c12 0 20 8 20 20' fill='none' stroke='white' stroke-width='6' stroke-linecap='round'/>\
<path d='M14 14c20 0 36 16 36 36' fill='none' stroke='white' stroke-width='6' stroke-linecap='round' opacity='.92'/>\
<path d='M54 10v14H40' fill='none' stroke='%236366F1' stroke-width='5' stroke-linecap='round' opacity='.6'/>\
</svg>");
}

.icon-search::after{
  background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'>\
<circle cx='28' cy='28' r='14' fill='white' opacity='.92'/>\
<circle cx='28' cy='28' r='10' fill='%236366F1' opacity='.35'/>\
<path d='M38 38l12 12' stroke='white' stroke-width='6' stroke-linecap='round'/>\
<path d='M24 26c2-3 7-4 10-1' stroke='%230F172A' stroke-opacity='.35' stroke-width='3' stroke-linecap='round'/>\
</svg>");
}

.icon-travel::after{
  background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'>\
<path d='M32 8l10 18-10 6-10-6L32 8z' fill='white' opacity='.92'/>\
<path d='M32 32v24' stroke='white' stroke-width='6' stroke-linecap='round'/>\
<path d='M18 40c8 6 20 6 28 0' fill='none' stroke='%2322C55E' stroke-width='5' stroke-linecap='round' opacity='.6'/>\
<path d='M12 20c10-4 30-4 40 0' fill='none' stroke='%236366F1' stroke-width='4' stroke-linecap='round' opacity='.5'/>\
</svg>");
}

/* pour le dock (icônes sans tile) */
.dock-ic::after{ position:absolute; inset:0; }
.dock-ic.icon-cocktail::after{ background-image: inherit; }
.dock-ic.icon-gamepad::after{ background-image: inherit; }
.dock-ic.icon-rss::after{ background-image: inherit; }
.dock-ic.icon-search::after{ background-image: inherit; }
.dock-ic.icon-travel::after{ background-image: inherit; }

/* Hack: on réutilise le même SVG que les tiles */
.dock-ic.icon-cocktail{ background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><defs><linearGradient id='g' x1='0' x2='1'><stop stop-color='%236366F1'/><stop offset='1' stop-color='%23EC4899'/></linearGradient></defs><path d='M14 10h36L36 30v10l8 10H20l8-10V30L14 10z' fill='rgba(15,23,42,0.85)' opacity='.85'/><path d='M18 12h28l-10 12H28L18 12z' fill='url(%23g)' opacity='.55'/><path d='M32 40v14' stroke='rgba(15,23,42,0.75)' stroke-width='4' stroke-linecap='round'/><path d='M24 56h16' stroke='rgba(15,23,42,0.75)' stroke-width='4' stroke-linecap='round'/><circle cx='44' cy='18' r='4' fill='%23F59E0B' opacity='.9'/><path d='M44 18l6-6' stroke='%23F59E0B' stroke-width='3' stroke-linecap='round'/></svg>"); background-repeat:no-repeat; background-position:center; background-size:100% 100%; }
.dock-ic.icon-gamepad{ background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><path d='M20 24h24c8 0 14 6 14 14v2c0 6-5 10-11 8l-6-2H23l-6 2c-6 2-11-2-11-8v-2c0-8 6-14 14-14z' fill='rgba(15,23,42,0.85)' opacity='.85'/><path d='M24 34h8' stroke='rgba(255,255,255,.65)' stroke-width='4' stroke-linecap='round'/><path d='M28 30v8' stroke='rgba(255,255,255,.65)' stroke-width='4' stroke-linecap='round'/><circle cx='44' cy='34' r='3.5' fill='%236366F1'/><circle cx='50' cy='38' r='3.5' fill='%23EC4899'/></svg>"); background-repeat:no-repeat; background-position:center; background-size:100% 100%; }
.dock-ic.icon-rss{ background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><path d='M16 46a4 4 0 1 0 0 8a4 4 0 0 0 0-8z' fill='rgba(15,23,42,0.85)'/><path d='M14 30c12 0 20 8 20 20' fill='none' stroke='rgba(15,23,42,0.85)' stroke-width='6' stroke-linecap='round'/><path d='M14 14c20 0 36 16 36 36' fill='none' stroke='rgba(15,23,42,0.85)' stroke-width='6' stroke-linecap='round' opacity='.92'/></svg>"); background-repeat:no-repeat; background-position:center; background-size:100% 100%; }
.dock-ic.icon-search{ background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><circle cx='28' cy='28' r='14' fill='rgba(15,23,42,0.85)' opacity='.85'/><path d='M38 38l12 12' stroke='rgba(15,23,42,0.85)' stroke-width='6' stroke-linecap='round'/></svg>"); background-repeat:no-repeat; background-position:center; background-size:100% 100%; }
.dock-ic.icon-travel{ background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><path d='M32 8l10 18-10 6-10-6L32 8z' fill='rgba(15,23,42,0.85)' opacity='.85'/><path d='M32 32v24' stroke='rgba(15,23,42,0.85)' stroke-width='6' stroke-linecap='round'/></svg>"); background-repeat:no-repeat; background-position:center; background-size:100% 100%; }

/* ===== Topbar link ===== */
.topbar-home{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:inherit;
}

/* ===== Hero premium split ===== */
.hero-split{ border-radius: 26px; }
.hero-actions{ margin-top: 12px; display:flex; gap:10px; flex-wrap:wrap; }

/* ===== Tool premium ===== */
.tool-card-premium{
  margin-top:14px;
  padding:16px;
  border-radius: 26px;
  box-shadow: 0 14px 34px rgba(15,23,42,.09);
}
.input-row-premium{
  border-radius: 18px;
  padding:10px 10px;
  gap:10px;
}
.tool-btn-inline{
  width:auto;
  margin-top:0;
  height:44px;
  padding:10px 14px;
  border-radius: 14px;
}
.hint{
  margin-top:8px;
  font-size:12px;
  color: var(--muted);
}
.tool-meta{
  margin-top:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.meta-pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
  color: rgba(15,23,42,.70);
}
.meta-soft{
  background: rgba(99,102,241,.10);
}

/* ===== Results polish ===== */
.results-grid{ margin-top:14px; }
.result-card{
  border-radius: 26px;
  padding:16px;
}
.card-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.card-title::after{
  content:"";
  width:10px;height:10px;border-radius:999px;
  background: rgba(99,102,241,.35);
  box-shadow: 0 0 0 6px rgba(99,102,241,.08);
}
.chart-wrap{ height: 280px; }
.big-value{ font-size: 40px; }

.country-list{
  margin-top:10px;
  display:grid;
  gap:8px;
}

.country-line{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  border-radius: 18px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
}

.country-line strong{
  color: rgba(15,23,42,.88);
}


/* ===== Individu: blocs lisibles ===== */
.info-header{
  margin-top:14px;
  padding:14px 16px;
  border-radius: 26px;
  box-shadow: 0 14px 34px rgba(15,23,42,.09);
}
.kicker{
  font-size:12px;
  color: var(--muted);
  font-weight:700;
  letter-spacing:.2px;
}
.h2{
  margin:6px 0 0 0;
  font-size:18px;
}
.title-line{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}

.status{
  margin-top:10px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.10);
  font-size:12px;
  color: rgba(15,23,42,.72);
  background: rgba(255,255,255,.55);
}
.status::before{
  content:"";
  width:9px;height:9px;border-radius:999px;
  background: rgba(15,23,42,.25);
}
.status-ok::before{background:#22c55e}
.status-bad::before{background:#ef4444}

.info-grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}

.info-block{
  grid-column: span 6;
  padding:16px;
  border-radius: 26px;
  box-shadow: 0 10px 25px rgba(15,23,42,.07);
}
.info-block-wide{ grid-column: span 12; }

@media (max-width: 980px){
  .info-block{ grid-column: span 12; }
}

.info-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.info-label{
  font-size:12px;
  color: var(--muted);
  font-weight:800;
  letter-spacing:.2px;
}
.info-main{
  margin-top:8px;
  font-size:34px;
  font-weight:900;
  color: var(--text);
  line-height:1.05;
}
.info-sub{
  margin-top:6px;
  font-size:12px;
  color: var(--muted);
}

.info-viz{ width: 220px; flex: 0 0 220px; }
@media (max-width: 520px){ .info-viz{ width: 160px; flex-basis:160px; } }

.viz-box{
  width: 100%;
  height: 160px;
  border-radius: 22px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  padding:10px;
}
.viz-box canvas{ width:100% !important; height:100% !important; }

.badge-big{
  width: 220px;
  height: 160px;
  border-radius: 22px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
  display:grid;
  place-items:center;
  font-size:46px;
  font-weight:900;
  color: rgba(99,102,241,.95);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
@media (max-width: 520px){
  .badge-big{ width:160px; height:140px; font-size:42px; }
}

/* Liste pays avec barres */
.country-list{
  margin-top:14px;
  display:grid;
  gap:10px;
}
.country-line{
  display:grid;
  grid-template-columns: 1.2fr 2.2fr .6fr;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius: 18px;
  border:1px solid rgba(15,23,42,.10);
  background: rgba(255,255,255,.55);
}
.country-name{
  font-size:12px;
  color: rgba(15,23,42,.80);
  font-weight:700;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.country-bar{
  height:10px;
  border-radius:999px;
  background: rgba(15,23,42,.08);
  overflow:hidden;
  position:relative;
}
.country-bar i{
  display:block;
  height:100%;
  border-radius:999px;
  background: linear-gradient(90deg, rgba(99,102,241,.75), rgba(236,72,153,.55));
}
.country-pct{
  text-align:right;
  font-size:12px;
  color: rgba(15,23,42,.75);
}
