/* ====== Base ====== */
:root {
  --bg: #0f172a;
  --fg: #f0f2f5;
  --muted: #94a3b8;
  --card: rgba(23, 31, 49, 0.6);
  --border: rgba(148, 163, 184, 0.12);
  --brand: #4f46e5;
  --brand-d: #4338ca;
  --danger: #ef4444;
  --soft: #1e293b;
  --radius: 0.9rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.dark {
  background-color: #0c1224; /* Base bleu nuit */
  background-image: url('/static/vague-fond.svg?v=9');
  background-size: 2500px 2500px;
  background-repeat: no-repeat;
  animation: wave-pan 40s ease-in-out infinite alternate;
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ====== Topbar ====== */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
  background: rgba(10, 15, 25, 0.7);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  backdrop-filter: blur(16px);
}

.topbar-left {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.topbar .brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.topbar-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.topbar-nav a {
  color: #d1e4ff;
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.28rem 0.6rem;
  border-radius: 0.4rem;
  transition: background 0.2s;
}

.topbar-nav a:hover {
  background: rgba(148, 163, 184, 0.15);
}

.lang-switcher {
  position: relative;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 0.65rem;
  min-width: 140px;
  display: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 60;
}

.lang-dropdown.open {
  display: block;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
}

.lang-dropdown-item:hover {
  background: rgba(148, 163, 184, 0.08);
}

.topbar-burger {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

/* ====== Logique d'authentification (liens) ====== */
.only-auth {
  display: none;
}
.only-guest {
  display: initial;
}
body.is-auth .only-auth {
  display: initial;
}
body.is-auth .only-guest {
  display: none;
}
@media (max-width: 820px) {
  body.is-auth .topbar-nav a.only-auth {
    display: block;
  }
}

/* ====== Layout ====== */
.container {
  max-width: 1100px;
  margin: 4.75rem auto 1.25rem;
  padding: 0 1rem 5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(16px);
}

h1 {
  margin: 0.25rem 0 1rem;
  font-size: 2.1rem;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

/* ====== Buttons / Inputs ====== */
.btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  transition: transform 0.1s ease-out, background 0.2s ease;
  box-shadow: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--brand-d);
}

.btn-soft {
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-soft:hover {
  background: rgba(148, 163, 184, 0.18);
}

input,
select,
textarea {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 0.45rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

/* ====== Hero (home) ====== */
.hero {
  margin: 4.75rem auto 2rem;
  padding: 4rem 1rem 3rem;
  text-align: center;
  max-width: 840px;
}

.hero h1 {
  font-size: 3.2rem;
  line-height: 1.15;
  margin: 0.2rem 0 1rem;
  font-weight: 700;
  background: -webkit-linear-gradient(45deg, #fff, #cdd5e0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 auto 1.5rem;
  max-width: 600px;
}

.hero-cta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.hero-ghost {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.1s ease-out;
}
.hero-ghost:hover {
  background: rgba(148, 163, 184, 0.2);
  transform: translateY(-1px);
}

.hero-demo {
  background: rgba(2, 6, 23, 0.35);
  border-radius: 1rem;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.hero-demo .table-wrapper {
  border: none;
  background: none;
}

/* ====== Tables ====== */
.table-wrapper {
  overflow-x: auto;
}

.jobs-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(15, 23, 42, 0.2);
}

.jobs-table thead {
  background: rgba(15, 23, 42, 0.55);
}

.jobs-table th,
.jobs-table td {
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  vertical-align: middle;
}

.jobs-table th {
  font-size: 0.82rem;
  color: #b4c3d6;
  text-align: left;
}

.jobs-table td {
  font-size: 0.9rem;
}

/* ====== How it works ====== */
.feature-section {
  max-width: 1100px;
  margin: 3rem auto 5rem;
  padding: 2rem 1rem;
}

.feature-section h2 {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: flex-start;
}

.feature-sticky-side {
  position: sticky;
  top: 80px;
  min-height: 400px;
}

.feature-scroll-side {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.feature-step strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 0.5rem;
}
.feature-step span {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ====== Companies (homepage) ====== */
.company-list-section {
  text-align: center;
}
.company-list-section h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.company-list-section .muted {
  margin-bottom: 2rem;
}
.company-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.company-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}
.company-pill img {
  width: 18px;
  height: 18px;
  border-radius: 999px;
}

/* ====== Auth pages ====== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 1rem 2rem;
}

.auth-wrapper {
  width: min(440px, 94%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.6rem 1.8rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
}

.auth-title {
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.auth-subtitle {
  color: var(--muted);
  margin-bottom: 1rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-field span,
.auth-form label span {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-footer {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.form-msg {
  font-size: 0.85rem;
  color: var(--danger);
  margin-top: 0.75rem;
  min-height: 1.2em;
}

/* ====== Footer ====== */
.site-footer {
  margin-top: auto;
  background: rgba(10, 15, 25, 0.85);
  border-top: 1px solid var(--border);
  padding: 1rem 1rem 1.6rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-title {
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: #cbd5f5;
  text-decoration: none;
  font-size: 0.8rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ====== ONBOARDING (ajusté) ====== */
.onboard-container {
  max-width: 1100px;
  margin: 4.75rem auto 1.25rem;
  padding: 0 1rem 5rem;
}

.onboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.onboard-search {
  flex-grow: 1;
  min-width: 250px;
  max-width: 400px;
}

/* >>> ici on force 5-6 cartes par ligne sur 1100px */
.logos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.logo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.65rem 0.75rem 0.75rem;
  backdrop-filter: blur(12px);
  transition: all 0.15s ease-out;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-height: 220px;
}

.logo-card:hover {
  border-color: rgba(148, 163, 184, 0.3);
  transform: translateY(-2px);
}

.logo-card.is-selected {
  border-color: rgba(79, 70, 229, 0.9);
  box-shadow: 0 0 18px rgba(79, 70, 229, 0.25);
}

.logo-check {
  display: inline-block;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.logo-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  cursor: pointer;
}

.logo-img-wrap {
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.logo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-fallback {
  font-size: 2.1rem;
  font-weight: 600;
  color: var(--muted);
}

.logo-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-sector {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-desc {
  font-size: 0.68rem;            /* plus petit */
  line-height: 1.25;
  color: rgba(241, 245, 249, 0.7);
  max-height: 2.5rem;            /* on limite la hauteur */
  overflow: hidden;
}

/* ====== Responsive ====== */
@media (max-width: 980px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .feature-sticky-side {
    position: static;
    min-height: auto;
    margin-bottom: 2rem;
  }
  .feature-scroll-side {
    gap: 2.5rem;
  }
}

@media (max-width: 820px) {
  .topbar-nav {
    position: absolute;
    top: 56px;
    right: 0.75rem;
    background: rgba(10, 15, 25, 0.95);
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 0.4rem 0.35rem;
    display: none;
    flex-direction: column;
    min-width: 170px;
  }
  .topbar-nav.open {
    display: flex;
  }
  .topbar-burger {
    display: block;
  }
  .container {
    padding: 0 1rem 5rem;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 540px) {
  .hero h1 {
    font-size: 2.4rem;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .auth-wrapper {
    padding: 1.3rem 1.1rem 1.5rem;
  }
  .jobs-table th,
  .jobs-table td {
    white-space: nowrap;
  }
  .logos-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .logo-card {
    min-height: 200px;
  }
  .logo-img-wrap {
    width: 68px;
    height: 68px;
  }
}

/* Animation vague */
@keyframes wave-pan {
  0% { background-position: 0% 0%; }
  100% { background-position: 50% 100%; }
}
