/* ==========================================================================
   AfriHealth Core — Feuille de style front-office
   Compatible Elementor Free, WordPress 6.x
   ========================================================================== */

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --ah-color-primary:   #005f73;
  --ah-color-secondary: #0a9396;
  --ah-color-accent:    #94d2bd;
  --ah-color-danger:    #e63946;
  --ah-color-warning:   #f4a261;
  --ah-color-success:   #2a9d8f;
  --ah-color-text:      #1d3557;
  --ah-color-muted:     #6c757d;
  --ah-color-bg:        #f8f9fa;
  --ah-color-white:     #ffffff;
  --ah-border-radius:   8px;
  --ah-shadow:          0 2px 12px rgba(0,0,0,.08);
  --ah-transition:      .2s ease-in-out;
  --ah-font-base:       -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ── Reset minimal ──────────────────────────────────────────────────────── */
.ah-form-wrap *,
.ah-espace-recruteur *,
.ah-opportunites-wrap *,
.ah-services-grid *,
.ah-stats-wrap *,
.ah-newsletter-wrap * {
  box-sizing: border-box;
}

/* ── Utilitaires ────────────────────────────────────────────────────────── */
.ah-hidden { display: none !important; }

/* ── Notices ────────────────────────────────────────────────────────────── */
.ah-notice {
  padding: 12px 18px;
  border-radius: var(--ah-border-radius);
  margin-bottom: 20px;
  font-size: .95rem;
  line-height: 1.5;
}
.ah-notice--success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.ah-notice--error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.ah-notice--warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.ah-notice--info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ── Formulaires ────────────────────────────────────────────────────────── */
.ah-form-wrap {
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--ah-font-base);
}
.ah-form-header { margin-bottom: 28px; }
.ah-form-title  { font-size: 1.8rem; color: var(--ah-color-primary); margin: 0 0 8px; }
.ah-form-subtitle { color: var(--ah-color-muted); margin: 0; }

.ah-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: var(--ah-border-radius);
  padding: 24px;
  margin-bottom: 24px;
  background: var(--ah-color-white);
}
.ah-fieldset__legend {
  font-weight: 600;
  color: var(--ah-color-primary);
  padding: 0 8px;
  font-size: 1rem;
}

.ah-form-row { display: flex; gap: 18px; flex-wrap: wrap; }
.ah-form-row--2col > .ah-form-group { flex: 1 1 calc(50% - 9px); min-width: 220px; }

.ah-form-group { margin-bottom: 18px; }
.ah-form-group--file { margin-bottom: 14px; }

.ah-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ah-color-text);
  margin-bottom: 6px;
}

.ah-input,
.ah-select,
.ah-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: .95rem;
  font-family: var(--ah-font-base);
  color: var(--ah-color-text);
  background: var(--ah-color-white);
  transition: border-color var(--ah-transition), box-shadow var(--ah-transition);
}
.ah-input:focus,
.ah-select:focus,
.ah-textarea:focus {
  outline: none;
  border-color: var(--ah-color-secondary);
  box-shadow: 0 0 0 3px rgba(10,147,150,.15);
}
.ah-textarea { resize: vertical; min-height: 100px; }

/* Fichier */
.ah-file-input {
  display: block;
  width: 100%;
  padding: 8px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 6px;
  font-size: .875rem;
  cursor: pointer;
}
.ah-file-hint { font-size: .8rem; color: var(--ah-color-muted); margin-top: 4px; display: block; }

/* Checkbox group */
.ah-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}
.ah-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .9rem;
  cursor: pointer;
}
.ah-checkbox-label input[type="checkbox"] { margin-top: 3px; accent-color: var(--ah-color-secondary); }
.ah-checkbox-label--consent { color: var(--ah-color-muted); font-size: .85rem; }
.ah-checkbox-label--consent a { color: var(--ah-color-secondary); }

/* Input group (password toggle) */
.ah-input-group { position: relative; display: flex; }
.ah-input-group .ah-input { flex: 1; border-radius: 6px 0 0 6px; }
.ah-input-group__toggle {
  padding: 0 12px;
  border: 1.5px solid #cbd5e1;
  border-left: none;
  border-radius: 0 6px 6px 0;
  background: var(--ah-color-bg);
  cursor: pointer;
  color: var(--ah-color-muted);
}

/* ── Boutons ────────────────────────────────────────────────────────────── */
.ah-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 6px;
  font-size: .95rem;
  font-weight: 600;
  font-family: var(--ah-font-base);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background var(--ah-transition), color var(--ah-transition), transform .1s;
  line-height: 1;
}
.ah-btn:active { transform: scale(.98); }
.ah-btn--primary   { background: var(--ah-color-primary);   color: var(--ah-color-white); border-color: var(--ah-color-primary); }
.ah-btn--primary:hover { background: var(--ah-color-secondary); border-color: var(--ah-color-secondary); }
.ah-btn--secondary { background: var(--ah-color-secondary); color: var(--ah-color-white); border-color: var(--ah-color-secondary); }
.ah-btn--outline   { background: transparent; color: var(--ah-color-primary); border-color: var(--ah-color-primary); }
.ah-btn--outline:hover { background: var(--ah-color-primary); color: var(--ah-color-white); }
.ah-btn--sm  { padding: 7px 16px; font-size: .85rem; }
.ah-btn--lg  { padding: 14px 32px; font-size: 1.05rem; }
.ah-btn--submit { position: relative; }

/* Spinner */
.ah-btn__spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ah-spin .6s linear infinite;
}
.ah-btn.is-loading .ah-btn__text { opacity: 0; }
.ah-btn.is-loading .ah-btn__spinner { display: inline-block !important; position: absolute; }
@keyframes ah-spin { to { transform: rotate(360deg); } }

.ah-form-actions { margin-top: 8px; }

/* ── Opportunités ───────────────────────────────────────────────────────── */
.ah-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.ah-filter-tab {
  padding: 6px 18px;
  border: 1.5px solid var(--ah-color-primary);
  border-radius: 20px;
  color: var(--ah-color-primary);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--ah-transition), color var(--ah-transition);
}
.ah-filter-tab:hover,
.ah-filter-tab.is-active { background: var(--ah-color-primary); color: var(--ah-color-white); }

.ah-opportunites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}
.ah-opportunites-grid--3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.ah-opport-card {
  background: var(--ah-color-white);
  border-radius: var(--ah-border-radius);
  box-shadow: var(--ah-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--ah-transition), box-shadow var(--ah-transition);
}
.ah-opport-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.ah-opport-card__thumb img { width: 100%; height: 180px; object-fit: cover; display: block; }
.ah-opport-card__body { padding: 18px; flex: 1; }
.ah-opport-card__title { font-size: 1.05rem; margin: 8px 0 10px; color: var(--ah-color-text); line-height: 1.4; }
.ah-opport-card__title a { color: inherit; text-decoration: none; }
.ah-opport-card__title a:hover { color: var(--ah-color-secondary); }
.ah-opport-card__excerpt { font-size: .875rem; color: var(--ah-color-muted); margin: 0; }
.ah-opport-card__meta { font-size: .8rem; color: var(--ah-color-muted); margin-top: 12px; }
.ah-opport-card__footer { padding: 14px 18px; border-top: 1px solid #f0f4f8; display: flex; gap: 10px; flex-wrap: wrap; }

/* Badges */
.ah-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.ah-badge--canada    { background: #e8f4fd; color: #1565c0; }
.ah-badge--europe    { background: #e8f5e9; color: #2e7d32; }
.ah-badge--urgent    { background: #fdecea; color: #c62828; }
.ah-badge--formation { background: #fff8e1; color: #f57f17; }
.ah-badge--afrique   { background: #f3e5f5; color: #7b1fa2; }
.ah-badge--autre     { background: #f5f5f5; color: #424242; }

/* ── Services ───────────────────────────────────────────────────────────── */
.ah-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.ah-service-card {
  background: var(--ah-color-white);
  border-radius: var(--ah-border-radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--ah-shadow);
  transition: transform var(--ah-transition), box-shadow var(--ah-transition);
}
.ah-service-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.ah-service-card__icon { color: var(--ah-color-primary); margin-bottom: 16px; display: block; }
.ah-service-card__title { font-size: 1rem; font-weight: 700; color: var(--ah-color-text); margin: 0 0 10px; }
.ah-service-card__desc  { font-size: .875rem; color: var(--ah-color-muted); line-height: 1.6; margin: 0; }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.ah-stats-wrap { background: var(--ah-color-primary); border-radius: var(--ah-border-radius); padding: 40px 24px; }
.ah-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  text-align: center;
}
.ah-stat-item { color: var(--ah-color-white); }
.ah-stat__icon { font-size: 2rem; display: block; margin-bottom: 12px; }
.ah-stat__number { font-size: 2.8rem; font-weight: 800; display: block; line-height: 1; }
.ah-stat__label { font-size: .85rem; opacity: .85; margin-top: 6px; display: block; }

/* ── Newsletter ─────────────────────────────────────────────────────────── */
.ah-newsletter-wrap {
  background: linear-gradient(135deg, var(--ah-color-primary) 0%, var(--ah-color-secondary) 100%);
  border-radius: var(--ah-border-radius);
  padding: 40px;
  color: var(--ah-color-white);
}
.ah-newsletter__inner { display: flex; gap: 40px; align-items: center; flex-wrap: wrap; }
.ah-newsletter__text { flex: 1 1 240px; }
.ah-newsletter__title { font-size: 1.5rem; margin: 0 0 10px; }
.ah-newsletter__form-wrap { flex: 2 1 320px; }
.ah-newsletter__fields { display: flex; gap: 10px; flex-wrap: wrap; }
.ah-newsletter__fields .ah-input { flex: 1 1 180px; background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: #fff; }
.ah-newsletter__fields .ah-input::placeholder { color: rgba(255,255,255,.7); }
.ah-newsletter__rgpd { margin-top: 10px; opacity: .8; font-size: .82rem; }
.ah-newsletter__rgpd a { color: var(--ah-color-accent); }

/* ── Espace recruteur ───────────────────────────────────────────────────── */
.ah-er-header { margin-bottom: 24px; }
.ah-er-title { font-size: 1.8rem; color: var(--ah-color-primary); margin: 0 0 8px; }
.ah-er-subtitle { color: var(--ah-color-muted); margin: 0; }

.ah-er-filters { background: var(--ah-color-white); padding: 20px; border-radius: var(--ah-border-radius); margin-bottom: 24px; box-shadow: var(--ah-shadow); }
.ah-filter-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.ah-filter-row .ah-form-group { margin: 0; flex: 1 1 160px; }
.ah-form-group--submit { display: flex; gap: 8px; align-items: flex-end; }

.ah-profils-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.ah-profil-card {
  background: var(--ah-color-white);
  border-radius: var(--ah-border-radius);
  box-shadow: var(--ah-shadow);
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--ah-transition);
}
.ah-profil-card:hover { transform: translateY(-3px); }
.ah-profil-card__icon { color: var(--ah-color-primary); }
.ah-profil-card__ref  { font-size: .78rem; color: var(--ah-color-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ah-profil-card__spec { font-size: 1.1rem; font-weight: 700; color: var(--ah-color-text); margin: 0; }
.ah-profil-card__details { list-style: none; padding: 0; margin: 0; font-size: .875rem; color: var(--ah-color-muted); display: flex; flex-direction: column; gap: 4px; }
.ah-profil-card__footer { margin-top: auto; }

/* ── Section header ─────────────────────────────────────────────────────── */
.ah-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.ah-section-title  { font-size: 1.6rem; color: var(--ah-color-primary); margin: 0; }
.ah-section-link   { color: var(--ah-color-secondary); font-weight: 600; text-decoration: none; font-size: .9rem; }
.ah-section-link:hover { text-decoration: underline; }

/* ── Single opportunité ─────────────────────────────────────────────────── */
.ah-single-opport { max-width: 860px; margin: 0 auto; padding: 40px 20px; }
.ah-article__header { margin-bottom: 28px; }
.ah-article__title  { font-size: 2rem; color: var(--ah-color-text); margin: 12px 0 8px; }
.ah-article__meta   { font-size: .875rem; color: var(--ah-color-muted); }
.ah-article__featured-img { margin-bottom: 32px; border-radius: var(--ah-border-radius); overflow: hidden; }
.ah-article__featured-img img { width: 100%; max-height: 400px; object-fit: cover; }
.ah-article__content { font-size: 1rem; line-height: 1.8; color: var(--ah-color-text); }
.ah-article__cta-block {
  background: var(--ah-color-bg);
  border-left: 4px solid var(--ah-color-primary);
  border-radius: 0 var(--ah-border-radius) var(--ah-border-radius) 0;
  padding: 28px 32px;
  margin: 40px 0;
}
.ah-cta-block__title { margin: 0 0 10px; color: var(--ah-color-primary); }
.ah-article__nav { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid #e2e8f0; flex-wrap: wrap; }
.ah-article__nav-link { color: var(--ah-color-secondary); text-decoration: none; font-size: .9rem; }

/* ── Login / Reset ──────────────────────────────────────────────────────── */
.ah-login-wrap { max-width: 420px; background: var(--ah-color-white); padding: 36px; border-radius: var(--ah-border-radius); box-shadow: var(--ah-shadow); }
.ah-login-links { margin-top: 18px; font-size: .875rem; text-align: center; color: var(--ah-color-muted); }
.ah-login-links a { color: var(--ah-color-secondary); text-decoration: none; }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.ah-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 32px; }
.ah-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  color: var(--ah-color-text);
  text-decoration: none;
  font-size: .875rem;
  transition: background var(--ah-transition), color var(--ah-transition);
}
.ah-pagination .page-numbers.current,
.ah-pagination .page-numbers:hover { background: var(--ah-color-primary); color: #fff; border-color: var(--ah-color-primary); }

/* ── No results ─────────────────────────────────────────────────────────── */
.ah-no-results { text-align: center; padding: 40px; color: var(--ah-color-muted); font-style: italic; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .ah-form-row--2col > .ah-form-group { flex: 1 1 100%; }
  .ah-newsletter__inner { flex-direction: column; }
  .ah-newsletter__fields { flex-direction: column; }
  .ah-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ah-stat__number { font-size: 2rem; }
  .ah-article__title { font-size: 1.5rem; }
  .ah-login-wrap { padding: 24px; }
  .ah-filter-row { flex-direction: column; }
}
