/* ==========================================================================
   DébutantAccepté.fr — Design System & Styles
   Orienté accessibilité, clarté et confort pour les demandeurs d'emploi
   ========================================================================== */

:root {
  /* Palette de couleurs harmonieuse & contrastée (Accessible WCAG AAA) */
  --primary:        hsl(246, 80%, 56%);
  --primary-hover:  hsl(246, 80%, 48%);
  --primary-light:  hsl(246, 85%, 96%);

  --green:          hsl(158, 85%, 34%);
  --green-bg:       hsl(158, 60%, 94%);
  --amber:          hsl(36, 95%, 44%);

  --bg:             hsl(220, 25%, 98%);
  --surface:        hsl(0, 0%, 100%);
  --surface-alt:    hsl(220, 20%, 96%);
  --border:         hsl(220, 16%, 88%);
  --border-focus:   hsl(246, 80%, 56%);

  --text:           hsl(222, 47%, 11%);
  --text-muted:     hsl(218, 16%, 38%);
  --text-dim:       hsl(218, 14%, 55%);

  --shadow-sm:  0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md:  0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-lg:  0 12px 30px rgba(15, 23, 42, 0.09);
  --shadow-xl:  0 20px 40px rgba(15, 23, 42, 0.12);

  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-pill: 9999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   En-tête (Header)
   ========================================================================== */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), hsl(270, 75%, 55%));
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-name strong {
  color: var(--primary);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-nav a {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 4px;
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ==========================================================================
   Section Hero & Recherche
   ========================================================================== */

.hero {
  padding: 60px 0 44px;
  background: linear-gradient(180deg, hsl(246, 85%, 98%) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  max-width: 720px;
  margin-bottom: 14px;
  color: var(--text);
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
  background: linear-gradient(120deg, var(--primary), hsl(280, 80%, 50%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.55;
  margin-bottom: 30px;
}

/* Formulaire de recherche */
.search-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: flex;
  align-items: stretch;
  max-width: 920px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.search-form:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), var(--shadow-lg);
}

.search-fields {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 16px;
  flex: 1;
  min-width: 0;
  position: relative;
}

.field-wrap--narrow {
  flex: 0 0 140px;
}

.field-wrap label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.field-wrap input,
.field-wrap select {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.field-wrap select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 20px;
}

.field-wrap input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

.field-sep {
  width: 1px;
  background: var(--border);
  margin: 10px 0;
  flex-shrink: 0;
}

.btn-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 0 26px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.12s;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-search:hover {
  background: var(--primary-hover);
}

.btn-search:active {
  transform: scale(0.98);
}

/* Autocomplétion localisation */
.geo-suggestions-box {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.suggestion-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid var(--surface-alt);
  font-size: 0.88rem;
  transition: background 0.12s;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: var(--primary-light);
}

.suggestion-title {
  font-weight: 500;
  color: var(--text);
}

.suggestion-badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
}

.suggestion-badge.region {
  background: hsl(210, 80%, 93%);
  color: hsl(210, 80%, 35%);
}

/* Filtres avancés */
.filter-bar-extra {
  margin-bottom: 12px;
}

.btn-toggle-filters {
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}

.btn-toggle-filters:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.filter-toggle-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.btn-toggle-filters.open .filter-toggle-arrow {
  transform: rotate(180deg);
}

.advanced-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: flex-end;
}

.adv-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adv-field label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.adv-field select {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.adv-field select:focus {
  border-color: var(--border-focus);
}

.adv-field--checkbox {
  justify-content: center;
}

.adv-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  color: var(--text) !important;
  padding-bottom: 6px;
}

.adv-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Quick chips */
.quick-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chips-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.chip-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}

.chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ==========================================================================
   Section "Comment ça marche" (Explications rassurantes)
   ========================================================================== */

.how-section {
  padding: 44px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.how-card {
  padding: 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.how-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.how-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.how-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Section Résultats & Annonces
   ========================================================================== */

.results-section {
  padding: 44px 0 60px;
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.results-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.results-meta h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.geo-resolved-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--primary-light);
  color: var(--primary);
}

/* Grille des cartes */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* Carte Offre */
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), border-color 0.16s;
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: hsl(246, 60%, 80%);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

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

.tag {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  color: var(--text-muted);
}

.tag-green {
  background: var(--green-bg);
  color: var(--green);
  font-weight: 700;
}

.tag-direct {
  background: hsl(210, 80%, 94%);
  color: hsl(210, 85%, 32%);
  font-weight: 600;
}

.tag-partner {
  background: hsl(38, 95%, 93%);
  color: hsl(36, 95%, 30%);
  font-weight: 600;
}

.tag-contract-match {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid hsl(158, 60%, 75%);
  font-weight: 700;
}

.tag-contract-mismatch {
  background: hsl(0, 85%, 96%);
  color: hsl(0, 75%, 42%);
  border: 1px solid hsl(0, 70%, 82%);
  font-weight: 700;
}

.card-date {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 6px;
}

.card-company {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 18px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.card-salary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.card-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Skeletons */
.skeleton-card {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--r-lg);
  height: 240px;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* État vide */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 20px;
}

.btn-reset {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reset:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ==========================================================================
   Mentions Légales
   ========================================================================== */

.legal-section {
  padding: 50px 0;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
}

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
}

.legal-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
}

.legal-block h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.legal-block p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Pied de page (Footer)
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0 24px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.footer-brand strong {
  color: var(--primary);
}

.footer-legal {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--surface-alt);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text);
}

/* ==========================================================================
   Fenêtre modale (Détail de l'offre)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--surface-alt);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s;
}

.modal-close:hover {
  background: hsl(220, 20%, 90%);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.modal-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
  color: var(--text);
}

.modal-company {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
}

.modal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: var(--surface-alt);
  border-radius: var(--r-md);
  padding: 16px;
}

.meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-row span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 700;
}

.meta-row strong {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  white-space: pre-line;
  max-height: 240px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.modal-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: hsl(210, 80%, 96%);
  border-left: 3px solid hsl(210, 80%, 55%);
  padding: 8px 12px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 18px;
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-secondary:hover {
  border-color: var(--text-muted);
}

.btn-apply {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r-md);
  padding: 11px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s var(--ease);
}

.btn-apply:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

/* ==========================================================================
   Adaptations Mobiles & Responsive
   ========================================================================== */

@media (max-width: 820px) {
  .how-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 720px) {
  .header-inner {
    height: 60px;
  }

  .header-nav {
    display: none;
  }

  .hero {
    padding: 36px 0 28px;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .search-form {
    flex-direction: column;
    padding: 12px;
    gap: 10px;
  }

  .search-fields {
    flex-direction: column;
    gap: 10px;
  }

  .field-wrap {
    padding: 4px 6px;
  }

  .field-sep {
    display: none;
  }

  .field-wrap--narrow {
    flex: unset;
  }

  .btn-search {
    border-radius: var(--r-md);
    padding: 14px;
    justify-content: center;
    width: 100%;
  }

  .jobs-grid {
    grid-template-columns: 1fr;
  }

  .modal-meta {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions button,
  .modal-actions a {
    width: 100%;
    justify-content: center;
  }

  .legal-card {
    padding: 24px 18px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
