@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;600&display=swap');

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

:root {
  --bg:      #F2F6FB;
  --card:    #FFFFFF;
  --border:  #DCE6F2;
  --text:    #1C2B3A;
  --muted:   #6B7E94;
  --cyan:    #0891B2;
  --cyan-l:  #E0F2FE;
  --orange:  #F97316;
  --orange-l:#FFF7ED;
  --green:   #16A34A;
  --red:     #DC2626;
  --yellow:  #D97706;
  --radius:  10px;
  --shadow:  0 1px 4px rgba(28,43,58,.08);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* AUTH */
#auth-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
  background: linear-gradient(160deg, #071220 0%, #0c1f3d 55%, #071425 100%);
  position: relative; overflow: hidden;
}
#auth-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; display: block;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 4px 24px rgba(8,145,178,.1);
}
#auth-screen .auth-card {
  position: relative; z-index: 2;
  background: rgba(255,255,255,.97);
  box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(8,145,178,.25);
}
.auth-card h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--cyan); text-align: center; margin-bottom: .25rem;
}
.auth-card .subtitle {
  text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 1.5rem;
}
.auth-tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; }
.auth-tab {
  flex: 1; padding: .5rem; border: 1px solid var(--border);
  border-radius: 6px; background: none; cursor: pointer;
  font-family: inherit; font-size: .85rem; color: var(--muted); transition: all .15s;
}
.auth-tab.active { background: var(--cyan); color: #fff; border-color: var(--cyan); }

/* FORMS */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); margin-bottom: .3rem; }
.form-group input {
  width: 100%; padding: .55rem .75rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: .9rem; color: var(--text);
  background: var(--bg); transition: border-color .15s;
}
.form-group input:focus { outline: none; border-color: var(--cyan); }
.error-msg { color: var(--red); font-size: .8rem; margin-top: .5rem; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: 6px;
  border: none; cursor: pointer; font-family: inherit;
  font-size: .85rem; font-weight: 600; transition: all .15s;
}
.btn-primary   { background: var(--cyan);   color: #fff; }
.btn-primary:hover { background: #0779A0; }
.btn-orange    { background: var(--orange); color: #fff; }
.btn-orange:hover { background: #ea6c10; }
.btn-outline   { background: none; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-danger    { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm        { padding: .3rem .65rem; font-size: .78rem; }
.btn-full      { width: 100%; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* APP LAYOUT */
#app-screen { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: .75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; top: 0; z-index: 100;
}
.topbar-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem; font-weight: 700; color: var(--cyan);
  white-space: nowrap;
}
.topbar-stats {
  display: flex; gap: 1.25rem; font-size: .78rem;
  font-family: 'IBM Plex Mono', monospace;
}
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-label { color: var(--muted); font-size: .68rem; }
.stat-val   { font-weight: 600; }
.stat-val.green  { color: var(--green); }
.stat-val.red    { color: var(--red); }
.stat-val.cyan   { color: var(--cyan); }
.stat-val.orange { color: var(--orange); }

/* TABS */
.tabs-bar {
  background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; overflow-x: auto; padding: 0 1rem;
}
.tab-btn {
  padding: .7rem 1.1rem; border: none; background: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: .83rem; font-weight: 500;
  color: var(--muted); border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all .15s;
  text-decoration: none; display: inline-block;
}
.tab-btn.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab-btn:hover  { color: var(--text); }

.tab-content { display: none; padding: 1.25rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.tab-content.active { display: block; }

/* CARDS */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 600; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }

/* HEX GRID */
.hex-grids-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.hex-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.hex-card h3 { font-family: 'Space Grotesk', sans-serif; font-size: .9rem; font-weight: 600; margin-bottom: .5rem; }
.hex-card h3.mobile { color: var(--cyan); }
.hex-card h3.fiber  { color: var(--orange); }
.hex-svg { width: 100%; height: auto; display: block; }
.hex-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; font-size: .78rem; color: var(--muted); }
.hex-meta b { font-family: 'IBM Plex Mono', monospace; }

/* INFRA GRID */
.infra-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: .75rem; }
.infra-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: .9rem; cursor: pointer; transition: all .15s;
}
.infra-item:hover { border-color: var(--cyan); background: var(--cyan-l); }
.infra-item.disabled { opacity: .5; cursor: not-allowed; }
.infra-item.disabled:hover { border-color: var(--border); background: var(--bg); }
.infra-name { font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
.infra-cost { font-family: 'IBM Plex Mono', monospace; font-size: .78rem; color: var(--orange); }
.infra-detail { font-size: .72rem; color: var(--muted); margin-top: .2rem; }
.infra-qty { font-family: 'IBM Plex Mono', monospace; font-size: 1.2rem; font-weight: 700; color: var(--cyan); }

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.data-table th { text-align: left; padding: .5rem .75rem; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.data-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* BADGES */
.badge {
  display: inline-block; padding: .15rem .5rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600;
}
.badge-cyan   { background: var(--cyan-l);   color: var(--cyan);   }
.badge-orange { background: var(--orange-l); color: var(--orange); }
.badge-green  { background: #DCFCE7; color: var(--green); }
.badge-red    { background: #FEE2E2; color: var(--red); }
.badge-gray   { background: #F1F5F9; color: var(--muted); }

/* PROGRESS BAR */
.progress-wrap { background: var(--border); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar  { height: 100%; border-radius: 4px; transition: width .3s; }
.progress-bar.cyan   { background: var(--cyan); }
.progress-bar.orange { background: var(--orange); }
.progress-bar.red    { background: var(--red); }

/* REPUTATION BAR */
.rep-bar { display: flex; align-items: center; gap: .75rem; }
.rep-bar .progress-wrap { flex: 1; height: 8px; }

/* KPI ROW */
.kpi-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.kpi-card {
  flex: 1; min-width: 120px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: .75rem 1rem;
}
.kpi-label { font-size: .72rem; color: var(--muted); margin-bottom: .2rem; }
.kpi-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.15rem; font-weight: 700;
}

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(28,43,58,.4);
  display: flex; align-items: center; justify-content: center; z-index: 9000; padding: 1rem;
}
.modal-box {
  background: var(--card); border-radius: 12px;
  padding: 1.75rem; width: 100%; max-width: 620px;
  max-height: 90dvh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(28,43,58,.15);
  display: flex; flex-direction: column;
}
.modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; }
.modal-actions {
  display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.25rem;
  position: sticky; bottom: -1.75rem; margin-left: -1.75rem; margin-right: -1.75rem;
  padding: .75rem 1.75rem; background: var(--card);
  border-top: 1px solid var(--border);
}

/* JOURNAL */
#journal-panel {
  background: var(--card); border-top: 1px solid var(--border);
  padding: .75rem 1.25rem; max-height: 180px; overflow-y: auto;
}
.journal-title { font-family: 'Space Grotesk', sans-serif; font-size: .85rem; font-weight: 600; margin-bottom: .5rem; color: var(--muted); }
.journal-entry { font-size: .78rem; padding: .2rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .75rem; }
.journal-entry:last-child { border-bottom: none; }
.journal-tick { font-family: 'IBM Plex Mono', monospace; color: var(--muted); min-width: 40px; }
.journal-msg  { flex: 1; }
.journal-amt  { font-family: 'IBM Plex Mono', monospace; font-weight: 600; min-width: 90px; text-align: right; }
.journal-amt.pos { color: var(--green); }
.journal-amt.neg { color: var(--red); }

/* TICK TIMER */
.tick-badge {
  background: var(--cyan-l); color: var(--cyan); border-radius: 6px;
  padding: .25rem .6rem; font-family: 'IBM Plex Mono', monospace; font-size: .75rem;
}

/* LEADERBOARD */
.leader-rank { font-family: 'IBM Plex Mono', monospace; font-weight: 700; color: var(--orange); min-width: 28px; }
.leader-self { background: var(--cyan-l); }

/* OFFER FORM */
.offer-type-toggle { display: flex; gap: .5rem; margin-bottom: 1rem; }
.offer-type-btn {
  flex: 1; padding: .5rem; border: 1px solid var(--border);
  border-radius: 6px; background: none; cursor: pointer;
  font-family: inherit; font-size: .85rem; color: var(--muted); transition: all .15s;
}
.offer-type-btn.active.mobile { background: var(--cyan-l); color: var(--cyan); border-color: var(--cyan); }
.offer-type-btn.active.fixed  { background: var(--orange-l); color: var(--orange); border-color: var(--orange); }

/* SECTION HEADER */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.section-title  { font-family: 'Space Grotesk', sans-serif; font-size: .95rem; font-weight: 600; }

/* AUCTION */
.auction-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; margin-bottom: .75rem;
}
.auction-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.auction-block { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: .95rem; }
.auction-timer { font-family: 'IBM Plex Mono', monospace; font-size: .8rem; color: var(--muted); }

/* TECH TREE */
.tech-chain {
  display: flex; align-items: stretch; gap: 0; overflow-x: auto;
  padding-bottom: .5rem; min-height: 170px;
}
.tech-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--border); font-size: 1.1rem; padding: 0 .3rem;
  flex-shrink: 0; margin-top: 2rem;
}
.tech-node {
  flex-shrink: 0; width: 108px; border-radius: 8px;
  padding: .7rem .55rem; text-align: center; border: 2px solid transparent;
  transition: all .15s; font-size: .75rem; position: relative;
}
.tech-node.tech-done        { background: #DCFCE7; border-color: var(--green);  }
.tech-node.tech-avail       { background: var(--cyan-l); border-color: var(--cyan); cursor: pointer; }
.tech-node.tech-avail:hover { box-shadow: 0 0 0 3px rgba(8,145,178,.25); }
.tech-node.tech-unlock      { background: #FFFBEB; border-color: var(--yellow); }
.tech-node.tech-locked      { background: #F8FAFC; border-color: var(--border); opacity: .6; }
.tech-node.tech-in-research { background: #FFF7ED; border-color: var(--orange); animation: pulse-border 2s infinite; }
@keyframes pulse-border { 0%,100%{box-shadow:0 0 0 0 rgba(249,115,22,.4)} 50%{box-shadow:0 0 0 4px rgba(249,115,22,0)} }
.tech-icon { font-size: 1.4rem; margin-bottom: .25rem; }
.tech-name { font-weight: 700; font-size: .72rem; margin-bottom: .15rem; line-height: 1.2; }
.tech-year { color: var(--muted); font-size: .65rem; margin-bottom: .3rem; }
.tech-cost { font-family: 'IBM Plex Mono', monospace; font-size: .67rem; color: var(--orange); margin-bottom: .4rem; }
.tech-cost.free { color: var(--green); }
.tech-status-badge {
  display: inline-block; padding: .12rem .4rem; border-radius: 10px;
  font-size: .65rem; font-weight: 700;
}
.tech-status-badge.done   { background: #BBF7D0; color: #15803D; }
.tech-status-badge.locked { background: #F1F5F9; color: var(--muted); }
.tech-desc { font-size: .65rem; color: var(--muted); margin-top: .25rem; line-height: 1.3; }
.tech-reqs { margin-top: .35rem; text-align: left; }
.tech-req  { font-size: .62rem; line-height: 1.5; }
.tech-req.ok  { color: var(--green); }
.tech-req.nok { color: var(--red); }
.tech-discount { font-size: .62rem; color: var(--orange); margin-top: .2rem; font-weight: 700; }

/* HOLDING */
.holding-member-row {
  display: flex; align-items: center; gap: .5rem; padding: .5rem;
  border-bottom: 1px solid var(--border); font-size: .82rem;
}
.holding-member-row:last-child { border-bottom: none; }
.holding-role-badge {
  display: inline-block; padding: .1rem .4rem; border-radius: 10px;
  font-size: .65rem; font-weight: 700;
}
.holding-role-badge.president { background: #FEF3C7; color: #D97706; }
.holding-role-badge.member    { background: var(--cyan-l); color: var(--cyan); }

/* WORLD MAP */
.world-layout {
  display: grid; grid-template-columns: 1fr 300px; gap: 1rem; align-items: start;
}
.world-map-wrap { min-width: 0; }
.world-map-container {
  background: #0f2133; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.world-map-container svg { width: 100%; height: auto; display: block; }
.world-legend-row {
  display: flex; align-items: center; gap: .35rem;
  padding: .4rem .75rem; font-size: .72rem; color: var(--muted);
  background: var(--card); border-top: 1px solid var(--border);
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.region-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; min-height: 300px;
  box-shadow: var(--shadow); position: sticky; top: 8rem;
}
.region-panel .kpi-row { margin-bottom: .5rem; }

/* ── Nav drawer (mobile) ────────────────────────────────────────────────────── */
#nav-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 1100; backdrop-filter: blur(2px);
}
#nav-overlay.open { display: block; }

#nav-drawer {
  position: fixed; top: 0; left: 0; height: 100dvh; width: 240px;
  background: var(--card); border-right: 1px solid var(--border);
  z-index: 1200; display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .22s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,.4);
}
#nav-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1rem; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-brand { font-weight: 700; font-size: 1rem; color: var(--cyan); }
.drawer-close {
  background: none; border: none; color: var(--muted); font-size: 1.2rem;
  cursor: pointer; padding: .2rem .4rem; border-radius: 4px; line-height: 1;
}
.drawer-close:hover { color: var(--fg); background: rgba(255,255,255,.07); }

.drawer-nav {
  display: flex; flex-direction: column; padding: .6rem .5rem; gap: .25rem;
  overflow-y: auto; flex: 1;
}
.drawer-nav .tab-btn {
  width: 100%; text-align: left; border-radius: 8px;
  padding: .6rem .85rem; font-size: .88rem;
  border: none; background: none; justify-content: flex-start;
}
.drawer-nav .tab-btn:hover { background: rgba(255,255,255,.07); }
.drawer-nav .tab-btn.active { background: rgba(8,145,178,.18); color: var(--cyan); }

.hamburger-btn {
  display: none; background: none; border: none; color: var(--fg);
  font-size: 1.35rem; cursor: pointer; padding: .2rem .5rem;
  margin-right: .25rem; line-height: 1; border-radius: 6px; flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255,255,255,.08); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .world-layout { grid-template-columns: 1fr; }
  .region-panel { position: static; }
}
@media (max-width: 768px) {
  .tabs-bar { display: none; }
  .hamburger-btn { display: block; }
  .topbar-stats { display: none; }
  #topbar-countries { display: none; }
  .topbar { padding: .5rem .75rem; gap: .4rem; }
  .topbar-btn-label { display: none; }

  /* Contenu */
  .tab-content { padding: .6rem; }
  .card { padding: .85rem; overflow-x: auto; }
  .card-title { font-size: .9rem; margin-bottom: .75rem; }

  /* Tables horizontalement scrollables */
  .data-table { min-width: 480px; }
  .data-table th, .data-table td { padding: .45rem .55rem; }

  /* KPI */
  .kpi-row { gap: .45rem; }
  .kpi-card { padding: .55rem .65rem; }
  .kpi-val { font-size: .95rem; }
  .kpi-label { font-size: .67rem; }

  /* Grilles */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .hex-grids-row { grid-template-columns: 1fr; }
  .infra-grid { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); }
  .kpi-row .kpi-card { min-width: 80px; }

  /* Modales */
  .modal-overlay { padding: .4rem; align-items: flex-end; }
  .modal-box {
    padding: 1.1rem; border-radius: 12px 12px 0 0;
    max-height: 92dvh; overflow-y: auto; max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  /* Boutons dans les tableaux */
  .btn-sm { padding: .25rem .5rem; font-size: .72rem; }

  /* Tech chain */
  .tech-chain { min-height: 150px; }
  .tech-node { width: 94px; }

  /* Section header */
  .section-header { flex-direction: column; align-items: flex-start; gap: .4rem; }

  /* Toast */
  .toast { bottom: .75rem; right: .75rem; left: .75rem; max-width: none; }
}
@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr; }
  .kpi-row { display: grid; grid-template-columns: 1fr 1fr; }
}

/* ── Company create overlay ─────────────────────────────────────────────────── */
#company-create-overlay { display: flex; }
#company-create-overlay .auth-card { width: 100%; }

/* ── Tickets ────────────────────────────────────────────────────────────────── */
.err-box { padding: .6rem .9rem; background: rgba(239,68,68,.12); border: 1px solid var(--red);
           border-radius: 8px; font-size: .8rem; color: var(--red); margin-top: .5rem; }

/* ── Region picker (tab Réseau) ─────────────────────────────────────────────── */
.net-region-pill {
  padding: .3rem .75rem; border-radius: 20px; border: 1px solid var(--border);
  background: var(--card); color: var(--muted); font-size: .78rem; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.net-region-pill:hover { border-color: var(--cyan); color: var(--fg); }
.net-region-pill.active { background: var(--cyan); border-color: var(--cyan); color: #000; font-weight: 600; }

/* ── Bandeau d'aide par onglet ──────────────────────────────────────────────── */
.tab-banner {
  width: 100%; height: 100px; display: block;
  border-radius: 10px; margin-bottom: 1rem; overflow: hidden;
}
.tab-help {
  font-size: .78rem; color: var(--muted); background: rgba(8,145,178,.07);
  border: 1px solid rgba(8,145,178,.2); border-radius: 8px;
  padding: .55rem .9rem; margin-bottom: 1rem; line-height: 1.5;
}
.tab-help b { color: var(--fg); }

/* ── Sous-onglets ───────────────────────────────────────────────────────────── */
.subtab-nav { display:flex; gap:.4rem; flex-wrap:wrap; margin-bottom:1rem; padding-bottom:.75rem; border-bottom:1px solid var(--border); }
.subtab-pill { font-size:.8rem; padding:.35rem .85rem; border-radius:20px; border:1px solid var(--border); background:transparent; color:var(--muted); cursor:pointer; transition:border-color .15s,color .15s,background .15s; text-decoration:none; display:inline-block; }
.subtab-pill.active { border-color:var(--cyan); background:rgba(8,145,178,.1); color:var(--cyan); font-weight:600; }
.subtab-pill:hover:not(.active) { border-color:var(--text); color:var(--text); }

/* ── Barre sous-onglets Entreprise ─────────────────────────────────────────── */
.entreprise-subtab-bar { display:flex; gap:.3rem; flex-wrap:wrap; background:var(--card-bg); border-bottom:2px solid var(--border); padding:.5rem .75rem; margin:-1.25rem -1.25rem 1rem; }
.ep-tab-btn { font-size:.8rem; padding:.4rem .9rem; border-radius:6px 6px 0 0; border:1px solid transparent; background:transparent; color:var(--muted); cursor:pointer; font-weight:500; transition:color .15s,background .15s,border-color .15s; text-decoration:none; display:inline-block; }
.ep-tab-btn.active { background:rgba(8,145,178,.12); color:var(--cyan); border-color:var(--cyan); border-bottom:2px solid var(--card-bg); font-weight:700; margin-bottom:-2px; }
.ep-tab-btn:hover:not(.active) { color:var(--text); background:rgba(255,255,255,.04); }

/* ── Toast notifications ────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 99999;
  padding: .6rem 1.1rem; border-radius: 8px; font-size: .85rem; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  animation: toast-in .18s ease; pointer-events: none;
  max-width: 320px;
}
.toast-ok  { background: #16a34a; color: #fff; }
.toast-err { background: #dc2626; color: #fff; }
.toast-info { background: var(--card); border: 1px solid var(--border); color: var(--fg); }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ── Offer cost hint in modal ───────────────────────────────────────────────── */
.offer-cost-hint {
  background: rgba(8,145,178,.08); border: 1px solid rgba(8,145,178,.2);
  border-radius: 6px; padding: .45rem .7rem; font-size: .77rem; margin-bottom: .5rem;
  line-height: 1.6;
}
.offer-cost-hint .margin-pos { color: var(--green); font-weight: 600; }
.offer-cost-hint .margin-neg { color: var(--red); font-weight: 600; }

/* ── Field lock overlay ──────────────────────────────────────────────────────── */
.field-lock-overlay { position: absolute; inset: 0; cursor: not-allowed; z-index: 5; }

/* ── Animations & micro-interactions ────────────────────────────────────────── */

@keyframes rs-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes rs-pop {
  0%   { transform: scale(.94); opacity: 0; }
  60%  { transform: scale(1.03); }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes rs-count {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rs-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(8,145,178,.0); }
  50%     { box-shadow: 0 0 0 6px rgba(8,145,178,.12); }
}
@keyframes prize-pop {
  0%   { transform: scale(.75); opacity: 0; }
  65%  { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}
.spin-bet-btn {
  font-size: .72rem; padding: .2rem .55rem; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text);
  transition: background .15s, color .15s, border-color .15s;
}
.spin-bet-btn.active, .spin-bet-btn:hover {
  background: var(--cyan); color: #fff; border-color: var(--cyan);
}

/* Cards — lift on hover */
.card { transition: box-shadow .2s ease, border-color .2s ease; }
.card:hover { box-shadow: 0 4px 20px rgba(8,145,178,.12); border-color: rgba(8,145,178,.25); }

/* Buttons — tactile feel */
.btn { transition: all .15s ease; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.btn-primary:hover:not(:disabled) { box-shadow: 0 2px 10px rgba(8,145,178,.3); }

/* Panel titles — colored left accent */
.panel-title {
  position: relative;
  padding-left: .85rem;
}
.panel-title::before {
  content: '';
  position: absolute;
  left: 0; top: .1em; bottom: .1em;
  width: 3px;
  background: linear-gradient(to bottom, var(--cyan), var(--green));
  border-radius: 2px;
}

/* Empty states — illustrated layout */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: .7rem; padding: 2.5rem 1rem; text-align: center;
  color: var(--muted); font-size: .83rem;
}
.empty-state svg { display: block; }
.empty-state p   { max-width: 220px; line-height: 1.55; margin: 0; }

/* Section hero illustrations */
.rs-section-hero {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem .9rem .6rem .6rem;
  background: linear-gradient(135deg, rgba(8,145,178,.06), rgba(22,163,74,.04));
  border: 1px solid rgba(8,145,178,.14);
  border-radius: 10px; margin-bottom: .9rem;
}
.rs-section-hero svg { flex-shrink: 0; }
.rs-section-hero-text p { font-size: .8rem; color: var(--muted); line-height: 1.5; margin: .2rem 0 0; }
.rs-section-hero-text strong { font-size: .92rem; color: var(--text); }

/* KPI cards — animated glow on hover */
.kpi-card { transition: box-shadow .2s ease; }
.kpi-card:hover { box-shadow: 0 0 0 2px rgba(8,145,178,.18), 0 4px 14px rgba(8,145,178,.1); }

/* Section fade-in */
.rs-anim { animation: rs-fade-up .24s ease both; }
.rs-pop  { animation: rs-pop   .22s ease both; }

/* Nav tabs glow on active */
.tab-btn.active { box-shadow: inset 0 -2px 0 var(--cyan); }

/* Tech chain arrows pulse on in-research */
.tech-in-research .tech-icon { animation: rs-glow 2.2s ease infinite; }

/* ── Tooltip universel [data-tip] — géré par JS (voir app.js _initGlobalTip) ── */
#__global_tip {
  position: fixed; z-index: 99998; pointer-events: none;
  background: #1c2b3a; color: #fff;
  font-size: .72rem; line-height: 1.5;
  padding: .4rem .7rem; border-radius: 6px;
  max-width: 300px; white-space: normal; text-align: left;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* ── Badges de difficulté (choix de carrière à l'inscription) ─────────────── */
.onboarding-type-btn { position: relative; text-align: center; }

.diff-badge {
  display: inline-flex; align-items: center; gap: .22rem;
  font-size: .58rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; white-space: nowrap;
  padding: .12rem .42rem; border-radius: 99px; border: 1px solid transparent;
}
.diff-dots { letter-spacing: .06em; font-size: .55rem; }

.diff-1 { background: #DCFCE7; color: #15803D; border-color: #86EFAC; }
.diff-2 { background: var(--cyan-l); color: var(--cyan); border-color: #7DD3FC; }
.diff-3 { background: #FEF3C7; color: var(--yellow); border-color: #FCD34D; }
.diff-4 { background: var(--orange-l); color: var(--orange); border-color: #FDBA74; }
.diff-5 { background: #FEE2E2; color: var(--red); border-color: #FCA5A5; }

.diff-why {
  font-size: .64rem; line-height: 1.35; color: var(--muted);
  border-top: 1px dashed var(--border); padding-top: .3rem; margin-top: .1rem;
}
.reco-tag {
  position: absolute; top: -.55rem; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #fff; font-size: .55rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: .1rem .45rem; border-radius: 99px; white-space: nowrap;
}
.diff-legend {
  font-size: .66rem; color: var(--muted); margin-bottom: .8rem;
  display: flex; align-items: center; justify-content: center; gap: .35rem; flex-wrap: wrap;
}

/* ── Onboarding : tenir dans l'écran quelle que soit la taille ─────────────── */
/* Sans ça, les cartes d'activités dépassent le bas de la fenêtre et le bouton
   de validation devient inatteignable (pas de scroll sur l'overlay). */
#company-create-overlay { overflow-y: auto; padding: 1rem; }

#welcome-popup,
#onboarding-choice,
#onboarding-company {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Bouton de validation toujours visible, collé en bas de la zone scrollable */
.onboarding-cta {
  position: sticky; bottom: 0; z-index: 3;
  background: var(--card);
  padding: .7rem 0 .2rem;
  margin-top: .4rem;
  box-shadow: 0 -14px 18px -14px rgba(28,43,58,.35);
}

.onboarding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
}

/* Écrans étroits : une colonne, moins de rembourrage */
@media (max-width: 620px) {
  .onboarding-grid { grid-template-columns: 1fr; }
  #welcome-popup, #onboarding-choice, #onboarding-company { padding: 1.4rem 1.1rem; }
  #welcome-popup .onboarding-grid > div[style*="grid-column"] { grid-column: auto; }
}

/* Écrans bas (portables 13", fenêtre réduite) : compacter le popup d'accueil */
@media (max-height: 820px) {
  #welcome-popup ul { line-height: 1.45; }
  #welcome-popup { padding-top: 1.6rem; padding-bottom: 1.2rem; }
}
