/* ============================================================
   HireKazi — Auth Pages CSS
   Login & Register — Split Screen Design
   ============================================================ */

/* ─────────────────────────────────────────────
   LAYOUT SPLIT SCREEN
   ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 2fr 3fr;
}

/* ─────────────────────────────────────────────
   PANNEAU GAUCHE — Visuel immersif
   ───────────────────────────────────────────── */
.auth-visual {
  position: relative;
  background: var(--color-dark);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-8) var(--space-8);
}

/* Fond avec motif géométrique africain subtil */
.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,58,96,.8) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(39,174,96,.3) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(0,58,96,.5) 0%, transparent 50%);
  z-index: 1;
}

/* Grille de points décorative */
.auth-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 1;
}

.auth-visual-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

/* Logo en haut */
.auth-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.auth-logo-mark {
  width: 44px; height: 44px;
  background: var(--color-accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(39,174,96,.4);
}

.auth-logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-2xl);
  color: var(--color-white);
  letter-spacing: -.02em;
}

.auth-logo-text span {
  color: var(--color-accent);
}

/* Zone centrale — illustration + texte */
.auth-visual-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-12) 0;
}

/* Illustration SVG décorative */
.auth-illustration {
  width: 100%;
  max-width: 340px;
  margin: 0 auto var(--space-10);
  animation: float 5s ease-in-out infinite;
}

.auth-tagline {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-bottom: var(--space-4);
}

.auth-tagline em {
  font-style: normal;
  color: var(--color-accent);
  position: relative;
}

/* Soulignement animé sous le mot clé */
.auth-tagline em::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 3px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  animation: expandWidth .8s .5s ease forwards;
  transform-origin: left;
  transform: scaleX(0);
}

@keyframes expandWidth {
  to { transform: scaleX(1); }
}

.auth-subtitle {
  color: rgba(255,255,255,.65);
  font-size: var(--text-lg);
  line-height: 1.6;
  max-width: 380px;
}

/* Stats en bas du panneau gauche */
.auth-stats {
  display: flex;
  gap: var(--space-8);
}

.auth-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.auth-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1;
}

.auth-stat-label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
}

/* ─────────────────────────────────────────────
   PANNEAU DROIT — Formulaire
   ───────────────────────────────────────────── */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-8);
  background: var(--color-white);
  overflow-y: auto;
}

.auth-form-container {
  width: 100%;
  max-width: 560px;
  animation: fadeInUp .5s ease forwards;
}

.auth-form-header {
  margin-bottom: var(--space-8);
}

.auth-form-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}

.auth-form-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-dark);
  letter-spacing: -.03em;
  margin-bottom: var(--space-2);
}

.auth-form-desc {
  color: var(--color-gray);
  font-size: var(--text-base);
}

/* ─────────────────────────────────────────────
   SÉLECTEUR DE RÔLE (page register)
   ───────────────────────────────────────────── */
.role-selector {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.role-option {
  position: relative;
}

.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  user-select: none;
}

.role-card:hover {
  border-color: var(--color-primary-light);
  background: var(--color-primary-xlight);
}

.role-option input:checked + .role-card {
  border-color: var(--color-primary);
  background: var(--color-primary-xlight);
  box-shadow: 0 0 0 3px rgba(0,58,96,.15);
}

.role-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--color-gray-xlight);
  transition: background var(--transition-base);
}

.role-option input:checked + .role-card .role-icon {
  background: var(--color-primary);
}

.role-label {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-dark);
  font-family: var(--font-display);
}

.role-desc {
  font-size: var(--text-xs);
  color: var(--color-gray);
  line-height: 1.4;
}

/* Indicateur de vérification */
.role-check {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
}

.role-option input:checked ~ .role-check {
  display: flex;
}

/* ─────────────────────────────────────────────
   FORCE DU MOT DE PASSE
   ───────────────────────────────────────────── */
.password-strength {
  margin-top: var(--space-2);
}

.strength-bar {
  height: 4px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-1);
}

.strength-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-base), background var(--transition-base);
  width: 0%;
}

.strength-fill.weak   { width: 25%; background: var(--color-error); }
.strength-fill.fair   { width: 50%; background: var(--color-warning); }
.strength-fill.good   { width: 75%; background: var(--color-accent-light); }
.strength-fill.strong { width: 100%; background: var(--color-accent); }

.strength-text {
  font-size: var(--text-xs);
  color: var(--color-gray);
}

/* ─────────────────────────────────────────────
   FOOTER DU FORMULAIRE
   ───────────────────────────────────────────── */
.auth-form-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-gray);
}

.auth-form-footer a {
  color: var(--color-primary);
  font-weight: 600;
}
.auth-form-footer a:hover {
  color: var(--color-accent);
}

/* CGU checkbox */
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.terms-check input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.terms-check label {
  font-size: var(--text-sm);
  color: var(--color-gray);
  cursor: pointer;
  line-height: 1.5;
}
.terms-check label a { font-weight: 600; }

/* ─────────────────────────────────────────────
   RESPONSIVE — MOBILE
   ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-panel { padding: var(--space-8) var(--space-6); min-height: 100vh; }
}

@media (max-width: 480px) {
  .auth-form-panel { padding: var(--space-6) var(--space-4); }
  .role-selector { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────
   LUCIDE — Auth pages
   ───────────────────────────────────────────── */
i[data-lucide].input-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-light);
  pointer-events: none;
  width: 18px;
  height: 18px;
}
.input-wrapper i[data-lucide].input-icon-right {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--color-gray-light);
  width: 18px;
  height: 18px;
  transition: color var(--transition-fast);
}
.input-wrapper i[data-lucide].input-icon-right:hover {
  color: var(--color-primary);
}

/* ─────────────────────────────────────────────
   AUTH — Éléments inline extraits
   ───────────────────────────────────────────── */

/* Ligne "Se souvenir / Mot de passe oublié" */
.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}
.auth-remember-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-gray);
    cursor: pointer;
}
.auth-remember-label input[type="checkbox"] {
    accent-color: var(--color-primary);
}
.auth-forgot-link {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}
.auth-forgot-link:hover { opacity: .75; }

/* Label optionnel (ex: "recommandé") */
.form-label-hint {
    font-weight: 400;
    color: var(--color-gray);
    font-size: var(--text-xs);
}

/* Message d'erreur inline terms */
.form-error-terms {
    display: block;
    margin-top: -12px;
    margin-bottom: 16px;
}

/* Indicateur force mot de passe */
.password-strength { display: none; }
.password-strength.visible { display: block; }

/* Icône dans le groupe "companyGroup" (caché par défaut si candidat) */
.company-group--hidden { display: none; }

/* ─────────────────────────────────────────────
   REGISTER — Layout 2 colonnes + nouveau role selector
   ───────────────────────────────────────────── */

/* Grille 2 colonnes pour les champs liés */
.register-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}
.register-row .form-group { margin-bottom: 0; }

/* Options (checkboxes) */
.register-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

/* ── Nouveau sélecteur de rôle ── */
.register-role-input { display: none; }

.register-role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 6px;
}

.register-role-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 2px solid #E2E8EF;
    cursor: pointer;
    transition: all .2s ease;
    background: white;
    position: relative;
    overflow: hidden;
}
.register-role-card:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-xlight);
}

/* Icône */
.register-role-card__icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
}

/* Texte */
.register-role-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.register-role-card__title {
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--color-dark);
    line-height: 1.3;
}
.register-role-card__desc {
    font-size: 11px;
    color: var(--color-gray);
    line-height: 1.3;
}

/* Check icon (caché par défaut) */
.register-role-card__check {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(.5);
    transition: all .2s;
}

/* ── CANDIDAT — vert ── */
.register-role-card--candidate .register-role-card__icon {
    background: rgba(39,174,96,.1);
    color: var(--color-accent);
}
.register-role-input#role_candidate:checked + .register-role-card--candidate {
    border-color: var(--color-accent);
    background: rgba(39,174,96,.05);
    box-shadow: 0 0 0 3px rgba(39,174,96,.12);
}
.register-role-input#role_candidate:checked + .register-role-card--candidate
    .register-role-card__icon {
    background: var(--color-accent);
    color: white;
}
.register-role-input#role_candidate:checked + .register-role-card--candidate
    .register-role-card__title {
    color: var(--color-accent-dark, #1A7940);
}
.register-role-input#role_candidate:checked + .register-role-card--candidate
    .register-role-card__check {
    background: var(--color-accent);
    color: white;
    opacity: 1;
    transform: scale(1);
}

/* ── RECRUTEUR — bleu ── */
.register-role-card--recruiter .register-role-card__icon {
    background: rgba(0,58,96,.1);
    color: var(--color-primary);
}
.register-role-input#role_recruiter:checked + .register-role-card--recruiter {
    border-color: var(--color-primary);
    background: rgba(0,58,96,.05);
    box-shadow: 0 0 0 3px rgba(0,58,96,.12);
}
.register-role-input#role_recruiter:checked + .register-role-card--recruiter
    .register-role-card__icon {
    background: var(--color-primary);
    color: white;
}
.register-role-input#role_recruiter:checked + .register-role-card--recruiter
    .register-role-card__title {
    color: var(--color-primary);
}
.register-role-input#role_recruiter:checked + .register-role-card--recruiter
    .register-role-card__check {
    background: var(--color-primary);
    color: white;
    opacity: 1;
    transform: scale(1);
}

/* Responsive */
@media (max-width: 520px) {
    .register-row { grid-template-columns: 1fr; }
    .register-role-selector { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   ICÔNES D'ÉTAT — Reset mot de passe
   ══════════════════════════════════════════ */
.auth-success-icon,
.auth-error-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
}
.auth-success-icon {
    background: var(--color-accent-xlight, #EAFAF1);
    color: var(--color-accent, #00C16E);
}
.auth-error-icon {
    background: var(--color-error-light, #FDEDEC);
    color: var(--color-error, #E74C3C);
}
.icon-xl { width: 30px; height: 30px; }

/* ══════════════════════════════════════════
   Arguments qualitatifs (remplacent les stats chiffrées)
   ══════════════════════════════════════════ */
.auth-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.auth-feature {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm, 14px);
    font-weight: 500;
    color: rgba(255, 255, 255, .92);
}
.auth-feature i {
    color: #00C16E;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   Avertissement Verr. Maj (Caps Lock)
   ══════════════════════════════════════════ */
.auth-capslock {
    display: none; /* affiché en JS via data-capslock */
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: var(--text-xs, 12px);
    font-weight: 600;
    color: #B7860B;
}
.auth-capslock i { flex-shrink: 0; }
