/* ABORO BFF Connect — Sprint 2 auth styles
 * Encapsulé dans .aboro-bff-root pour éviter les conflits Divi.
 */

.aboro-bff-root.aboro-auth {
  --aboro-primary: #E21411;
  --aboro-primary-dark: #c01010;
  --aboro-text: #222;
  --aboro-muted: #666;
  --aboro-border: #d6d6d6;
  --aboro-bg: #fff;
  --aboro-bg-alt: #f6f6f6;
  --aboro-success: #2e7d32;
  --aboro-error: #c62828;

  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--aboro-text);
  max-width: 540px;
  margin: 0 auto;
  padding: 24px;
  background: var(--aboro-bg);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.aboro-bff-root.aboro-auth-account,
.aboro-bff-root.aboro-my-applications {
  max-width: 880px;
}

.aboro-bff-root.aboro-auth h2.aboro-auth-greeting {
  margin: 0 0 24px;
  font-size: 1.6rem;
  color: var(--aboro-primary);
}

/* ── Form fields ─────────────────────────────────────────── */

/* Fix Divi : Divi ne force pas box-sizing border-box sur les inputs natifs,
 * et les inputs HTML ont une min-width implicite ("size" attribute) qui les
 * empeche de respecter les colonnes grid -> debordement du formulaire.
 */
.aboro-bff-root,
.aboro-bff-root *,
.aboro-bff-root *::before,
.aboro-bff-root *::after {
  box-sizing: border-box;
}

/* Le wrapper register a plus de champs (civilite + prenom + nom) que les autres
 * — on l'autorise plus large pour eviter le scrunch en grid 3-col. */
.aboro-bff-root.aboro-auth-register {
  max-width: 720px;
}

.aboro-bff-root .aboro-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

.aboro-bff-root .aboro-auth-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

@media (max-width: 640px) {
  .aboro-bff-root .aboro-auth-row {
    grid-template-columns: 1fr;
  }
}

.aboro-bff-root .aboro-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.aboro-bff-root .aboro-auth-field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--aboro-text);
}

.aboro-bff-root .aboro-auth-field input,
.aboro-bff-root .aboro-auth-field select,
.aboro-bff-root .aboro-auth-field textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--aboro-border);
  border-radius: 6px;
  background: var(--aboro-bg);
  color: var(--aboro-text);
  transition: border-color 120ms ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.aboro-bff-root .aboro-auth-field input:focus,
.aboro-bff-root .aboro-auth-field select:focus {
  outline: 2px solid var(--aboro-primary);
  outline-offset: 1px;
  border-color: var(--aboro-primary);
}

.aboro-bff-root .aboro-auth-hint {
  color: var(--aboro-muted);
  font-size: 0.8rem;
}

.aboro-bff-root .aboro-auth-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: pointer;
}

.aboro-bff-root .aboro-auth-checkbox input[type="checkbox"] {
  margin-top: 3px;
}

/* ── Buttons ─────────────────────────────────────────────── */

.aboro-bff-root .aboro-auth-submit,
.aboro-bff-root .aboro-auth-logout,
.aboro-bff-root .aboro-account-link {
  display: inline-block;
  padding: 12px 22px;
  border: 0;
  border-radius: 6px;
  background: var(--aboro-primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease;
}

.aboro-bff-root .aboro-auth-submit:hover,
.aboro-bff-root .aboro-auth-logout:hover,
.aboro-bff-root .aboro-account-link:hover {
  background: var(--aboro-primary-dark);
}

.aboro-bff-root .aboro-auth-submit:disabled,
.aboro-bff-root .aboro-auth-logout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.aboro-bff-root .aboro-auth-logout {
  background: transparent;
  color: var(--aboro-primary);
  border: 1px solid var(--aboro-primary);
}

.aboro-bff-root .aboro-auth-logout:hover {
  background: var(--aboro-primary);
  color: #fff;
}

/* ── Feedback ───────────────────────────────────────────── */

.aboro-bff-root .aboro-auth-feedback {
  min-height: 1.3em;
  font-size: 0.9rem;
}

.aboro-bff-root .aboro-auth-feedback.is-error {
  color: var(--aboro-error);
}

.aboro-bff-root .aboro-auth-feedback.is-success {
  color: var(--aboro-success);
}

.aboro-bff-root .aboro-auth-info,
.aboro-bff-root .aboro-auth-error {
  padding: 14px 18px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.aboro-bff-root .aboro-auth-info {
  background: var(--aboro-bg-alt);
  color: var(--aboro-text);
}

.aboro-bff-root .aboro-auth-error {
  background: #fde9e8;
  color: var(--aboro-error);
}

.aboro-bff-root .aboro-auth-info a,
.aboro-bff-root .aboro-auth-error a {
  color: var(--aboro-primary);
  font-weight: 600;
}

.aboro-bff-root .aboro-auth-alt {
  margin: 0;
  font-size: 0.9rem;
  color: var(--aboro-muted);
}

.aboro-bff-root .aboro-auth-alt a {
  color: var(--aboro-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* ── Account info card ─────────────────────────────────── */

.aboro-bff-root .aboro-account-info {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px 24px;
  margin: 0 0 24px;
}

.aboro-bff-root .aboro-account-info dt {
  font-weight: 600;
  color: var(--aboro-muted);
}

.aboro-bff-root .aboro-account-info dd {
  margin: 0;
  color: var(--aboro-text);
}

.aboro-bff-root .aboro-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ── Applications table ────────────────────────────────── */

.aboro-bff-root .aboro-applications-table {
  width: 100%;
  border-collapse: collapse;
}

.aboro-bff-root .aboro-applications-table th,
.aboro-bff-root .aboro-applications-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--aboro-border);
  text-align: left;
}

.aboro-bff-root .aboro-applications-table th {
  background: var(--aboro-bg-alt);
  color: var(--aboro-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aboro-bff-root .aboro-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.aboro-bff-root .aboro-status-pending      { background: #fff3cd; color: #856404; }
.aboro-bff-root .aboro-status-prequalified { background: #d6e9ff; color: #0b5ed7; }
.aboro-bff-root .aboro-status-validated    { background: #d4edda; color: #155724; }
.aboro-bff-root .aboro-status-rejected     { background: #fde9e8; color: #721c24; }

@media (max-width: 540px) {
  .aboro-bff-root .aboro-applications-table thead { display: none; }
  .aboro-bff-root .aboro-applications-table,
  .aboro-bff-root .aboro-applications-table tbody,
  .aboro-bff-root .aboro-applications-table tr,
  .aboro-bff-root .aboro-applications-table td { display: block; width: 100%; }
  .aboro-bff-root .aboro-applications-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--aboro-border);
    border-radius: 6px;
    padding: 8px;
  }
  .aboro-bff-root .aboro-applications-table td { border: 0; padding: 4px 8px; }
}

/* ═══════════════════════════════════════════════════════════
   Phase 2 — Espace entreprise
   ═══════════════════════════════════════════════════════════ */

/* ── Wider container for dashboard / tables ─────────────── */

.aboro-bff-root.aboro-entreprise-dashboard,
.aboro-bff-root.aboro-entreprise-my-jobs,
.aboro-bff-root.aboro-entreprise-my-applications {
  max-width: 960px;
}

/* ── Metric cards (dashboard) ─────────────────────────── */

.aboro-bff-root .aboro-entreprise-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

@media (max-width: 640px) {
  .aboro-bff-root .aboro-entreprise-metrics {
    grid-template-columns: 1fr;
  }
}

.aboro-bff-root .aboro-entreprise-metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  background: var(--aboro-bg-alt);
  border: 1px solid var(--aboro-border);
  border-radius: 8px;
  text-align: center;
}

.aboro-bff-root .aboro-metric-value {
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--aboro-primary);
  line-height: 1;
}

.aboro-bff-root .aboro-metric-label {
  font-size: 0.85rem;
  color: var(--aboro-muted);
  font-weight: 500;
}

/* ── CTA row (dashboard) ─────────────────────────────── */

.aboro-bff-root .aboro-entreprise-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 24px;
}

.aboro-bff-root .aboro-entreprise-cta-row .aboro-auth-submit {
  flex: 1 1 auto;
  text-align: center;
}

@media (max-width: 540px) {
  .aboro-bff-root .aboro-entreprise-cta-row {
    flex-direction: column;
  }
}

/* ── Post-job form 2-column grid ─────────────────────── */

.aboro-bff-root .aboro-post-job-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .aboro-bff-root .aboro-post-job-grid {
    grid-template-columns: 1fr;
  }
}

.aboro-bff-root .aboro-auth-field textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--aboro-border);
  border-radius: 6px;
  background: var(--aboro-bg);
  color: var(--aboro-text);
  transition: border-color 120ms ease;
  resize: vertical;
}

.aboro-bff-root .aboro-auth-field textarea:focus {
  outline: 2px solid var(--aboro-primary);
  outline-offset: 1px;
  border-color: var(--aboro-primary);
}

/* ── Tables entreprise (réutilisent .aboro-applications-table) ─ */

.aboro-bff-root .aboro-entreprise-jobs-table,
.aboro-bff-root .aboro-entreprise-applications-table {
  /* Héritent de .aboro-applications-table — pas de surcharge nécessaire. */
}

/* ── Rejected reason tooltip ──────────────────────────── */

.aboro-bff-root .aboro-entreprise-rejected-reason {
  cursor: help;
  text-decoration: underline dotted;
  color: var(--aboro-muted);
  font-size: 0.85rem;
}

/* ── Status colours (entreprise specific additions) ─── */

.aboro-bff-root .aboro-status-published { background: #d4edda; color: #155724; }

/* ── Consultant card ─────────────────────────────────── */

.aboro-bff-root.aboro-entreprise-consultant h3 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: var(--aboro-primary);
}

.aboro-bff-root.aboro-entreprise-consultant dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 20px;
  margin: 0;
}

.aboro-bff-root.aboro-entreprise-consultant dt {
  font-weight: 600;
  color: var(--aboro-muted);
  font-size: 0.9rem;
}

.aboro-bff-root.aboro-entreprise-consultant dd {
  margin: 0;
  color: var(--aboro-text);
}

.aboro-bff-root.aboro-entreprise-consultant dd a {
  color: var(--aboro-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* ─── Formulaire public "Confier mon recrutement" ─────────────────── */
/* Design epure : labels a gauche, inputs minimalistes, checkboxes carrees */

.aboro-bff-root.aboro-public-request {
  max-width: 1080px;
  margin: 0 auto;
  font-family: inherit;
  color: #1a1a1a;
}
.aboro-bff-root.aboro-public-request * {
  box-sizing: border-box;
}

/* Cards : fond gris tres leger, padding genereux, coins arrondis */
.aboro-bff-root .aboro-pr-card {
  background: #f7f7f7;
  border-radius: 16px;
  padding: 40px 48px;
  margin-bottom: 24px;
}
@media (max-width: 640px) {
  .aboro-bff-root .aboro-pr-card { padding: 24px 20px; }
}

.aboro-bff-root .aboro-pr-title {
  font-size: 24px;
  font-weight: 600;
  color: #111;
  margin: 0 0 28px 0;
  letter-spacing: -0.01em;
}

/* Layout horizontal label gauche + input droite */
.aboro-bff-root .aboro-pr-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
}
.aboro-bff-root .aboro-pr-row > label {
  font-size: 14px;
  font-weight: 400;
  color: #6b7280;
  margin: 0;
  padding-top: 0;
}
.aboro-bff-root .aboro-pr-row-textarea {
  align-items: flex-start;
}
.aboro-bff-root .aboro-pr-row-textarea > label {
  padding-top: 14px;
}
.aboro-bff-root .aboro-pr-row-options {
  align-items: center;
}
@media (max-width: 640px) {
  .aboro-bff-root .aboro-pr-row {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }
  .aboro-bff-root .aboro-pr-row-textarea > label { padding-top: 0; }
}

.aboro-bff-root .aboro-pr-control {
  position: relative;
}
.aboro-bff-root .aboro-pr-row input[type="text"],
.aboro-bff-root .aboro-pr-row input[type="email"],
.aboro-bff-root .aboro-pr-row input[type="tel"],
.aboro-bff-root .aboro-pr-row textarea {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #111;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.4;
}
.aboro-bff-root .aboro-pr-row textarea {
  resize: vertical;
  min-height: 130px;
}
.aboro-bff-root .aboro-pr-row input:hover,
.aboro-bff-root .aboro-pr-row textarea:hover {
  border-color: #d1d5db;
}
.aboro-bff-root .aboro-pr-row input:focus,
.aboro-bff-root .aboro-pr-row textarea:focus {
  outline: none;
  border-color: #C8102E;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

/* Checkboxes carrees pour Type de contrat + Niveau d'urgence */
.aboro-bff-root .aboro-pr-options {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}
.aboro-bff-root .aboro-pr-option {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 400;
  margin: 0;
  padding: 0;
  color: #6b7280;
  font-size: 14px;
  background: transparent;
  border: none;
}
.aboro-bff-root .aboro-pr-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.aboro-bff-root .aboro-pr-option-box {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  transition: all 0.15s;
  position: relative;
  flex-shrink: 0;
}
.aboro-bff-root .aboro-pr-option:hover .aboro-pr-option-box {
  border-color: #C8102E;
}
.aboro-bff-root .aboro-pr-option input[type="radio"]:checked + .aboro-pr-option-box {
  border-color: #cb1112;
  background-image: linear-gradient(90deg, #e21411 0%, #cb1112 100%);
  background-color: #cb1112;
}
.aboro-bff-root .aboro-pr-option input[type="radio"]:checked + .aboro-pr-option-box::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 6px;
  border: solid #fff;
  border-width: 0 0 2.5px 2.5px;
  transform: translate(-50%, -65%) rotate(-45deg);
}
.aboro-bff-root .aboro-pr-option input[type="radio"]:checked ~ .aboro-pr-option-label {
  color: #111;
  font-weight: 500;
}
.aboro-bff-root .aboro-pr-option-label {
  user-select: none;
}

/* Section "Vos coordonnées" : grille 2 colonnes, placeholders dans les champs */
.aboro-bff-root .aboro-pr-coords-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .aboro-bff-root .aboro-pr-coords-grid {
    grid-template-columns: 1fr;
  }
}
.aboro-bff-root .aboro-pr-coords-grid input {
  width: 100%;
  padding: 14px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #111;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.aboro-bff-root .aboro-pr-coords-grid input::placeholder {
  color: #9ca3af;
  font-size: 14px;
}
.aboro-bff-root .aboro-pr-coords-grid input:focus {
  outline: none;
  border-color: #C8102E;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

.aboro-bff-root .aboro-pr-legal {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.aboro-bff-root .aboro-pr-submit-row {
  display: flex;
  justify-content: flex-end;
}
.aboro-bff-root .aboro-pr-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background-image: linear-gradient(90deg, #e21411 0%, #cb1112 100%);
  background-color: #cb1112;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background-image 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(226, 20, 17, 0.25);
}
.aboro-bff-root .aboro-pr-submit:hover {
  background-image: linear-gradient(90deg, #cb1112 0%, #a80d10 100%);
  background-color: #a80d10;
  box-shadow: 0 4px 12px rgba(226, 20, 17, 0.35);
}
.aboro-bff-root .aboro-pr-submit:active {
  transform: translateY(1px);
}
.aboro-bff-root .aboro-pr-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.aboro-bff-root .aboro-pr-submit span[aria-hidden] {
  display: inline-block;
  transition: transform 0.15s;
  font-size: 18px;
}
.aboro-bff-root .aboro-pr-submit:hover span[aria-hidden] {
  transform: translateX(3px);
}

/* Feedback */
.aboro-bff-root .aboro-public-request-feedback {
  margin-top: 18px;
  padding: 0;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}
.aboro-bff-root .aboro-public-request-feedback.aboro-feedback-success {
  padding: 14px 18px;
  background: #e6f4ea;
  color: #1a7a3a;
  border: 1px solid #b6dfc5;
}
.aboro-bff-root .aboro-public-request-feedback.aboro-feedback-error {
  padding: 14px 18px;
  background: #fdecea;
  color: #b3261e;
  border: 1px solid #f5c2c0;
}
.aboro-bff-root .aboro-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: aboro-spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}
@keyframes aboro-spin {
  to { transform: rotate(360deg); }
}

/* ── Mot de passe oublié + alignements (revue client 16/06) ─────────── */

/* Lien « Mot de passe oublié ? » sous le champ mot de passe, aligné à droite. */
.aboro-bff-root .aboro-auth-forgot {
  margin: -6px 0 0;
  text-align: right;
  font-size: 0.85rem;
}
.aboro-bff-root .aboro-auth-forgot a {
  color: var(--aboro-primary);
  font-weight: 600;
  text-decoration: none;
}
.aboro-bff-root .aboro-auth-forgot a:hover {
  text-decoration: underline;
}

/* Intro du formulaire « mot de passe oublié ». */
.aboro-bff-root .aboro-auth-intro {
  margin: 0;
  color: var(--aboro-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Case d'acceptation : le texte (et ses liens) occupe la colonne restante
 * et s'aligne proprement à côté de la case — corrige le décalage de ligne. */
.aboro-bff-root .aboro-auth-checkbox label {
  align-items: flex-start;
}
.aboro-bff-root .aboro-auth-checkbox-text {
  flex: 1 1 auto;
  min-width: 0;
}
.aboro-bff-root .aboro-auth-checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
}
.aboro-bff-root .aboro-auth-checkbox-text a {
  color: var(--aboro-primary);
  font-weight: 600;
}

/* ── « Mes candidatures » : mise en page étoffée (revue client 16/06) ── */
.aboro-bff-root.aboro-my-applications {
  max-width: 1080px;
}
.aboro-bff-root .aboro-myapps-title {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--aboro-primary);
}
.aboro-bff-root .aboro-myapps-intro {
  margin: 0 0 22px;
  color: var(--aboro-muted);
  font-size: 0.95rem;
}
/* Lignes plus aérées + colonne Poste qui occupe l'espace */
.aboro-bff-root .aboro-applications-table th,
.aboro-bff-root .aboro-applications-table td {
  padding: 16px 18px;
  vertical-align: middle;
}
.aboro-bff-root .aboro-applications-table th:first-child,
.aboro-bff-root .aboro-myapps-poste {
  width: 60%;
}
.aboro-bff-root .aboro-myapps-poste-title {
  display: block;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--aboro-text);
  line-height: 1.3;
}
.aboro-bff-root .aboro-myapps-poste-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--aboro-muted);
  line-height: 1.4;
}
.aboro-bff-root .aboro-myapps-dash { color: var(--aboro-muted); }
/* Badge statut « Retirée » (gris) + variantes manquantes */
.aboro-bff-root .aboro-status-withdrawn,
.aboro-bff-root .aboro-status-removed { background: #ececec; color: #555; }
.aboro-bff-root .aboro-status-syncerror { background: #fff3cd; color: #856404; }
