/* ============================================================
   Villeparisis Emploi — Design System
   Palette : bleu marine #1A3668 · bleu vif #0870C8 · rouge #C8192D
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette Villeparisis */
  --vp-navy:      #1A3668;
  --vp-blue:      #0870C8;
  --vp-blue-h:    #065EAB;
  --vp-red:       #C8192D;
  --vp-light:     #E8F2FB;
  --vp-light2:    #F0F5FA;

  /* Sémantique */
  --color-primary:   var(--vp-blue);
  --color-primary-h: var(--vp-blue-h);
  --color-accent:    var(--vp-navy);
  --color-danger:    var(--vp-red);
  --color-success:   #16a34a;
  --color-warning:   #d97706;

  /* Neutres */
  --color-bg:      #F4F7FB;
  --color-surface: #ffffff;
  --color-border:  #DDE6F0;
  --color-text:    #1A2D4A;
  --color-muted:   #5A7290;

  /* Layout */
  --radius:  10px;
  --radius-sm: 6px;
  --shadow:    0 1px 4px rgba(26,54,104,.10);
  --shadow-md: 0 4px 16px rgba(26,54,104,.12);
  --shadow-lg: 0 8px 32px rgba(26,54,104,.14);

  /* Conteneur */
  --container: 1180px;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
  background: var(--vp-navy);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex; align-items: center; gap: 0.75rem;
  text-decoration: none;
}
.logo-img { height: 36px; width: auto; }
.logo-text {
  font-size: 1.1rem; font-weight: 700; color: #fff;
  letter-spacing: .02em;
}
.header-nav {
  display: flex; align-items: center; gap: 1rem;
}
.nav-link {
  color: rgba(255,255,255,.85); font-size: 0.9rem;
  text-decoration: none; padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm); transition: color .15s;
}
.nav-link:hover { color: #fff; text-decoration: none; }
.nav-logout { color: rgba(255,255,255,.6); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--vp-navy) 0%, var(--vp-blue) 100%);
  padding: 3.5rem 1.25rem;
  text-align: center;
  color: #fff;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: .75rem; }
.hero-accent { color: #FFC947; }
.hero-sub { font-size: 1rem; opacity: .85; margin-bottom: 2rem; }

.hero-search {
  display: flex; gap: .5rem;
  background: #fff;
  border-radius: 50px;
  padding: .35rem .35rem .35rem 1.25rem;
  box-shadow: var(--shadow-lg);
}
.search-input {
  flex: 1; border: none; outline: none;
  font-size: 1rem; color: var(--color-text);
  background: transparent;
  min-width: 0;
}
.hero-search .btn { border-radius: 40px; padding: .5rem 1.5rem; }

/* ── Filters bar ──────────────────────────────────────────── */
.filters-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: .75rem 1.25rem;
}
.filters-inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.filters-label { font-size: .8rem; font-weight: 600; color: var(--color-muted); margin-right: .25rem; }
.filter-tag {
  padding: .3rem .85rem;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  font-size: .82rem; color: var(--color-muted);
  text-decoration: none; transition: all .15s;
}
.filter-tag:hover { border-color: var(--vp-blue); color: var(--vp-blue); text-decoration: none; }
.filter-tag.active { background: var(--vp-blue); color: #fff; border-color: var(--vp-blue); }

/* ── Main content ─────────────────────────────────────────── */
.main-content { padding: 2.5rem 0 4rem; }

/* ── Offres grid ──────────────────────────────────────────── */
.offres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.offre-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: .6rem;
  text-decoration: none; color: var(--color-text);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.offre-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--vp-blue);
  text-decoration: none;
}
.offre-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.offre-logo-wrap {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--color-border);
}
.offre-logo { width: 100%; height: 100%; object-fit: contain; }
.offre-logo-placeholder {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--vp-light);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: var(--vp-navy);
}
.offre-titre {
  font-size: 1rem; font-weight: 600; color: var(--color-text);
  line-height: 1.35;
}
.offre-entreprise { font-size: .9rem; color: var(--vp-blue); font-weight: 500; }
.offre-lieu, .offre-secteur { font-size: .82rem; color: var(--color-muted); }
.offre-card-footer {
  margin-top: auto;
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--color-muted);
  padding-top: .6rem;
  border-top: 1px solid var(--color-border);
}

/* ── Badges contrat ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .75rem; font-weight: 600;
  letter-spacing: .02em;
}
.badge-lg { font-size: .82rem; padding: .3rem .9rem; }
.badge-cdi         { background: #DCFCE7; color: #166534; }
.badge-cdd         { background: #FEF9C3; color: #854D0E; }
.badge-stage       { background: var(--vp-light); color: var(--vp-navy); }
.badge-alternance  { background: #EDE9FE; color: #5B21B6; }
.badge-interim     { background: #FFE4E6; color: #9F1239; }
.badge-freelance   { background: #FEF3C7; color: #92400E; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 1rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.empty-icon { font-size: 3rem; }
.empty-state h2 { font-size: 1.3rem; color: var(--color-text); }
.empty-state p  { color: var(--color-muted); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex; justify-content: center; gap: .5rem;
  margin-top: 2.5rem;
}
.page-link {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: .88rem; color: var(--color-text);
  text-decoration: none; transition: all .15s;
}
.page-link:hover { border-color: var(--vp-blue); color: var(--vp-blue); text-decoration: none; }
.page-link.active { background: var(--vp-blue); color: #fff; border-color: var(--vp-blue); }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: .6rem 0;
  font-size: .85rem; color: var(--color-muted);
}
.breadcrumb-bar a { color: var(--vp-blue); }
.breadcrumb-bar span { margin: 0 .4rem; }

/* ── Offre detail page ────────────────────────────────────── */
.offre-page { padding: 2rem 0 4rem; }

.offre-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

.offre-detail-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 2rem;
}
.offre-detail-header {
  display: flex; gap: 1.25rem; align-items: flex-start;
  margin-bottom: 2rem; padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}
.offre-logo-lg { width: 64px !important; height: 64px !important; }
.offre-logo-placeholder-lg {
  width: 64px !important; height: 64px !important;
  font-size: 1.1rem !important;
}
.offre-detail-meta { flex: 1; }
.offre-detail-titre { font-size: 1.4rem; font-weight: 700; margin: .4rem 0 .25rem; }
.offre-detail-entreprise { font-size: 1rem; color: var(--vp-blue); font-weight: 500; margin-bottom: .5rem; }
.offre-detail-infos {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
  font-size: .85rem; color: var(--color-muted);
}
.offre-description h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.offre-description-body {
  font-size: .95rem; line-height: 1.8; color: var(--color-text);
  white-space: pre-wrap;
}

/* ── Aside ────────────────────────────────────────────────── */
.offre-aside { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 80px; }

.aside-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
}
.aside-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 1rem; }
.postuler-hint { font-size: .85rem; color: var(--color-muted); margin-bottom: 1rem; }
.postuler-message {
  width: 100%; min-height: 80px; margin-bottom: .75rem;
  padding: .6rem .75rem;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem; resize: vertical;
}
.postuler-message:focus { outline: none; border-color: var(--vp-blue); }

.entreprise-nom { font-weight: 600; margin-bottom: .5rem; }
.aside-info { font-size: .85rem; color: var(--color-muted); margin-bottom: .3rem; display: block; }
.aside-link { color: var(--vp-blue); }
.aside-desc { font-size: .82rem; color: var(--color-muted); margin-top: .75rem; line-height: 1.6; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--vp-navy);
  color: rgba(255,255,255,.6);
  padding: 2rem 0;
  text-align: center;
  font-size: .85rem;
}
.site-footer p + p { margin-top: .35rem; }
.site-footer a { color: rgba(255,255,255,.8); }
.site-footer a:hover { color: #fff; }

/* ── Auth pages ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--vp-navy) 0%, var(--vp-blue) 100%);
}
.auth-container {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem 2rem;
  width: 100%; max-width: 420px;
}
.auth-container-wide { max-width: 560px; }

.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--vp-navy); }
.auth-logo p  { color: var(--color-muted); font-size: .9rem; margin-top: .25rem; }

.auth-links {
  margin-top: 1.5rem; text-align: center;
  font-size: .9rem; color: var(--color-muted);
  display: flex; flex-direction: column; gap: .4rem;
}

.register-choice {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem;
}
.register-card {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: 1.5rem 1rem;
  border: 2px solid var(--color-border); border-radius: var(--radius);
  text-align: center; color: var(--color-text); text-decoration: none;
  transition: border-color .2s, box-shadow .2s;
}
.register-card:hover { border-color: var(--vp-blue); box-shadow: var(--shadow); text-decoration: none; }
.register-icon { font-size: 2rem; }
.register-card strong { font-size: .95rem; }
.register-card small  { color: var(--color-muted); font-size: .8rem; }

/* ── Forms ────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

label { font-size: .875rem; font-weight: 500; color: var(--color-text); }
label small { color: var(--color-muted); font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="url"], input[type="date"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  padding: .55rem .75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .95rem; font-family: inherit;
  color: var(--color-text); background: var(--color-surface);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--vp-blue);
  box-shadow: 0 0 0 3px rgba(8,112,200,.12);
}
.field-error { font-size: .8rem; color: var(--color-danger); }

hr.form-divider { border: none; border-top: 1px solid var(--color-border); margin: 1.5rem 0; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.25rem;
  border: none; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background .15s, opacity .15s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary  { background: var(--vp-blue); color: #fff; }
.btn-primary:hover { background: var(--vp-blue-h); }
.btn-danger   { background: var(--vp-red); color: #fff; }
.btn-success  { background: var(--color-success); color: #fff; }
.btn-outline  { background: transparent; border: 1.5px solid var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--vp-blue); color: var(--vp-blue); }
.btn-full { width: 100%; }
.btn-sm   { padding: .35rem .75rem; font-size: .82rem; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .875rem; }
.alert-error   { background: #FEF2F2; color: var(--vp-red);     border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: var(--color-success); border: 1px solid #BBF7D0; }
.alert-warning { background: #FFFBEB; color: var(--color-warning); border: 1px solid #FDE68A; }

/* ── Admin layout ─────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--vp-navy); color: #cbd5e1;
  padding: 1.5rem 1rem; flex-shrink: 0;
  display: flex; flex-direction: column; gap: .25rem;
}
.sidebar-brand { color: #fff; font-weight: 700; font-size: 1.05rem; margin-bottom: 1.5rem; padding: 0 .5rem; }
.sidebar-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.4); padding: .75rem .5rem .25rem;
}
.sidebar a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .75rem; border-radius: 6px;
  color: rgba(255,255,255,.75); font-size: .88rem; text-decoration: none;
  transition: all .15s;
}
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.sidebar-footer { margin-top: auto; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--color-border); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--vp-blue); }
.stat-label { font-size: .85rem; color: var(--color-muted); margin-top: .2rem; }
.section-card { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--color-border); }
.section-card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .offre-layout { grid-template-columns: 1fr; }
  .offre-aside  { position: static; }
}
@media (max-width: 640px) {
  .hero { padding: 2rem 1rem; }
  .hero-search { flex-direction: column; border-radius: var(--radius); padding: .5rem; }
  .search-input { padding: .5rem .75rem; }
  .offres-grid { grid-template-columns: 1fr; }
  .auth-container { padding: 1.75rem 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
  .register-choice { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: .75rem; }
}
