/* AfricaMenu — pages authentification (inscription / connexion) */

@import url("responsive-guard.css");

:root {
  --color-accent: #ff6b00;
  --color-text: #000000;
  --color-muted: #666666;
  --color-label: #555555;
  --color-border: #e5e5e5;
  --font-sans:
    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body.auth-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: 2rem;
  /* Padding horizontal identique + encoches iPhone / Android */
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}

/* Connexion sur mobile : bloc centré verticalement au milieu de l’écran */
@media (max-width: 47.99rem) {
  .auth-page--login .auth-main {
    justify-content: center;
    padding-top: max(1rem, env(safe-area-inset-top, 0px));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  min-width: 0;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  margin-bottom: clamp(1.75rem, 4vh, 2.5rem);
  text-decoration: none;
  color: inherit;
}

.auth-brand:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 0.25rem;
}

.auth-brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
  background: transparent;
}

.auth-brand__logo img {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.auth-brand__name {
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
}

.auth-title {
  font-size: clamp(1.375rem, 4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  width: 100%;
  text-align: center;
  text-wrap: balance;
  padding-inline: 0.125rem;
}

/* Connexion : lien sous le titre */
.auth-page--login .auth-switch--solo-link {
  width: 100%;
  text-align: center;
}

.auth-switch {
  margin: 0 0 2rem;
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.5;
}

.auth-switch a {
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Lien seul sous le titre (page connexion) */
.auth-switch--solo-link {
  margin-bottom: 1.75rem;
}

.auth-switch--solo-link a {
  font-weight: 500;
  display: inline-block;
  max-width: 100%;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
}

.auth-form {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

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

/* Page connexion : libellés plus marqués (maquette) */
.auth-page--login .auth-field label {
  color: var(--color-text);
  font-weight: 500;
}

.auth-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 0.625rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input::placeholder {
  color: #9ca3af;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

/* Champ mot de passe + bouton afficher/masquer */
.auth-password-wrap {
  position: relative;
  width: 100%;
}

.auth-password-wrap input {
  padding-right: 2.875rem;
}

.auth-password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0 0.55rem 0.55rem 0;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.auth-password-toggle:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.04);
}

.auth-password-toggle:focus {
  outline: none;
}

.auth-password-toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
  color: var(--color-accent);
}

.auth-password-toggle__icons {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.auth-password-toggle__eye,
.auth-password-toggle__eye-off {
  display: block;
  flex-shrink: 0;
}

.auth-password-toggle__eye-off {
  display: none;
}

.auth-password-toggle.is-revealed .auth-password-toggle__eye {
  display: none;
}

.auth-password-toggle.is-revealed .auth-password-toggle__eye-off {
  display: block;
}

.auth-field-hint {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: -0.25rem;
}

.auth-error {
  display: none;
  font-size: 0.8125rem;
  color: #dc2626;
  margin: -0.5rem 0 0;
}

.auth-error.is-visible {
  display: block;
}

.auth-forgot-wrap {
  margin: 0.35rem 0 0;
  text-align: right;
}

.auth-forgot-link {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: none;
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

.auth-forgot-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.auth-field-optional {
  font-weight: 400;
  color: var(--color-muted);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
}

.auth-modal:not([aria-hidden="false"]) {
  display: none !important;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.auth-modal__panel {
  position: relative;
  width: min(26rem, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  border-radius: 1rem;
  background: #fff;
  box-shadow:
    0 12px 50px rgba(15, 23, 42, 0.2),
    0 0 0 1px rgba(15, 23, 42, 0.08);
  padding: clamp(1.125rem, 4vw, 1.5rem);
  text-align: left;
}

.auth-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.auth-modal__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-modal__close {
  border: none;
  background: var(--color-border);
  border-radius: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.auth-modal__lead {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--color-muted);
}

.auth-modal .auth-field {
  margin-bottom: 1rem;
}

.auth-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.95rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: #25d366;
  border: none;
  border-radius: 0.625rem;
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.35);
  transition: filter 0.15s ease;
}

.auth-wa-btn:hover {
  filter: brightness(1.05);
}

.auth-wa-btn:focus-visible {
  outline: 2px solid #25d366;
  outline-offset: 3px;
}

.auth-wa-btn__icon {
  display: inline-flex;
  line-height: 0;
}

.auth-modal__ghost {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.65rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.auth-modal__ghost:hover {
  color: var(--color-text);
}

body.auth-forgot-open {
  overflow: hidden;
}

.auth-submit {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.95rem 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-accent);
  border: none;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.auth-submit:hover {
  filter: brightness(1.05);
}

.auth-submit:active {
  transform: scale(0.99);
}

.auth-submit:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.auth-placeholder-note {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-muted);
  text-align: center;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 360px) {
  .auth-main {
    padding-inline: max(0.9rem, env(safe-area-inset-left, 0px));
  }

  .auth-card {
    max-width: 100%;
  }

  .auth-brand {
    margin-bottom: 1.35rem;
  }

  .auth-title {
    font-size: 1.25rem;
  }

  .auth-form {
    gap: 1rem;
  }

  .auth-field input,
  .auth-submit {
    min-height: 2.9rem;
  }
}

@media (min-width: 48rem) and (max-width: 80rem) {
  body.auth-page {
    background: #fafafa;
  }

  .auth-main {
    justify-content: center;
    padding-block: 2.5rem;
  }

  .auth-card {
    max-width: 32rem;
    padding: 2rem;
    border: 1px solid #eeeeee;
    border-radius: 1.5rem;
    background: #ffffff;
  }

  .auth-title {
    font-size: 1.85rem;
  }

  .auth-form {
    gap: 1.35rem;
  }

  .auth-field input,
  .auth-submit {
    min-height: 3.1rem;
  }

  .auth-switch {
    margin-bottom: 2.25rem;
  }
}
