/* ===========================================================================
   AlpesSaison — feuille de style
   Sobriété fonctionnelle : sidebar fixe, cartes blanches sur fond gris clair,
   un seul dégradé (le hero) qui porte l'identité.
   =========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e6e8ec;
  --border-strong: #d5d9e0;

  --text: #16202e;
  --text-muted: #6b7383;
  --text-faint: #9aa1ad;

  /* Palette dérivée du logo : vert sapin alpin */
  --brand: #234b3b;
  --brand-dark: #1a3a2d;
  --accent: #1f6b52;
  --accent-soft: #eaf4ef;
  --navy: #1a2b24;

  --urgent: #c2410c;
  --urgent-soft: #fef3ec;
  --success: #14855f;
  --success-soft: #e9f7f1;

  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 256px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, .07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

svg { stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ===========================================================================
   Layout
   =========================================================================== */

.layout { display: flex; min-height: 100vh; }

.main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 64px;
  max-width: 1280px;
}

/* ===========================================================================
   Sidebar
   =========================================================================== */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.brand-logo svg { width: 38px; height: 38px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--brand);
}
.brand-text span { font-size: 11px; color: var(--text-faint); letter-spacing: .01em; }

.nav-main { padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 14px;
  color: #39424f;
  transition: background .12s, color .12s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-muted); }
.nav-item:hover { background: #f2f4f7; }
.nav-item.active { background: var(--navy); color: #fff; font-weight: 600; }
.nav-item.active svg { color: #fff; }

.badge-urgent {
  margin-left: auto;
  background: var(--urgent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .01em;
}
.badge-count {
  margin-left: auto;
  background: #e8ebf0;
  color: #4b5563;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}
.nav-item.active .badge-count { background: rgba(255,255,255,.22); color: #fff; }

.nav-section-label {
  padding: 18px 18px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-sectors { padding: 0 10px; display: flex; flex-direction: column; gap: 1px; }

.sector-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  background: none;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  color: #39424f;
  cursor: pointer;
}
.sector-link:hover { background: #f2f4f7; }
.sector-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sector-link > svg:first-child { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.sector-link .chev {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--text-faint);
  transition: transform .18s;
}
.sector-group.open .sector-link .chev { transform: rotate(90deg); }

/* `display:flex` l'emporterait sur l'attribut `hidden` : le neutraliser explicitement. */
.sector-sub[hidden] { display: none; }
.sector-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 4px 26px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.sector-sublink {
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.sector-sublink:hover { background: #f2f4f7; color: var(--text); }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.lang-toggle {
  display: flex;
  justify-content: center;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.lang-switch {
  display: flex;
  width: 100%;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #f1f3f6;
  gap: 4px;
}

.lang-opt {
  flex: 1;
  padding: 9px 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  transition: all .2s;
}
.lang-opt:hover { color: var(--text); }
.lang-opt.active {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}

/* ===========================================================================
   Hero
   =========================================================================== */

.hero {
  border-radius: var(--radius-lg);
  background: linear-gradient(118deg, #1a3a2d 0%, #235c46 48%, #2f8a63 100%);
  color: #fff;
  padding: 34px 38px 30px;
  margin-bottom: 34px;
}

.hero-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-text { flex: 1; min-width: 0; }

.hero-logo {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hero-logo svg {
  width: 100%;
  height: 170px;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.22));
}

.hero-wordmark {
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: .95;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 4px 16px rgba(0,0,0,.28);
}
.hero-wordmark em { font-style: normal; color: #8fd3b6; }

@media (max-width: 860px) {
  .hero-main { flex-direction: column; }
  .hero-logo { width: 100%; }
  .hero-logo svg { height: 110px; }
  .hero-wordmark { font-size: 44px; }
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.16);
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 18px;
}
.hero-pill svg { width: 14px; height: 14px; }

.hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -.025em;
  max-width: 16ch;
}

.hero p {
  margin: 0 0 22px;
  font-size: 15px;
  color: rgba(255,255,255,.9);
  max-width: 68ch;
}

.hero-search { display: flex; gap: 12px; margin-bottom: 16px; max-width: 780px; }

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 0 14px;
  min-width: 0;
}
.search-field svg { width: 17px; height: 17px; color: var(--text-faint); flex-shrink: 0; }
.search-field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 13px 0;
  font-size: 14.5px;
  color: var(--text);
  min-width: 0;
}
.search-field input::placeholder { color: var(--text-faint); }

.btn-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--text);
  border: 0;
  border-radius: 10px;
  padding: 0 20px;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}
.btn-search svg { width: 15px; height: 15px; }
.btn-search:hover { background: #f2f4f7; }

.hero-chips { display: flex; flex-wrap: wrap; gap: 9px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  transition: background .12s;
}
.chip:hover { background: rgba(255,255,255,.26); }
.chip svg { width: 13px; height: 13px; }
.chip.chip-urgent { background: var(--urgent); border-color: var(--urgent); font-weight: 600; }
.chip.chip-urgent:hover { background: #9a3412; }
.chip.active { background: #fff; color: var(--text); border-color: #fff; font-weight: 600; }

/* ===========================================================================
   Sections
   =========================================================================== */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 16px;
}
.section-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.link-more {
  font-size: 13.5px;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.link-more svg { width: 14px; height: 14px; }

.section { margin-bottom: 38px; }

/* Grille secteurs */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.sector-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.sector-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.sector-card .icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.sector-card .icon svg { width: 18px; height: 18px; }
.sector-card .label { display: block; font-size: 14.5px; font-weight: 600; }
.sector-card .count { display: block; font-size: 12.5px; color: var(--text-muted); font-weight: 400; margin-top: 3px; }

/* ===========================================================================
   Carte offre
   =========================================================================== */

.job-list { display: flex; flex-direction: column; gap: 10px; }

.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color .12s, box-shadow .12s;
}
.job-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.job-body { flex: 1; min-width: 0; }

.job-title {
  font-size: 15.5px;
  font-weight: 650;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.job-title a:hover { color: var(--accent); }

.job-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.job-meta span { display: inline-flex; align-items: center; gap: 5px; }
.job-meta svg { width: 13px; height: 13px; color: var(--text-faint); }

.job-excerpt {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f1f3f6;
  color: #4b5563;
  border: 1px solid transparent;
}
.tag-housing { background: var(--success-soft); color: var(--success); }
.tag-fresh    { background: var(--accent-soft); color: var(--accent); }
.tag-urgent   { background: var(--urgent-soft); color: var(--urgent); }
/* La source est une provenance, pas un attribut de l'offre : contour seul. */
.tag-source   { background: transparent; border-color: var(--border-strong); color: var(--text-faint); font-weight: 500; }

.job-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.job-age { font-size: 12.5px; color: var(--text-faint); white-space: nowrap; }
.job-salary { font-size: 13.5px; font-weight: 650; white-space: nowrap; }

.job-open {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background .12s, border-color .12s;
}
.job-open:hover { background: var(--accent-soft); border-color: var(--accent); }

.btn-fav {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  transition: all .12s;
}
.btn-fav svg { width: 15px; height: 15px; }
.btn-fav:hover { border-color: var(--urgent); color: var(--urgent); }
.btn-fav.on { border-color: var(--urgent); color: var(--urgent); }
.btn-fav.on svg { fill: var(--urgent); }

/* ===========================================================================
   Barre de filtres
   =========================================================================== */

.filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.filters-primary,
.filters-advanced {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.filters-advanced { margin-top: 14px; }

/* Le repli est réservé au mobile : sur desktop tout reste visible. */
.btn-filters { display: none; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 160px; }
.field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .01em;
}
.field select, .field input {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  background: #fff;
  color: var(--text);
  outline: 0;
}
.field select:focus, .field input:focus { border-color: var(--accent); }
.field.grow { flex: 1; min-width: 220px; }

.btn-reset {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.btn-reset:hover { border-color: var(--text-muted); color: var(--text); }

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.results-bar strong { color: var(--text); }

/* ===========================================================================
   Groupes du flux
   =========================================================================== */

.feed-group { margin-bottom: 30px; }
.feed-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.feed-group-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.feed-group-head .n {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: #eceff3;
  padding: 1px 8px;
  border-radius: 20px;
}
.feed-group-head .rule { flex: 1; height: 1px; background: var(--border); }

/* ===========================================================================
   Détail offre
   =========================================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 15px; height: 15px; }

.detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
}
.detail h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -.025em;
}
.detail .employer { font-size: 15px; color: var(--text-muted); margin-bottom: 16px; }
.detail .tags { margin-bottom: 22px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.detail-grid dt { font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 3px; }
.detail-grid dd { margin: 0; font-size: 14px; font-weight: 550; }

.detail .description {
  font-size: 14.5px;
  line-height: 1.7;
  color: #333c48;
  white-space: pre-wrap;
  margin-bottom: 26px;
}

.btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 12px 22px;
  font-size: 14.5px;
  font-weight: 600;
}
.btn-apply:hover { background: var(--brand); }
.btn-apply svg { width: 15px; height: 15px; }

/* ===========================================================================
   États
   =========================================================================== */

.empty {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 46px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty svg { width: 34px; height: 34px; color: var(--text-faint); margin-bottom: 12px; }
.empty h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 650; color: var(--text); }
.empty p { margin: 0; font-size: 13.5px; }
.empty code {
  background: #eef1f5;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.skeleton {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 92px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.035), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.btn-more {
  display: block;
  margin: 18px auto 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 550;
}
.btn-more:hover { border-color: var(--text-muted); }

/* ===========================================================================
   Responsive
   =========================================================================== */

.menu-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  width: 40px; height: 40px;
  place-items: center;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, .4);
  z-index: 40;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 900px) {
  .menu-toggle { display: grid; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-md);
  }
  .sidebar.open { transform: translateX(0); }

  .main { padding: 64px 16px 48px; }

  .hero { padding: 26px 20px 24px; }
  .hero h1 { font-size: 27px; max-width: none; }
  .hero-search { flex-direction: column; }
  .btn-search { justify-content: center; padding: 13px 20px; }

  .job-card { flex-direction: column; gap: 12px; }
  .job-side { flex-direction: row; align-items: center; width: 100%; }
  .job-age { margin-right: auto; }
  .job-open { margin-left: auto; }

  .filters { padding: 12px 14px; margin-bottom: 14px; }
  .filters-primary { flex-wrap: nowrap; align-items: flex-end; gap: 10px; }
  .field { min-width: 0; }
  .field.grow { min-width: 0; }

  /* Les filtres secondaires sont repliés : la liste d'annonces reste en haut. */
  .filters-advanced { display: none; flex-direction: column; align-items: stretch; }
  .filters-advanced.open { display: flex; }

  .btn-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 8px 13px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
  }
  .btn-filters svg { width: 14px; height: 14px; }
  .btn-filters[data-count]::after {
    content: attr(data-count);
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    border-radius: 20px;
    padding: 1px 6px;
  }
}

/* ===========================================================================
   Submit Offer Form
   =========================================================================== */

.submit-offer-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
  margin-bottom: 32px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(35, 75, 59, 0.1);
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.submit-message {
  padding: 12px;
  border-radius: var(--radius);
  font-size: 14px;
  text-align: center;
}

.submit-message.submit-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success);
}

.submit-message.submit-error {
  background: var(--urgent-soft);
  color: var(--urgent);
  border: 1px solid var(--urgent);
}
