/* Alarys Auth Theme — aligné sur alarys.ca (refonte 2026-04-27)
 * Partagé par les pages auth client : login / forgot / reset / signup / confirm-email.
 * Tous les class names existants sont conservés pour compatibilité.
 */

:root {
  --fond: #FAFAF8;
  --texte: #1C1C1A;
  --muted: #7A7773;
  --bordure: #E8E6E0;
  --accent: #C84B6E;
  --accent-hover: #A83B5A;
}

body.auth,
body.auth *,
body.auth *::before,
body.auth *::after {
  box-sizing: border-box;
}

body.auth {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Centering wrapper */
.auth-wrap,
.auth-page {
  width: 100%;
  max-width: 420px;
  padding: 2rem 1rem;
}

/* Card */
.auth-card {
  background: #ffffff;
  border: 1px solid var(--bordure);
  border-radius: 16px;
  padding: 2.5rem;
}

/* Brand block (logo + badge) */
.auth-brand {
  display: block;
  margin-bottom: 1.75rem;
}

.auth-brand-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--texte);
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.auth-badge,
.auth-badge--client,
.auth-badge--vendor {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 0;
}

/* Title */
.auth-card h1,
.auth-card h2,
h1.auth-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--texte);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.375rem 0;
}

/* Subtitle */
.auth-subtitle {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 1.75rem 0;
}

/* Env badge (dev/staging) */
.auth-env {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--bordure);
  background: var(--fond);
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-env-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  color: var(--muted);
}

.auth-env-value {
  font-weight: 600;
  color: var(--texte);
}

/* Alerts */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.auth-alert--error {
  background: rgba(200, 75, 110, 0.08);
  color: #8e2942;
  border-color: rgba(200, 75, 110, 0.25);
}

.auth-alert--info {
  background: rgba(28, 28, 26, 0.04);
  color: var(--texte);
  border-color: var(--bordure);
}

.auth-alert--success {
  background: rgba(34, 134, 58, 0.08);
  color: #1f6f3a;
  border-color: rgba(34, 134, 58, 0.25);
}

.hidden {
  display: none !important;
}

/* Form */
.auth-form {
  display: block;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--texte);
}

.auth-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.auth-input,
.auth-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--texte);
  background: var(--fond);
  transition: border-color 0.15s ease;
  outline: none;
}

.auth-input::placeholder {
  color: var(--muted);
  font-weight: 300;
}

.auth-input:focus,
.auth-select:focus {
  border-color: var(--accent);
}

.auth-input[aria-invalid="true"] {
  border-color: var(--accent);
}

.token-toggle {
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  margin-top: 6px;
}

.token-section {
  display: none;
  margin-top: 10px;
}

.token-section.show {
  display: block;
}

/* Actions / buttons */
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.auth-btn {
  width: 100%;
  padding: 0.875rem;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.auth-btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.auth-btn-primary:hover {
  background: var(--accent-hover);
}

.auth-btn-secondary {
  background: #ffffff;
  color: var(--texte);
  border: 1px solid var(--bordure);
}

.auth-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Links */
.auth-link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Forgot row */
.auth-forgot {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-forgot a,
.auth-forgot .auth-link {
  color: var(--muted);
  text-decoration: none;
}

.auth-forgot a:hover,
.auth-forgot .auth-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Signup row (utilisé sur forgot/reset/confirm) */
.auth-signup {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.auth-signup a,
.auth-signup .auth-link {
  color: var(--accent);
}

/* Footer (lien retour alarys.ca) */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-footer a,
.auth-footer .auth-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
}

.auth-footer a:hover,
.auth-footer .auth-link:hover {
  color: var(--texte);
}

/* Lang switch (toujours utilisé par forgot / reset / signup / confirm-email) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--bordure);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-switch__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switch__link.is-active {
  background: var(--texte);
  color: #ffffff;
}

/* Bloc consentement Loi 25 (confirm-email) */
.consent-block {
  background: var(--fond);
  border: 1px solid var(--bordure);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--texte);
}

.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}

.consent-label a {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
}

.consent-label a:hover {
  color: var(--accent-hover);
}

.consent-note {
  margin: 0.5rem 0 0 1.625rem;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 640px) {
  .auth-wrap,
  .auth-page {
    padding: 1.5rem 1rem;
  }

  .auth-card {
    padding: 1.75rem 1.5rem;
    border-radius: 14px;
  }

  .auth-card h1,
  .auth-card h2,
  h1.auth-title {
    font-size: 1.5rem;
  }

  .auth-brand-logo {
    font-size: 1.35rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
