/*
 * Recrutement staff — espace candidat public.
 *
 * Toutes les classes sont prefixees `rec-` pour ne jamais entrer en collision
 * avec le theme de base. Aucune regle ne cible d'element nu hors de .rec-shell.
 */

.rec-shell {
  --rec-accent: #5865f2;
  --rec-surface: rgba(255, 255, 255, 0.04);
  --rec-surface-strong: rgba(255, 255, 255, 0.07);
  --rec-border: rgba(255, 255, 255, 0.10);
  --rec-text: #e8ebf5;
  --rec-muted: #9aa3bd;
  --rec-radius: 14px;

  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  color: var(--rec-text);
}

/* --------------------------------------------------------------------- */
/* En-tetes                                                              */
/* --------------------------------------------------------------------- */

.rec-hero {
  margin-bottom: 28px;
}

.rec-hero__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--rec-accent);
}

.rec-hero__title {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.15;
  font-weight: 800;
}

.rec-hero__lead {
  margin: 0 0 8px;
  max-width: 68ch;
  color: var(--rec-muted);
  line-height: 1.6;
}

.rec-hero__count {
  margin: 0;
  font-weight: 700;
}

.rec-hero__mine {
  margin: 10px 0 0;
}

.rec-link {
  color: var(--rec-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rec-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--rec-muted);
}

.rec-breadcrumb a {
  color: var(--rec-muted);
}

.rec-breadcrumb a:hover {
  color: var(--rec-text);
}

/* --------------------------------------------------------------------- */
/* Cartes d'offre                                                        */
/* --------------------------------------------------------------------- */

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.rec-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--rec-border);
  border-radius: var(--rec-radius);
  background: var(--rec-surface);
  border-top: 3px solid var(--rec-accent);
}

.rec-card--closed,
.rec-card--suspended {
  opacity: 0.72;
}

.rec-card__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-card__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.rec-card__title a {
  color: inherit;
}

.rec-card__title a:hover {
  color: var(--rec-accent);
}

.rec-card__campaign,
.rec-card__pitch {
  margin: 0;
  color: var(--rec-muted);
  font-size: 14px;
  line-height: 1.55;
}

.rec-card__missions {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--rec-muted);
}

.rec-card__facts,
.rec-panel__facts,
.rec-application__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
}

.rec-card__facts > div,
.rec-panel__facts > div,
.rec-application__facts > div {
  min-width: 0;
}

.rec-card__facts dt,
.rec-panel__facts dt,
.rec-application__facts dt {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rec-muted);
}

.rec-card__facts dd,
.rec-panel__facts dd,
.rec-application__facts dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.rec-card__foot {
  margin-top: auto;
  padding-top: 6px;
}

/* --------------------------------------------------------------------- */
/* Badges                                                                */
/* --------------------------------------------------------------------- */

.rec-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--rec-border);
  background: var(--rec-surface-strong);
  color: var(--rec-muted);
}

.rec-badge--success { color: #7ee2a8; border-color: rgba(126, 226, 168, 0.35); background: rgba(126, 226, 168, 0.10); }
.rec-badge--info    { color: #86b7ff; border-color: rgba(134, 183, 255, 0.35); background: rgba(134, 183, 255, 0.10); }
.rec-badge--warning { color: #f5c97a; border-color: rgba(245, 201, 122, 0.35); background: rgba(245, 201, 122, 0.10); }
.rec-badge--danger  { color: #f79a9a; border-color: rgba(247, 154, 154, 0.35); background: rgba(247, 154, 154, 0.10); }
.rec-badge--progress{ color: #b7a8ff; border-color: rgba(183, 168, 255, 0.35); background: rgba(183, 168, 255, 0.10); }
.rec-badge--draft   { color: var(--rec-muted); }
.rec-badge--muted   { color: var(--rec-muted); }

/* --------------------------------------------------------------------- */
/* Boutons                                                               */
/* --------------------------------------------------------------------- */

.rec-btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease;
}

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

.rec-btn--primary:hover {
  filter: brightness(1.1);
  color: #fff;
}

.rec-btn--ghost {
  background: transparent;
  border-color: var(--rec-border);
  color: var(--rec-text);
}

.rec-btn--ghost:hover {
  background: var(--rec-surface-strong);
  color: var(--rec-text);
}

.rec-btn--danger {
  background: transparent;
  border-color: rgba(247, 154, 154, 0.45);
  color: #f79a9a;
}

.rec-btn--danger:hover {
  background: rgba(247, 154, 154, 0.12);
  color: #f79a9a;
}

.rec-btn--wide {
  display: block;
  width: 100%;
}

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.rec-inline-form {
  display: inline;
  margin: 0;
}

/* --------------------------------------------------------------------- */
/* Fiche de poste                                                        */
/* --------------------------------------------------------------------- */

.rec-detail__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--rec-border);
}

.rec-detail__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
}

.rec-detail__campaign {
  margin: 0;
  font-weight: 600;
  color: var(--rec-accent);
}

.rec-detail__pitch {
  margin: 0;
  max-width: 70ch;
  color: var(--rec-muted);
  line-height: 1.6;
}

.rec-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 26px;
  align-items: start;
}

@media (max-width: 900px) {
  .rec-detail__layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rec-block {
  margin-bottom: 26px;
}

.rec-block__title,
.rec-panel__title,
.rec-section__title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
}

.rec-block__body {
  color: var(--rec-muted);
  line-height: 1.65;
}

.rec-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
  color: var(--rec-muted);
  line-height: 1.55;
}

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

.rec-panel--apply {
  border-top: 3px solid var(--rec-accent);
}

.rec-note {
  margin: 14px 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--rec-muted);
}

.rec-note--warning {
  color: #f5c97a;
}

/* --------------------------------------------------------------------- */
/* Checklist d'eligibilite                                               */
/* --------------------------------------------------------------------- */

.rec-checks {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: grid;
  gap: 9px;
}

.rec-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
}

.rec-check__mark {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--rec-border);
}

.rec-check--ok   .rec-check__mark { color: #7ee2a8; border-color: rgba(126, 226, 168, 0.45); }
.rec-check--ko   .rec-check__mark { color: #f79a9a; border-color: rgba(247, 154, 154, 0.45); }
.rec-check--info .rec-check__mark { color: #86b7ff; border-color: rgba(134, 183, 255, 0.45); }

.rec-check--ko .rec-check__label { color: #f79a9a; }
.rec-check--info .rec-check__label { color: var(--rec-muted); }

/* --------------------------------------------------------------------- */
/* Formulaire                                                            */
/* --------------------------------------------------------------------- */

.rec-apply__head {
  margin-bottom: 20px;
}

.rec-apply__title {
  margin: 0 0 6px;
  font-size: clamp(23px, 2.8vw, 31px);
  font-weight: 800;
}

.rec-apply__campaign {
  margin: 0 0 4px;
  font-weight: 600;
  color: var(--rec-accent);
}

.rec-apply__reference {
  margin: 0;
  font-size: 13px;
  color: var(--rec-muted);
}

.rec-progress {
  margin: 0 0 24px;
  padding: 16px 18px;
  border: 1px solid var(--rec-border);
  border-radius: var(--rec-radius);
  background: var(--rec-surface);
}

.rec-progress--compact {
  padding: 12px 0 0;
  border: 0;
  background: none;
  margin-bottom: 0;
}

.rec-progress__copy {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
}

.rec-progress__saved {
  color: var(--rec-muted);
  font-size: 13px;
}

.rec-progress__saved--error {
  color: #f79a9a;
}

.rec-progress__bar {
  height: 8px;
  border-radius: 999px;
  background: var(--rec-surface-strong);
  overflow: hidden;
}

.rec-progress--compact .rec-progress__bar {
  margin-top: 8px;
}

.rec-progress__fill {
  display: block;
  height: 100%;
  width: var(--rec-progress, 0%);
  border-radius: inherit;
  background: var(--rec-accent);
  transition: width 0.3s ease;
}

.rec-section {
  margin-bottom: 30px;
  padding: 22px;
  border: 1px solid var(--rec-border);
  border-radius: var(--rec-radius);
  background: var(--rec-surface);
}

.rec-field {
  margin-bottom: 22px;
}

.rec-field:last-child {
  margin-bottom: 0;
}

.rec-field__group {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.rec-field__label {
  display: block;
  margin: 0 0 7px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  padding: 0;
}

.rec-field__required {
  color: #f79a9a;
}

.rec-field__description {
  margin: 0 0 9px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--rec-muted);
}

.rec-field__hint,
.rec-field__counter {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--rec-muted);
}

.rec-field__counter--full {
  color: #f5c97a;
}

.rec-field__error {
  margin: 7px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #f79a9a;
}

.rec-field--error .rec-input,
.rec-field--error .rec-options {
  border-color: rgba(247, 154, 154, 0.55);
}

.rec-field__info {
  padding: 14px 16px;
  border-left: 3px solid var(--rec-accent);
  border-radius: 0 10px 10px 0;
  background: var(--rec-surface-strong);
}

.rec-field__info-title {
  margin: 0 0 5px;
  font-weight: 700;
}

.rec-field__info-body {
  color: var(--rec-muted);
  font-size: 14px;
  line-height: 1.6;
}

.rec-input {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--rec-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--rec-text);
  font: inherit;
  font-size: 15px;
}

.rec-input:focus {
  outline: 2px solid var(--rec-accent);
  outline-offset: 1px;
  border-color: var(--rec-accent);
}

.rec-input--textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
}

/* Champ « Pseudo Discord » verrouille (compte Discord lie) */
.rec-locked {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(126, 226, 168, 0.35);
  border-radius: 10px;
  background: rgba(126, 226, 168, 0.07);
  cursor: not-allowed;
  user-select: none;
}

.rec-locked__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: rgba(126, 226, 168, 0.9);
}

.rec-locked__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--rec-text);
}

.rec-locked__badge {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #7ee2a8;
  border: 1px solid rgba(126, 226, 168, 0.35);
  background: rgba(126, 226, 168, 0.10);
}

@media (max-width: 520px) {
  .rec-locked {
    flex-wrap: wrap;
  }
  .rec-locked__value {
    flex-basis: 100%;
  }
  .rec-locked__badge {
    margin-left: 26px;
  }
}

.rec-options {
  display: grid;
  gap: 8px;
  padding: 4px 0;
  border: 1px solid transparent;
  border-radius: 10px;
}

.rec-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--rec-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
  font-size: 15px;
  line-height: 1.45;
  cursor: pointer;
  margin: 0 0 8px;
}

.rec-options .rec-option {
  margin: 0;
}

.rec-option:hover {
  background: var(--rec-surface-strong);
}

.rec-option input {
  margin-top: 3px;
  flex: 0 0 auto;
  accent-color: var(--rec-accent);
}

.rec-option input:disabled + span {
  opacity: 0.5;
}

.rec-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rec-scale__step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--rec-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
  cursor: pointer;
  font-weight: 600;
}

.rec-scale__step input {
  accent-color: var(--rec-accent);
}

.rec-form__legal {
  margin: 24px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--rec-muted);
}

/* --------------------------------------------------------------------- */
/* Messages                                                              */
/* --------------------------------------------------------------------- */

.rec-flash {
  margin: 0 0 20px;
  padding: 13px 16px;
  border: 1px solid var(--rec-border);
  border-radius: 10px;
  background: var(--rec-surface-strong);
  font-size: 14px;
  font-weight: 600;
}

.rec-flash--success { color: #7ee2a8; border-color: rgba(126, 226, 168, 0.35); }
.rec-flash--error   { color: #f79a9a; border-color: rgba(247, 154, 154, 0.35); }

.rec-alert {
  margin: 0 0 22px;
  padding: 16px 18px;
  border: 1px solid rgba(247, 154, 154, 0.35);
  border-radius: var(--rec-radius);
  background: rgba(247, 154, 154, 0.08);
}

.rec-alert__title {
  margin: 0 0 8px;
  font-weight: 700;
  color: #f79a9a;
}

.rec-alert__list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
  font-size: 14px;
}

.rec-alert__list a {
  color: #f79a9a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rec-empty {
  padding: 44px 24px;
  text-align: center;
  border: 1px dashed var(--rec-border);
  border-radius: var(--rec-radius);
  background: var(--rec-surface);
}

.rec-empty__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.rec-empty__text {
  margin: 0 0 18px;
  color: var(--rec-muted);
  line-height: 1.6;
}

.rec-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 0;
}

/* --------------------------------------------------------------------- */
/* Relecture avant envoi                                                 */
/* --------------------------------------------------------------------- */

.rec-review {
  padding: 24px;
  border: 1px solid var(--rec-border);
  border-radius: var(--rec-radius);
  background: var(--rec-surface);
}

.rec-review__list {
  margin: 18px 0 0;
  display: grid;
  gap: 16px;
}

.rec-review__row {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rec-border);
}

.rec-review__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.rec-review__row dt {
  margin: 0 0 5px;
  font-weight: 700;
  font-size: 14px;
}

.rec-review__row dd {
  margin: 0;
  color: var(--rec-muted);
  line-height: 1.6;
}

.rec-review__empty {
  font-style: italic;
  opacity: 0.75;
}

/* --------------------------------------------------------------------- */
/* Espace candidat                                                       */
/* --------------------------------------------------------------------- */

.rec-applications {
  display: grid;
  gap: 18px;
}

.rec-application {
  padding: 20px;
  border: 1px solid var(--rec-border);
  border-left: 3px solid var(--rec-accent);
  border-radius: var(--rec-radius);
  background: var(--rec-surface);
}

.rec-application--focus {
  outline: 2px solid var(--rec-accent);
  outline-offset: 2px;
}

.rec-application__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.rec-application__title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.rec-application__campaign {
  margin: 0;
  font-size: 14px;
  color: var(--rec-muted);
}

.rec-application__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.rec-timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 0 0 0 18px;
  display: grid;
  gap: 10px;
  border-left: 2px solid var(--rec-border);
}

.rec-timeline__step {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
}

.rec-timeline__step::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rec-muted);
}

.rec-timeline__step--success::before { background: #7ee2a8; }
.rec-timeline__step--danger::before  { background: #f79a9a; }
.rec-timeline__step--warning::before { background: #f5c97a; }
.rec-timeline__step--info::before    { background: #86b7ff; }
.rec-timeline__step--progress::before{ background: #b7a8ff; }

.rec-timeline__label {
  font-weight: 600;
}

.rec-timeline__date {
  color: var(--rec-muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------- */
/* Theme clair                                                           */
/* --------------------------------------------------------------------- */

body.light-mode .rec-shell,
.light-mode .rec-shell {
  --rec-surface: rgba(15, 20, 40, 0.03);
  --rec-surface-strong: rgba(15, 20, 40, 0.06);
  --rec-border: rgba(15, 20, 40, 0.12);
  --rec-text: #1b2135;
  --rec-muted: #5b647f;
}

.light-mode .rec-input,
.light-mode .rec-option,
.light-mode .rec-scale__step {
  background: #fff;
}

/* --------------------------------------------------------------------- */
/* Accessibilite                                                         */
/* --------------------------------------------------------------------- */

.rec-shell .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .rec-progress__fill,
  .rec-btn {
    transition: none;
  }
}

/* --------------------------------------------------------------------- */
/* Fil de messages (Mes candidatures)                                    */
/* --------------------------------------------------------------------- */

.rec-thread {
  margin-top: 16px;
  border: 1px solid var(--rec-border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.rec-thread__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 600;
  color: inherit;
  list-style: none;
}

.rec-thread__summary::-webkit-details-marker {
  display: none;
}

.rec-thread__empty {
  margin: 0;
  padding: 12px 14px;
  color: #64748b;
  font-size: 0.9rem;
}

.rec-thread__list {
  display: grid;
  gap: 10px;
  padding: 0 14px 12px;
  max-height: 320px;
  overflow: auto;
}

.rec-thread__msg {
  padding: 10px 12px;
  background: #f1f5f9;
  border-radius: 8px;
}

.rec-thread__msg--self {
  background: #e0f2fe;
}

.rec-thread__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: #475569;
}

.rec-thread__meta strong {
  color: #0f172a;
}

.rec-thread__body {
  margin: 0;
  white-space: pre-wrap;
}

.rec-thread__form {
  display: grid;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--rec-border, #e2e8f0);
}

.rec-thread__form textarea {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  border: 1px solid var(--rec-border, #e2e8f0);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.rec-thread__closed {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--rec-border, #e2e8f0);
  color: #64748b;
  font-size: 0.9rem;
}

.rec-thread .rec-sr-only,
.rec-shell .rec-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rec-badge--unread {
  background: #ef4444;
  color: #fff;
}

.rec-badge--info {
  background: #3b82f6;
  color: #fff;
}
