/* ==========================================================
   FasoCraft — Pages d'authentification
   Partagé par client/login, client/register et artisan/login.
   Uniquement des jetons du design system (design-system.css, à charger avant
   ce fichier) : aucune couleur ni police écrite en dur, pour qu'un changement
   de charte se fasse à un seul endroit. Le vert (--recolte) ne sert qu'aux
   messages de succès.
   ========================================================== */

:root {
  /* Quadrillage discret du volet gauche : l'ocre de la marque (--ochre-bogolan) à 5 % */
  --auth-grid-color: rgba(154, 75, 34, 0.05);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background: var(--surface-white);
  color: var(--ink-primary);
  min-height: 100vh;
  display: flex;
}

.auth-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ---- Volet gauche : identité et réassurance ---- */
.auth-brand-side {
  flex: 1.1;
  min-width: 0;
  background-color: var(--surface-card);
  background-image:
    linear-gradient(to right, var(--auth-grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--auth-grid-color) 1px, transparent 1px);
  background-size: 32px 32px;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border-light);
}

.auth-brand-header {
  display: flex;
  align-items: center;
}

.brand-logo-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.brand-logo-text span {
  color: var(--ochre-bogolan);
}

.auth-brand-hero {
  max-width: 520px;
  margin: 40px 0;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--ochre-bogolan-tint);
  color: var(--ochre-bogolan-hover);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ochre-bogolan);
}

.auth-brand-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink-primary);
  letter-spacing: -0.5px;
  margin: 0 0 20px;
}
.auth-brand-title span {
  color: var(--ochre-bogolan);
}

.auth-brand-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-secondary);
  margin: 0;
}

/* Trois cartes de réassurance */
.auth-trust-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 580px;
}
.trust-card {
  background: var(--surface-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
/* Taille fluide : « RAYONNEMENT » (11 capitales en Fraunces gras) doit tenir sur une ligne dans une carte étroite */
.trust-card-metric {
  font-family: var(--font-display);
  font-size: clamp(12px, 1.15vw, 16px);
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 2px;
  overflow-wrap: break-word;
}
.trust-card-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ochre-bogolan);
  margin-bottom: 4px;
}
.trust-card-text {
  font-size: 11px;
  color: var(--ink-secondary);
  line-height: 1.35;
}

/* ---- Volet droit : formulaire ---- */
.auth-form-side {
  flex: 1;
  min-width: 0;
  padding: 40px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.pill-btn:hover {
  border-color: var(--ochre-bogolan);
  background: var(--surface-card);
  color: var(--ochre-bogolan-hover);
}

.auth-form-container {
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 24px 0;
}
/* L'inscription a plus de champs : conteneur un peu plus large */
.auth-form-container--large {
  max-width: 460px;
}

.form-welcome-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink-primary);
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}
.form-welcome-subtitle {
  font-size: 14px;
  color: var(--ink-secondary);
  margin: 0 0 28px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-group {
  margin-bottom: 20px;
}
.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-secondary);
}
.form-group > .form-label {
  margin-bottom: 6px;
}
.form-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--ochre-bogolan);
  text-decoration: none;
}
.form-link:hover {
  text-decoration: underline;
}

.input-wrapper {
  position: relative;
}
.form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 44px 13px 16px; /* place à droite pour l'œil d'affichage du mot de passe */
  background: var(--surface-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--ochre-bogolan);
  box-shadow: 0 0 0 3px rgba(154, 75, 34, 0.15);
}
/* Un exemple de saisie ne doit jamais ressembler à une valeur déjà saisie */
.form-input::placeholder {
  color: var(--ink-muted);
  opacity: 0.7;
}

.toggle-password-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 15px;
  padding: 4px;
}
.toggle-password-btn:hover {
  color: var(--ink-primary);
}

.btn-submit-main {
  width: 100%;
  padding: 14px;
  background: var(--ochre-bogolan);
  color: var(--surface-white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
}
.btn-submit-main:hover {
  background: var(--ochre-bogolan-hover);
  transform: translateY(-1px);
}
.btn-submit-main:focus-visible {
  outline: 2px solid var(--ochre-bogolan);
  outline-offset: 2px;
}

.auth-switch-prompt {
  text-align: center;
  font-size: 13px;
  color: var(--ink-secondary);
  margin-top: 24px;
  line-height: 1.5;
}
.auth-switch-prompt a {
  color: var(--ochre-bogolan);
  font-weight: 700;
  text-decoration: none;
}
.auth-switch-prompt a:hover {
  text-decoration: underline;
}

.auth-footer {
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
}

/* Les messages d'erreur et de succès de ces pages utilisent la classe .flash du design system (design-system.css) */

/* ---- Petit écran d'ordinateur : le volet de marque se resserre pour que les trois cartes restent lisibles ---- */
@media (max-width: 1200px) {
  .auth-brand-side {
    padding: 40px 32px;
  }
  .auth-trust-cards {
    gap: 10px;
  }
  .trust-card {
    padding: 12px;
  }
}

/* ---- Téléphone : le volet de marque disparaît, le formulaire prend toute la largeur ---- */
@media (max-width: 991px) {
  .auth-brand-side {
    display: none;
  }
  .auth-form-side {
    padding: 32px 20px;
  }
  .auth-form-container {
    padding: 12px 0;
  }
  .form-row-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}
