/* ============================================================
   V5.6.B — Shared styles for signup / login / payment-pending
   Designed mobile-first, premium, consistent with the cockpit.
   ============================================================ */

:root {
  --auth-bg: #F8FAFC;
  --auth-card-bg: #FFFFFF;
  --auth-border: #E5E7EB;
  --auth-text: #111827;
  --auth-muted: #6B7280;
  --auth-green-600: #16A34A;
  --auth-green-500: #22C55E;
  --auth-green-50: #F0FDF4;
  --auth-red-500: #EF4444;
  --auth-red-50: #FEF2F2;
  --auth-amber-500: #F59E0B;
  --auth-amber-50: #FEF3C7;
  --auth-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--auth-bg);
  color: var(--auth-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

/* iOS-safe inputs (16px prevents auto-zoom on focus) */
input, select, textarea, button {
  font-family: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
  padding-top: max(32px, env(safe-area-inset-top));
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

/* Brand header (logo + name) — small, top of every public page */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
/* V5.6.B.2 — brand uses the eagle emoji (Cheikh's official mascot).
   The .auth-brand-logo class is kept for the (rare) SVG fallback case;
   the new .auth-brand-emoji renders the 🦅 directly with consistent
   sizing so it matches the eagle the user already knows. */
.auth-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.18);
}
.auth-brand-emoji {
  font-size: 30px;
  line-height: 1;
  display: inline-block;
  /* Reserve a stable box so adjacent text doesn't jump when the
     emoji font loads. */
  width: 36px;
  height: 36px;
  text-align: center;
  -webkit-font-smoothing: auto;
}
.auth-brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--auth-text);
}
.auth-brand-tagline {
  font-size: 12px;
  color: var(--auth-muted);
  margin-top: 1px;
}

/* Card container */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: var(--auth-shadow);
}
.auth-card-wide { max-width: 560px; }

.auth-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.auth-subtitle {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--auth-muted);
  line-height: 1.5;
}

/* Form fields */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.auth-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--auth-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.auth-input,
.auth-select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--auth-border);
  border-radius: 10px;
  background: white;
  color: var(--auth-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input:focus,
.auth-select:focus {
  border-color: var(--auth-green-500);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}
.auth-input::placeholder { color: #9CA3AF; }

.auth-hint {
  font-size: 12px;
  color: var(--auth-muted);
  line-height: 1.4;
}

/* Buttons */
.auth-btn {
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.08s, background 0.15s, border-color 0.15s;
}
.auth-btn-primary {
  background: linear-gradient(135deg, var(--auth-green-600), var(--auth-green-500));
  color: white;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.25);
}
.auth-btn-primary:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.auth-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.auth-btn-secondary {
  background: white;
  color: var(--auth-text);
  border: 1.5px solid var(--auth-border);
}
.auth-btn-secondary:hover:not(:disabled) { background: #F9FAFB; border-color: #D1D5DB; }

.auth-btn-wave {
  background: linear-gradient(135deg, #1B96FE, #00C2FF);
  color: white;
  box-shadow: 0 4px 14px rgba(27, 150, 254, 0.25);
}
.auth-btn-whatsapp {
  background: linear-gradient(135deg, #128C7E, #25D366);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

/* Error / info messages */
.auth-error {
  font-size: 13px;
  color: var(--auth-red-500);
  background: var(--auth-red-50);
  border: 1px solid #FEE2E2;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.auth-info {
  font-size: 13px;
  color: #1F2937;
  background: var(--auth-green-50);
  border: 1px solid #DCFCE7;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.auth-warning {
  font-size: 13px;
  color: #92400E;
  background: var(--auth-amber-50);
  border: 1px solid #FDE68A;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* Footer link (Already have an account? / Need help?) */
.auth-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--auth-muted);
}
.auth-foot a {
  color: var(--auth-green-600);
  font-weight: 700;
  text-decoration: none;
}
.auth-foot a:hover { text-decoration: underline; }

/* Status pill */
.auth-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  background: var(--auth-amber-50);
  color: #92400E;
  border: 1px solid #FDE68A;
}
.auth-status-active {
  background: var(--auth-green-50);
  color: #166534;
  border-color: #DCFCE7;
}
.auth-status-pulse::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: auth-pulse 1.6s ease-in-out infinite;
}
@keyframes auth-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.85); }
}

/* Summary card (used in payment-pending) */
.auth-summary {
  background: #F9FAFB;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}
.auth-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid var(--auth-border);
  font-size: 13.5px;
  gap: 12px;
}
.auth-summary-row:first-child { border-top: none; padding-top: 0; }
.auth-summary-key { color: var(--auth-muted); font-weight: 600; flex-shrink: 0; }
.auth-summary-val { color: var(--auth-text); font-weight: 700; text-align: right; word-break: break-word; }
.auth-summary-amount { font-size: 18px; color: var(--auth-green-600); font-weight: 800; }

/* Steps (numbered checklist for payment-pending) */
.auth-steps { list-style: none; padding: 0; margin: 0 0 18px; }
.auth-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--auth-border);
  font-size: 13.5px;
  line-height: 1.5;
}
.auth-step:first-child { border-top: none; padding-top: 0; }
.auth-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--auth-green-50);
  border: 1.5px solid var(--auth-green-500);
  color: var(--auth-green-600);
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.auth-step-done .auth-step-num {
  background: var(--auth-green-600);
  color: white;
  border-color: var(--auth-green-600);
}
.auth-step-current .auth-step-num {
  animation: auth-step-pulse 1.6s ease-in-out infinite;
}
@keyframes auth-step-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}
.auth-step-body { flex: 1; min-width: 0; }
.auth-step-title { font-weight: 700; color: var(--auth-text); }
.auth-step-sub { color: var(--auth-muted); font-size: 12.5px; margin-top: 2px; }

/* Buttons grouped vertically */
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

/* Compact spacing on small screens */
@media (max-width: 480px) {
  .auth-shell { padding: 24px 16px; }
  .auth-card { padding: 22px 18px; border-radius: 14px; }
  .auth-title { font-size: 20px; }
  .auth-field-row { grid-template-columns: 1fr; }
}

/* ==========================================================
   V6.0.I.4 — Signup page premium upgrade
   ========================================================== */

/* Carte avec ombre légèrement plus prononcée (sensation premium) */
.auth-card-premium {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05),
              0 12px 40px rgba(15, 23, 42, 0.08);
}

/* Liste des bénéfices avant le formulaire */
.auth-benefits {
  list-style: none;
  padding: 14px 16px;
  margin: 0 0 22px;
  background: var(--auth-green-50, #f0fdf4);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--auth-text, #1c1917);
  line-height: 1.4;
}
.auth-benefit-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: var(--auth-green-500, #16a34a);
  color: #ffffff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

/* Password wrap (input + eye toggle) */
.auth-password-wrap {
  position: relative;
  display: block;
}
.auth-password-wrap .auth-input {
  padding-right: 44px; /* place pour le bouton œil */
}
.auth-password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: #9CA3AF;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.auth-password-toggle:hover { color: var(--auth-green-600, #15803d); background: rgba(34, 197, 94, 0.08); }
.auth-password-toggle:focus-visible {
  outline: 2px solid var(--auth-green-500, #16a34a);
  outline-offset: 2px;
}
.auth-eye {
  width: 20px;
  height: 20px;
}
.auth-eye-closed { display: none; }
.auth-password-toggle.is-visible .auth-eye-open { display: none; }
.auth-password-toggle.is-visible .auth-eye-closed { display: block; }

/* Indicateur de force du mot de passe */
.auth-strength-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}
.auth-strength-bar {
  flex: 1;
  height: 5px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.auth-strength-fill {
  height: 100%;
  width: 0%;
  background: #dc2626;
  border-radius: 3px;
  transition: width 0.25s ease, background 0.25s ease;
}
.auth-strength-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  min-width: 72px;
  text-align: right;
}

/* Messages de validation inline (sous le champ) */
.auth-field-msg {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  align-self: flex-start;
}
.auth-field-msg.is-error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.auth-field-msg.is-success {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

/* État champ en erreur (bordure rouge) */
.auth-input.is-invalid,
.auth-select.is-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}
.auth-input.is-valid {
  border-color: #86efac;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
}

/* V6.0.I.6 — Lien "Mot de passe oublié" sous le champ password (login) */
.auth-forgot-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--auth-muted, #57534e);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  align-self: flex-end;
  transition: color 0.15s;
}
.auth-forgot-link:hover {
  color: var(--auth-green-600, #15803d);
}

/* V6.0.I.6 — Lien texte discret (ex: Se déconnecter sur payment-pending) */
.auth-text-link {
  color: var(--auth-muted, #57534e);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13px;
  transition: color 0.15s;
}
.auth-text-link:hover {
  color: var(--auth-text, #1c1917);
}
