@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #faf8f4;
  --ink: #111827;
  --muted: #5c667a;
  --border: #e6e1d7;

  /* Palette inspirée des vidéos (crépuscule indigo + lueur ambre dorée) */
  --twilight: #111827;
  --twilight-2: #1a243b;
  --accent: #d97706;
  --accent-strong: #ea580c;
  --accent-soft: #fef3c7;
  --indigo: #2563eb;
  --indigo-soft: #eff6ff;
  --emerald: #047857;
  --emerald-soft: #ecfdf5;
  --radius: 16px;
  --shadow-sm: 0 2px 10px rgba(17, 24, 39, 0.05);
  --shadow-md: 0 10px 28px rgba(17, 24, 39, 0.09);
}

* { box-sizing: border-box; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.app-shell > main {
  min-width: 0;
  max-width: 100%;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}

/* Fond ambiant subtil (détails lumineux animés) */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient-bg::before,
.ambient-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: driftOrb 16s ease-in-out infinite alternate;
}
.ambient-bg::before {
  width: 380px;
  height: 380px;
  top: -120px;
  right: 8%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.32), transparent 70%);
}
.ambient-bg::after {
  width: 420px;
  height: 420px;
  bottom: -160px;
  left: 22%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18), transparent 70%);
  animation-delay: -7s;
}

@keyframes driftOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(28px, -22px) scale(1.08); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Layout principal (sans z-index fixe pour ne pas piéger le tiroir mobile sous le backdrop) */
.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: 304px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #0d1322 0%, #141d33 55%, #0f172a 100%);
  color: #e2e8f0;
  padding: 26px 18px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar .logo {
  padding: 2px 8px 24px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}
.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.38);
  flex-shrink: 0;
}
.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.brand-name span { color: #f59e0b; }

/* Barre latérale aérée par groupes logiques (gros titres, sans numéros forcés) */
.nav-groups {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 10px 0 6px;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-group-label {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  padding: 0 12px 4px;
}
.nav-group + .nav-group {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.nav-group.offset-group {
  padding-left: 8px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 14px;
  color: #94a3b8;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  transform: translateX(4px);
}
.nav-step-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.nav-step-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.nav-step-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #d8e0ec;
}
.nav-step-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-link:hover .nav-step-title { color: #ffffff; }
.nav-link:hover .nav-step-icon {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2) 0%, rgba(234, 88, 12, 0.05) 100%);
  border-color: rgba(245, 158, 11, 0.36);
  box-shadow: inset 3px 0 0 #f59e0b;
}
.nav-link.active .nav-step-icon {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.4);
}
.nav-link.active .nav-step-title { color: #ffffff; }
.nav-link.active .nav-step-sub { color: #fcd34d; }

/* Gros carré d'entrée Profil sur l'accueil */
.home-stage-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr;
  gap: 24px;
  align-items: stretch;
  margin-top: 24px;
}
.profile-portal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 310px;
  padding: 32px;
  border-radius: 22px;
  background: linear-gradient(145deg, #111827 0%, #1a243b 62%, #7c2d12 100%);
  color: #ffffff;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(17, 24, 39, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.28);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}
.profile-portal-card::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -70px;
  top: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35), transparent 68%);
  pointer-events: none;
}
.profile-portal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 52px rgba(17, 24, 39, 0.3);
  border-color: rgba(251, 191, 36, 0.6);
}
.next-steps-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}
.pathway-tile {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.pathway-tile:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.pathway-tile-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
@media (max-width: 960px) {
  .home-stage-grid { grid-template-columns: 1fr; }
}

.svg-ico {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.svg-ico-lg { width: 21px; height: 21px; }
.svg-ico-sm { width: 14px; height: 14px; }

/* Badges de vérification 10 agents */
.verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.verified-pill.warn {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.verified-pill.danger {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
}
.agent-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px 14px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.agent-card:hover {
  border-color: #d6ccbc;
  transform: translateY(-2px);
}
.agent-code {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--twilight);
  color: #fde68a;
}

.continent-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.continent-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}
.continent-chip:hover { border-color: var(--accent); color: var(--accent-strong); }
.continent-chip.active {
  background: var(--twilight);
  color: #fde68a;
  border-color: var(--twilight);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
}
.sidebar-card {
  padding: 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 12px;
}

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 55;
}
.sidebar-backdrop.open { display: block; }

/* Barre de navigation inférieure native sur téléphone */
.mobile-bottom-nav {
  display: none;
}

/* Menu feuille mobile "Plus" (toujours net, au-dessus de tout) */
.mobile-more-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 19, 34, 0.58);
  z-index: 65;
}
.mobile-more-backdrop.open { display: block; }

.mobile-more-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  background: #0f172a;
  color: #f8fafc;
  border-top: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 22px 22px 0 0;
  padding: 12px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -18px 46px rgba(0, 0, 0, 0.45);
  transform: translateY(105%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.mobile-more-sheet.open {
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-more-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 12px;
}
.mobile-more-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.mobile-more-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.mobile-more-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.mobile-more-link.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fde68a;
}
.mobile-more-link-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
  margin-top: 1px;
}
.mobile-more-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: 13px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell > main { padding-bottom: 84px; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100dvh;
    max-height: 100dvh;
    width: min(290px, 84vw);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    padding: 14px 14px calc(28px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { z-index: 55; }
  .sidebar .logo { padding: 2px 6px 14px; margin-bottom: 6px; }
  .nav-groups { gap: 10px; padding: 4px 0; }
  .nav-group { gap: 4px; }
  .nav-group + .nav-group { padding-top: 10px; }
  .nav-group.offset-group { padding-left: 0; }
  .nav-link { padding: 9px 11px; gap: 10px; }
  .nav-step-icon { width: 30px; height: 30px; }
  .nav-step-title { font-size: 14.5px; }
  .nav-step-sub { font-size: 11px; }
  .sidebar-footer { padding-top: 12px; margin-top: 10px; }
  .sidebar-card { padding: 12px; margin-bottom: 0; }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    background: rgba(13, 19, 34, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 24px rgba(13, 19, 34, 0.25);
  }
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.16s ease, background 0.16s ease;
  }
  .mobile-nav-item .svg-ico {
    width: 19px;
    height: 19px;
  }
  .mobile-nav-item.active {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.14);
  }

  .wizard-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    padding: 14px !important;
  }
  .wizard-rail {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .wizard-rail::-webkit-scrollbar { display: none; }
  .wizard-rail::before { display: none; }
  .wizard-step {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 13px;
    gap: 7px;
    background: #fff;
    border: 1px solid var(--border);
  }
  .wizard-step .dot {
    width: 21px;
    height: 21px;
    font-size: 10.5px;
  }

  .grid-2 { grid-template-columns: 1fr !important; }
  .topbar {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .topbar h3 {
    font-size: 16px !important;
    flex: 1;
    min-width: 120px;
  }
  .app-shell > main > div:not(.topbar) {
    padding: 14px 14px 20px !important;
  }
  .card {
    padding: 15px !important;
    border-radius: 14px !important;
  }
  .video-hero {
    min-height: 155px !important;
    padding: 18px !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
  }
  .video-hero h1 {
    font-size: 22px !important;
    line-height: 1.18 !important;
  }
  .video-hero p {
    font-size: 13.5px !important;
    line-height: 1.5 !important;
  }
  .hero-kicker {
    font-size: 11px;
    padding: 4px 10px;
    margin-bottom: 8px;
  }
  .home-stage-grid {
    gap: 14px;
    margin-top: 14px;
  }
  .profile-portal-card {
    min-height: auto !important;
    padding: 20px !important;
    border-radius: 16px !important;
  }
  .profile-portal-card h2 {
    font-size: 22px !important;
  }
  .profile-portal-card p {
    font-size: 13.5px !important;
  }
  .profile-portal-card .btn-primary {
    width: 100%;
    padding: 11px 16px !important;
    font-size: 14px !important;
  }
  .pathway-tile {
    margin-left: 0 !important;
    padding: 13px 14px !important;
    gap: 12px !important;
    border-radius: 14px !important;
  }
  .pathway-tile strong {
    font-size: 15.5px !important;
  }
  .pathway-tile-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  /* Formulaires & grilles multi-colonnes propres sur téléphone */
  #live-web-form,
  #custom-link-form {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #live-web-form button,
  #custom-link-form button {
    width: 100%;
  }
  #live-web-results,
  #list {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .agent-grid {
    grid-template-columns: 1fr !important;
  }

  /* Évite le zoom automatique iOS Safari dans les champs */
  .input,
  select.input,
  textarea.input {
    font-size: 16px;
    padding: 10px 12px;
  }

  .btn-primary,
  .btn-dark,
  .btn-secondary {
    font-size: 13.5px;
    padding: 9px 14px;
  }

  .tab {
    font-size: 13.5px;
    margin-right: 16px;
    padding: 8px 2px;
  }

  /* Widget Nova placé au-dessus de la barre inférieure mobile */
  #nova-fab {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    width: 48px;
    height: 48px;
  }
  #nova-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(130px + env(safe-area-inset-bottom, 0px));
    max-height: 60vh;
  }
}

@media (max-width: 520px) {
  .topbar .btn-primary,
  .topbar .btn-secondary {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  .topbar .verified-pill {
    font-size: 10.5px;
    padding: 3px 8px;
  }
  #country-filter,
  #level-filter,
  #funding-filter {
    max-width: none !important;
    flex: 1 1 46%;
  }
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 15;
}

/* Hero Vidéo Animé (Dashboard & Universités) */
.video-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  color: #ffffff;
  background: var(--twilight);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}
.video-hero video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: saturate(1.06);
}
.video-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    rgba(13, 19, 34, 0.86) 0%,
    rgba(17, 24, 39, 0.62) 52%,
    rgba(217, 119, 6, 0.24) 100%
  );
  z-index: 1;
}
.video-hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 600;
  color: #fde68a;
  margin-bottom: 10px;
}
.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.3); }
}

/* Cartes */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #d6ccbc;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* Boutons */
.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.34);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-dark {
  background: var(--twilight);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.16s ease, transform 0.16s ease;
}
.btn-dark:hover { background: var(--twilight-2); transform: translateY(-1px); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.btn-secondary:hover { background: var(--surface-soft); border-color: #cfc6b5; }

.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.btn-danger:hover { background: #fee2e2; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: var(--indigo-soft); color: #1d4ed8; }
.badge-green { background: var(--emerald-soft); color: var(--emerald); }
.badge-orange { background: var(--accent-soft); color: #b45309; }
.badge-gray { background: #f1efe9; color: var(--muted); }

/* Barre de progression */
.progress-bar { height: 8px; background: #ede9e0; border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ea580c);
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* Onglets */
.tab {
  padding: 10px 4px;
  margin-right: 22px;
  color: var(--muted);
  font-size: 14.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
}
.tab.active {
  color: var(--accent-strong);
  border-color: var(--accent-strong);
  font-weight: 700;
}

/* Inputs */
.input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}
.label { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: block; font-weight: 500; }

/* Wizard profil — rail vertical avec gros titres */
.wizard-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wizard-rail::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: #e2dcd0;
  z-index: 0;
}
.wizard-step {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  color: var(--muted);
  font-family: 'Outfit', sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.wizard-step:hover { background: rgba(217, 119, 6, 0.08); color: var(--ink); }
.wizard-step.active {
  background: #ffffff;
  color: #9a3412;
  font-weight: 700;
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: var(--shadow-sm);
}
.wizard-step .dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ece8df;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.wizard-step.active .dot { background: linear-gradient(135deg, #f59e0b, #ea580c); color: #fff; }
.wizard-step.done .dot { background: #16a34a; color: #fff; }

/* === Mini-carte "Page d'accueil" pour liens d'universités & bourses === */
.link-preview-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.link-preview-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.12);
  border-color: var(--accent);
}
.link-preview-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: #f4f1ea;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
}
.chrome-dots {
  display: inline-flex;
  gap: 4px;
  margin-right: 4px;
}
.chrome-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d5cfc3;
}
.chrome-dots span:nth-child(1) { background: #f87171; }
.chrome-dots span:nth-child(2) { background: #fbbf24; }
.chrome-dots span:nth-child(3) { background: #34d399; }
.link-preview-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}
.link-preview-domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #334155;
  flex: 1;
}
.link-preview-stage {
  position: relative;
  height: 132px;
  background: linear-gradient(135deg, #161d31 0%, #243354 60%, #9a3412 100%);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.link-preview-stage.compact {
  height: 108px;
}
.link-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.link-preview-card:hover .link-preview-img {
  transform: scale(1.04);
}
.link-preview-fallback {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(245, 158, 11, 0.35), transparent 50%),
    linear-gradient(135deg, #111827 0%, #1e293b 65%, #334155 100%);
}
.mini-home-wireframe {
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0.45;
}
.mini-home-wireframe span {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.7);
}
.link-preview-overlay-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(17, 24, 39, 0.78);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
}
.link-preview-body {
  padding: 11px 13px;
}
.link-preview-title {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-preview-desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.preview-skeleton {
  height: 180px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(90deg, #f1eee7 25%, #faf8f4 50%, #f1eee7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Widget Nova */
#nova-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #111827, #1f2a44);
  color: #fde68a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid rgba(245, 158, 11, 0.55);
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.32);
  z-index: 30;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#nova-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.35);
}
#nova-panel {
  position: fixed;
  bottom: 92px;
  right: 22px;
  width: min(355px, calc(100vw - 32px));
  max-height: 480px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(17, 24, 39, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 30;
}
#nova-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-soft);
}
.msg {
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.msg.nova {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--ink);
  align-self: flex-start;
}
.msg.user {
  background: linear-gradient(135deg, #111827, #1f2a44);
  color: #fff;
  align-self: flex-end;
}

/* Position mobile de Nova (placée APRÈS les règles de base pour ne jamais être écrasée) */
@media (max-width: 900px) {
  #nova-fab {
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 52px;
    height: 52px;
    z-index: 45;
  }
  #nova-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(154px + env(safe-area-inset-bottom, 0px));
    max-height: 58vh;
    z-index: 46;
  }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .no-print, #nova-fab, #nova-panel, .sidebar-backdrop, .ambient-bg, .mobile-bottom-nav, .mobile-more-sheet, .mobile-more-backdrop { display: none !important; }
  .app-shell { display: block; }
  .app-shell > main { padding-bottom: 0 !important; }
  .print-area { border: none !important; box-shadow: none !important; padding: 0 !important; max-width: 100% !important; }
}
