/* APYJOB — charte (thème précédent : assets/theme-backup-pre-apyjob/) */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #0f1f13;
  --muted: #5c6860;
  --brand: #d2f278;
  --brand-dark: #0f1f13;
  --forest: #0f1f13;
  --forest-mid: #002c1f;
  --accent: #f59e0b;
  --border: #e5eae4;
  --danger: #dc2626;
  --success: #15803d;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(15, 31, 19, 0.07);
  --font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* L’attribut HTML hidden doit primer sur display:flex / .btn (sinon « Enregistrement en cours » ou Arrêter visibles sans action) */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 8px;
  z-index: 9999;
}

a {
  color: var(--forest-mid);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 12px;
}
.logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}
.logo span {
  color: var(--brand);
}
.brand-logo-img {
  height: 32px;
  width: auto;
  display: block;
  max-width: 140px;
  object-fit: contain;
}
.logo:hover {
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-header__inner--portal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.site-header__inner--portal .nav-actions {
  margin-left: auto;
}
.site-header__nav {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.site-header__link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.site-header__link:hover {
  color: var(--forest);
  text-decoration: none;
}
@media (min-width: 900px) {
  .site-header__inner--portal {
    flex-wrap: nowrap;
  }
  .site-header__inner--portal .logo {
    flex-shrink: 0;
  }
  .site-header__nav {
    flex: 1 1 auto;
    justify-content: center;
    padding-top: 0;
    border-top: none;
    margin: 0 16px;
  }
  .site-header__inner--portal .nav-actions {
    margin-left: 0;
    flex-shrink: 0;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:active {
  transform: scale(0.98);
}
.btn--primary {
  background: var(--forest);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn--primary:hover {
  filter: brightness(1.08);
  text-decoration: none;
}
/** CTA type « Postuler » — fond lime, texte foncé */
.btn--lime {
  background: var(--brand);
  color: var(--forest);
  box-shadow: var(--shadow);
  font-weight: 700;
}
.btn--lime:hover {
  filter: brightness(0.97);
  text-decoration: none;
}
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.btn--ghost:hover {
  background: var(--bg);
  border-color: var(--forest-mid);
  text-decoration: none;
}
.btn--danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.btn--block {
  width: 100%;
}
.btn--sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}
.btn--lg {
  padding: 12px 22px;
  font-size: 1rem;
}
.btn--light {
  background: var(--brand);
  color: var(--forest);
  border: none;
  font-weight: 700;
  box-shadow: 0 2px 14px rgba(210, 242, 120, 0.45);
}
.btn--light:hover {
  filter: brightness(0.96);
  text-decoration: none;
}

.impersonation-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #7c3aed 0%, #5b21b6 100%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}
.impersonation-bar a {
  color: #fff;
  text-decoration: none;
}
.impersonation-bar .btn--ghost {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.impersonation-bar .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.25);
  text-decoration: none;
}

.admin-global-alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #b45309 0%, #92400e 100%);
  color: #fffbeb;
  font-size: 0.9rem;
  font-weight: 500;
}
.admin-global-alert a {
  color: #fff;
  text-decoration: none;
}
.admin-global-alert .btn--ghost {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.admin-global-alert .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.28);
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.q-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.q-card-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.q-active-toggle__eye {
  display: inline-flex;
  flex-shrink: 0;
}
.q-active-toggle__eye svg {
  display: block;
}

.question-form-manager__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
}
.question-form-manager__actions > form {
  margin: 0;
}
.question-form-manager__actions .btn--sm,
.question-form-action > summary.btn--sm {
  min-height: 34px;
  padding: 7px 14px;
  font-size: 0.88rem;
  line-height: 1.2;
}
.question-form-action {
  position: relative;
}
.question-form-action > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  margin: 0;
}
.question-form-action > summary::-webkit-details-marker {
  display: none;
}
.question-form-action__panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  width: 320px;
  max-width: calc(100vw - 48px);
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.question-form-action__panel label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 0.9rem;
}
.question-form-action__panel input,
.question-form-action__panel select {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.question-form-action__panel .btn--sm {
  width: auto;
}

/** Carte question masquée aux candidats — corps grisé seulement, bouton Activer reste visible */
.js-question-card--inactive {
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
  border-color: var(--border);
}
.js-question-card--inactive .js-q-title {
  color: var(--text-muted, var(--muted));
}
.js-question-card-body--muted {
  opacity: 0.62;
  filter: grayscale(0.22);
}

.q-sort-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.preset-bar__row label {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0;
}
.preset-bar__row select {
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card--flat {
  box-shadow: none;
}

.card h2,
.card h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}
label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text);
}
.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
}
textarea {
  min-height: 120px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(210, 242, 120, 0.55);
  outline-offset: 0;
  border-color: var(--forest-mid);
  background: #fff;
}

.radio-row,
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}
.radio-row label,
.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 0;
}

/* Oui / Non : gros boutons (candidature) */
.yn-choice {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: 6px;
  max-width: 420px;
}
.yn-choice__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.yn-choice label.yn-choice__btn,
.yn-choice__btn.yn-choice__btn {
  flex: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  min-height: 48px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  max-width: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.yn-choice__input:focus + .yn-choice__btn {
  outline: 2px solid rgba(15, 31, 19, 0.35);
  outline-offset: 2px;
}
.yn-choice__input:checked + .yn-choice__btn {
  border-color: var(--forest-mid);
  background: rgba(210, 242, 120, 0.45);
  color: var(--forest);
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.alert--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.alert--success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.alert--info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Hero landing */
.hero {
  padding: 32px 0 48px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.35rem);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}
.hero p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 24px;
  font-size: 1.05rem;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.steps {
  display: grid;
  gap: 16px;
  margin-top: 40px;
}
@media (min-width: 720px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
}
.step__num {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(210, 242, 120, 0.4);
  color: var(--brand-dark);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.step h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
