/* ═══════════════════════════════════════════════════════════════════
   SACRECHEICI CRM — Page d'authentification
   Palette : violet #6777ef (identique à l'app principale)
   Stack   : Bootstrap 4 · Poppins · FontAwesome 5
═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────── DESIGN TOKENS ──────────────────────── */
:root {
  --saas-font          : 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* ─── Couleurs — alignées sur ui-enhancements.css ─── */
  --saas-primary       : #6777ef;
  --saas-primary-dark  : #4e5fc7;
  --saas-primary-light : #eaecff;
  --saas-accent        : #26dad2;
  --saas-accent-light  : #d0f7f5;

  /* Surfaces */
  --saas-bg            : #f0f2f8;
  --saas-surface       : #ffffff;
  --saas-border        : #e5e9f2;
  --saas-border-focus  : #adb7f7;

  /* Typographie */
  --saas-text          : #34395e;
  --saas-muted         : #9faabf;
  --saas-subtle        : #b8c1d9;

  /* Feedback */
  --saas-danger        : #DC2626;
  --saas-danger-bg     : #FEF2F2;
  --saas-success       : #059669;
  --saas-success-bg    : #ECFDF5;
  --saas-warning       : #D97706;
  --saas-warning-bg    : #FFFBEB;

  /* Géométrie */
  --saas-radius        : 14px;
  --saas-radius-sm     : 9px;
  --saas-radius-lg     : 20px;
  --saas-radius-pill   : 999px;

  /* Ombres — teintées violet comme le reste de l'app */
  --saas-shadow-sm     : 0 1px 4px rgba(103,119,239,.07), 0 1px 2px rgba(103,119,239,.04);
  --saas-shadow-md     : 0 4px 16px rgba(103,119,239,.11), 0 2px 6px rgba(103,119,239,.06);
  --saas-shadow-lg     : 0 16px 48px rgba(103,119,239,.18), 0 4px 14px rgba(103,119,239,.09);
  --saas-shadow-input  : 0 0 0 3px rgba(103,119,239,.18);
  --saas-shadow-btn    : 0 2px 10px rgba(103,119,239,.38);
  --saas-shadow-btn-h  : 0 6px 20px rgba(103,119,239,.50);

  /* Panneau marque — dégradé violet profond → violet CRM */
  --auth-brand-grad    : linear-gradient(155deg, #1e2158 0%, #3d46b8 50%, #6777ef 100%);
  --auth-panel-w       : 420px;
}

/* ─────────────────────── BASE AUTH PAGE ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

.auth-body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: var(--saas-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--saas-bg);
  color: var(--saas-text);
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT : SPLIT SCREEN
═══════════════════════════════════════════════════════════════════ */
.auth-split {
  display: flex;
  min-height: 100vh;
}

/* ── PANNEAU GAUCHE : MARQUE ──────────────────────────────────────── */
.auth-brand {
  position: relative;
  width: var(--auth-panel-w);
  flex-shrink: 0;
  background: var(--auth-brand-grad);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 48px 44px;
}

/* Formes décoratives flottantes */
.auth-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}
.auth-deco--a {
  width: 460px; height: 460px;
  background: radial-gradient(circle, #8e9cf5 0%, transparent 70%);
  opacity: .12;
  top: -160px; right: -160px;
  animation: floatA 9s ease-in-out infinite alternate;
}
.auth-deco--b {
  width: 280px; height: 280px;
  background: radial-gradient(circle, #26dad2 0%, transparent 70%);
  opacity: .16;
  bottom: 20px; left: -100px;
  animation: floatB 11s ease-in-out infinite alternate;
}
.auth-deco--c {
  width: 130px; height: 130px;
  border: 1.5px solid rgba(255,255,255,.18);
  background: transparent;
  bottom: 210px; right: 44px;
  animation: floatC 7s ease-in-out infinite alternate;
}
.auth-deco--d {
  width: 55px; height: 55px;
  background: rgba(38,218,210,.28);
  top: 250px; right: 90px;
  animation: floatB 8s 1.2s ease-in-out infinite alternate;
}

/* Petite grille de points en overlay */
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

@keyframes floatA { to { transform: translate(16px, 20px); } }
@keyframes floatB { to { transform: translate(-14px, -18px); } }
@keyframes floatC { to { transform: translate(8px, -12px) rotate(22deg); } }

.auth-brand-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  animation: brandSlideIn .55s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes brandSlideIn {
  from { opacity: 0; transform: translateX(-22px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Logo */
.auth-brand-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 56px;
}
.auth-brand-logo img {
  width: 44px; height: 44px;
  object-fit: contain;
  border-radius: 11px;
  background: rgba(255,255,255,.15);
  padding: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.auth-brand-logo-name {
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}

/* Titre principal */
.auth-brand-headline {
  margin-bottom: 40px;
}
.auth-brand-headline h1 {
  font-size: 2.55rem;
  font-weight: 800;
  line-height: 1.14;
  color: #fff;
  letter-spacing: -.035em;
  margin: 0 0 18px;
}
/* Mot accentué — teal (couleur accent de l'app) */
.auth-brand-headline h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #26dad2 0%, #5ef7ef 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-brand-headline p {
  color: rgba(255,255,255,.60);
  font-size: .875rem;
  line-height: 1.75;
  font-weight: 400;
  max-width: 300px;
  margin: 0;
}

/* Stats CRM — 3 chiffres en badge */
.auth-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
}
.auth-stat {
  flex: 1;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.auth-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.auth-stat-label {
  display: block;
  font-size: .68rem;
  color: rgba(255,255,255,.55);
  margin-top: 3px;
  font-weight: 500;
}

/* Fonctionnalités clés */
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8125rem;
  font-weight: 500;
  color: rgba(255,255,255,.80);
}
.auth-feature i {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
  font-size: .78rem;
  flex-shrink: 0;
  color: #a8b4ff;
}

/* ── PANNEAU DROIT : FORMULAIRE ────────────────────────────────── */
.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: var(--saas-surface);
}

/* Bande colorée en haut à droite pour ancrer la marque */
.auth-form-side::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: calc(100% - var(--auth-panel-w));
  height: 3px;
  background: linear-gradient(90deg, #6777ef 0%, #26dad2 100%);
  pointer-events: none;
}

.auth-form-box {
  width: 100%;
  max-width: 440px;
  animation: formRise .5s cubic-bezier(.16, 1, .3, 1) .15s both;
}
@keyframes formRise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* En-tête mobile */
.auth-mobile-logo {
  display: none;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
}
.auth-mobile-logo img {
  width: 36px; height: 36px;
  object-fit: contain;
  border-radius: 9px;
  background: var(--saas-primary-light);
  padding: 6px;
}
.auth-mobile-logo span {
  font-size: .9rem;
  font-weight: 700;
  color: var(--saas-text);
}

/* Badge CRM au-dessus du titre */
.auth-crm-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--saas-primary-light);
  color: var(--saas-primary);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--saas-radius-pill);
  margin-bottom: 16px;
}
.auth-crm-badge i { font-size: .65rem; }

.auth-form-heading {
  margin-bottom: 32px;
}
.auth-form-heading h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--saas-text);
  letter-spacing: -.03em;
  margin: 0 0 6px;
  line-height: 1.2;
}
.auth-form-heading p {
  font-size: .875rem;
  color: var(--saas-muted);
  margin: 0;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════════
   COMPOSANTS FORMULAIRE
═══════════════════════════════════════════════════════════════════ */

.saas-field { margin-bottom: 18px; }

.saas-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--saas-text);
  letter-spacing: .012em;
  margin-bottom: 7px;
}
.saas-label-required { color: var(--saas-danger); margin-left: 2px; }

.saas-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.saas-label-row .saas-label { margin-bottom: 0; }

/* Input */
.saas-input {
  display: block;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--saas-border);
  border-radius: var(--saas-radius-sm);
  background: #fafbfd;
  font-family: var(--saas-font);
  font-size: .875rem;
  font-weight: 400;
  color: var(--saas-text);
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none;
  appearance: none;
}
.saas-input::placeholder { color: var(--saas-subtle); font-weight: 400; }
.saas-input:focus {
  border-color: var(--saas-primary);
  background: #fff;
  box-shadow: var(--saas-shadow-input);
}
.saas-input--error {
  border-color: var(--saas-danger) !important;
  background: #FFF8F8 !important;
}
.saas-input--error:focus {
  box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
}

.saas-field-error {
  font-size: .75rem;
  color: var(--saas-danger);
  font-weight: 500;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Lien mot de passe oublié */
.saas-forgot-link {
  font-size: .775rem;
  font-weight: 600;
  color: var(--saas-primary);
  text-decoration: none;
  transition: color .15s;
}
.saas-forgot-link:hover { color: var(--saas-primary-dark); text-decoration: none; }

/* Checkbox custom */
.saas-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  margin: 20px 0 24px;
}
.saas-checkbox-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.saas-checkbox-label {
  font-size: .845rem;
  font-weight: 500;
  color: var(--saas-muted);
  line-height: 1;
}
.saas-checkbox-box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--saas-border);
  border-radius: 5px;
  background: #fafbfd;
  flex-shrink: 0;
  position: relative;
  transition: all .16s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.saas-checkbox-wrap input:checked + .saas-checkbox-box {
  background: var(--saas-primary);
  border-color: var(--saas-primary);
}
.saas-checkbox-wrap input:checked + .saas-checkbox-box::after {
  content: '';
  position: absolute;
  left: 4px; top: 1.5px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

/* Bouton */
.saas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: var(--saas-radius-sm);
  font-family: var(--saas-font);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .18s, box-shadow .18s, transform .15s;
  text-decoration: none;
  white-space: nowrap;
  outline: none;
  vertical-align: middle;
}
.saas-btn:focus, .saas-btn:hover { text-decoration: none; }

.saas-btn--primary {
  background: var(--saas-primary);
  color: #fff;
  box-shadow: var(--saas-shadow-btn);
}
.saas-btn--primary:hover {
  background: var(--saas-primary-dark);
  box-shadow: var(--saas-shadow-btn-h);
  transform: translateY(-1px);
  color: #fff;
}
.saas-btn--primary:active { transform: translateY(0); box-shadow: var(--saas-shadow-btn); }

.saas-btn--secondary {
  background: var(--saas-primary-light);
  color: var(--saas-primary);
}
.saas-btn--secondary:hover { background: #d4d9ff; color: var(--saas-primary-dark); }

.saas-btn--danger {
  background: var(--saas-danger);
  color: #fff;
  box-shadow: 0 2px 10px rgba(220,38,38,.28);
}
.saas-btn--danger:hover { background: #B91C1C; transform: translateY(-1px); color: #fff; }

.saas-btn--ghost {
  background: transparent;
  color: var(--saas-muted);
  border: 1.5px solid var(--saas-border);
}
.saas-btn--ghost:hover { background: var(--saas-bg); color: var(--saas-text); }

.saas-btn--sm { height: 34px; padding: 0 13px; font-size: .8125rem; border-radius: var(--saas-radius-sm); }
.saas-btn--lg { height: 52px; padding: 0 28px; font-size: 1rem;     border-radius: var(--saas-radius); }

/* Bouton de soumission pleine largeur avec shimmer violet */
.saas-btn-submit {
  width: 100%;
  height: 50px;
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: var(--saas-radius);
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #5568e4 0%, var(--saas-primary) 60%, #7e89f2 100%);
  box-shadow: 0 4px 18px rgba(103,119,239,.42);
}
.saas-btn-submit:hover {
  background: linear-gradient(120deg, #4457d3 0%, #5768e0 60%, #6d79e8 100%);
  box-shadow: 0 8px 28px rgba(103,119,239,.54);
  transform: translateY(-1px);
  color: #fff;
}
.saas-btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.14) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform .55s ease;
}
.saas-btn-submit:hover::before { transform: translateX(100%); }

/* Alert */
.saas-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--saas-radius-sm);
  font-size: .8375rem;
  font-weight: 500;
  margin-bottom: 22px;
  animation: alertIn .25s ease both;
}
.saas-alert > i { flex-shrink: 0; margin-top: 1px; font-size: .9rem; }
.saas-alert ul { margin: 0; padding-left: 16px; list-style: disc; }
.saas-alert li  { margin-bottom: 2px; }

.saas-alert--danger  { background: var(--saas-danger-bg);  color: #991B1B; border-left: 3px solid var(--saas-danger); }
.saas-alert--success { background: var(--saas-success-bg); color: #065F46; border-left: 3px solid var(--saas-success); }
.saas-alert--warning { background: var(--saas-warning-bg); color: #92400E; border-left: 3px solid var(--saas-warning); }

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Pied de page */
.auth-footer {
  margin-top: 36px;
  text-align: center;
  font-size: .775rem;
  color: var(--saas-subtle);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --auth-panel-w: 340px; }
  .auth-brand-headline h1 { font-size: 2.1rem; }
  .auth-stats { display: none; }
}

@media (max-width: 768px) {
  .auth-brand { display: none; }
  .auth-mobile-logo { display: flex; }
  .auth-form-side { padding: 36px 20px; }
  .auth-form-side::before { width: 100%; }
}

@media (max-width: 480px) {
  .auth-form-box { max-width: 100%; }
  .auth-form-heading h2 { font-size: 1.55rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   UTILITAIRES GLOBAUX (hors auth)
═══════════════════════════════════════════════════════════════════ */
.btn.saas-btn { height: auto; padding: 8px 18px; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(103,119,239,.20); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(103,119,239,.42); }
