/**
 * Naturabox — pages de compte hors connexion : connexion, inscription, mot de passe (php_self authentication,
 * registration, password). Gabarit commun : templates/customer/_partials/nb-auth-layout.tpl.
 */
.nb-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  margin: .5rem 0 3rem;
}

@media (min-width: 992px) {
  .nb-auth {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
    gap: 3rem;
  }
}

@media (min-width: 1400px) {
  .nb-auth {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4rem;
  }
}

/* ---------- Visuel de marque ---------- */
.nb-auth__aside {
  position: relative;
  display: none;
  overflow: hidden;
  border-radius: 24px;
  color: #fff;
  background-color: var(--nb-green-dark);
  background-position: center;
  background-size: cover;
  isolation: isolate;
}

@media (min-width: 992px) {
  .nb-auth__aside {
    position: sticky;
    top: calc(var(--nb-hdr-h) + 1.5rem);
    display: flex;
    min-height: 560px;
  }
}

.nb-auth__aside::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(160deg, rgba(47, 92, 67, .55) 0%, rgba(25, 45, 23, .88) 70%);
}

.nb-auth__aside-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.25rem;
  width: 100%;
  padding: 2.5rem;
}

.nb-auth__badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: .35rem;
  margin: 0;
  padding: .3rem .8rem;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--nb-ink);
  background: var(--nb-yellow);
}

.nb-auth__badge .material-icons {
  font-size: 17px;
}

.nb-auth__aside-title {
  max-width: 22ch;
  margin: 0;
  font-family: var(--nb-font-title);
  font-size: clamp(1.75rem, 1.2rem + 1.2vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
}

.nb-auth__perks {
  display: grid;
  gap: .9rem;
  margin: .5rem 0 0;
  padding: 0;
  list-style: none;
}

.nb-auth__perks li {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  font-size: .9375rem;
  line-height: 1.4;
}

.nb-auth__perks .material-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  color: var(--nb-yellow);
  background: rgba(255, 255, 255, .14);
}

.nb-auth__perks strong {
  display: block;
  font-weight: 700;
}

.nb-auth__perks span {
  color: rgba(255, 255, 255, .85);
}

.nb-auth__perks strong {
  color: #fff;
}

.nb-auth__rating {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin: .5rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, .2);
  font-size: .875rem;
  font-weight: 600;
}

.nb-auth__rating .material-icons {
  font-size: 18px;
  color: var(--nb-yellow);
}

/* ---------- Carte de formulaire ---------- */
.nb-auth__main {
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
}

@media (min-width: 992px) {
  .nb-auth__main {
    margin-inline: 0;
    padding-top: 1rem;
  }
}

.nb-auth__card {
  padding: 2rem;
  border: 1px solid var(--nb-line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 40px -24px rgba(25, 45, 23, .35);
}

@media (max-width: 575.98px) {
  .nb-auth__card {
    padding: 1.5rem 1.25rem;
  }
}

.nb-auth__title {
  margin: 0 0 .5rem;
  font-family: var(--nb-font-title);
  font-size: clamp(1.6rem, 1.3rem + .8vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--nb-title);
}

.nb-auth__lead {
  margin: 0 0 1.5rem;
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--nb-muted);
}

/* champs */
.nb-auth .form-label {
  margin-bottom: .35rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--nb-ink);
}

.nb-auth .form-control {
  min-height: 48px;
  border-radius: 12px;
  font-size: 1rem;
}

.nb-auth .password-field .form-control {
  border-right: 0;
}

.nb-auth .password-field .btn {
  min-width: 52px;
  border: 1px solid #d9ddd5;
  border-left: 0;
  border-radius: 0 12px 12px 0 !important;
  color: var(--nb-muted);
  background: #fff;
}

.nb-auth .password-field .btn:hover,
.nb-auth .password-field .btn:focus-visible {
  color: var(--nb-primary);
  background: var(--nb-soft);
}

.nb-auth .password-field:focus-within .btn {
  border-color: var(--nb-primary);
}

.nb-auth .form-text {
  font-size: .75rem;
  color: var(--nb-muted);
}

.nb-auth .mb-3 {
  margin-bottom: 1.1rem !important;
}

/* inscription : champs sur deux colonnes (prénom / nom, naissance / téléphone) */
@media (min-width: 576px) {
  .nb-auth #customer-form > section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
  }

  .nb-auth #customer-form > section > * {
    grid-column: 1 / -1;
  }

  .nb-auth #customer-form > section > .mb-3:has(#field-firstname),
  .nb-auth #customer-form > section > .mb-3:has(#field-lastname),
  .nb-auth #customer-form > section > .mb-3:has(#field-birthday),
  .nb-auth #customer-form > section > .mb-3:has(#field-phone) {
    grid-column: auto;
  }
}

/* aide « Seules les lettres… » : discrète, visible au focus seulement */
.nb-auth .mb-3:has(#field-firstname) .form-text,
.nb-auth .mb-3:has(#field-lastname) .form-text {
  display: none;
}

.nb-auth .mb-3:has(#field-firstname:focus) .form-text,
.nb-auth .mb-3:has(#field-lastname:focus) .form-text,
.nb-auth .mb-3:has(.is-invalid) .form-text {
  display: block;
}

/* cases à cocher : bloc doux */
.nb-auth .form-check {
  padding: .85rem 1rem .85rem 2.6rem;
  border-radius: 12px;
  font-size: .875rem;
  background: var(--nb-soft);
}

.nb-auth .form-check-input {
  width: 1.15em;
  height: 1.15em;
  margin-top: .15em;
}

.nb-auth .form-check-input:checked {
  border-color: var(--nb-primary);
  background-color: var(--nb-primary);
}

.nb-auth .form-check-label em {
  display: block;
  margin-top: .2rem;
  font-size: .75rem;
  font-style: normal;
  color: var(--nb-muted);
}

/* bouton principal pleine largeur */
.nb-auth .nb-auth__submit,
.nb-auth #customer-form .form-control-submit {
  width: 100%;
  min-height: 50px;
  font-size: .9375rem;
}

.nb-auth #customer-form footer {
  display: block;
  margin-top: .5rem;
}

.nb-auth__forgot {
  margin: -.35rem 0 1.25rem;
  font-size: .875rem;
  text-align: right;
}

.nb-auth__forgot a {
  font-weight: 600;
  color: var(--nb-primary);
  text-decoration: none;
}

.nb-auth__forgot a:hover {
  text-decoration: underline;
}

/* ---------- Sous la carte ---------- */
.nb-auth__after {
  margin-top: 1.25rem;
}

.nb-auth__switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: var(--nb-cream-2);
}

.nb-auth__switch p {
  margin: 0;
  font-size: .875rem;
  color: var(--nb-muted);
}

.nb-auth__switch .nb-auth__switch-title {
  margin-bottom: .15rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--nb-ink);
}

.nb-auth__alt {
  margin: 1rem 0 0;
  font-size: .875rem;
  text-align: center;
  color: var(--nb-muted);
}

.nb-auth__alt a {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-weight: 600;
  color: var(--nb-primary);
  text-decoration: none;
}

.nb-auth__alt a:hover {
  text-decoration: underline;
}

.nb-auth__alt .material-icons {
  font-size: 18px;
}

.nb-auth__alt span {
  margin: 0 .4rem;
}

/* lien envoyé */
.nb-auth__sent {
  text-align: center;
}

.nb-auth__sent-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  border-radius: 50%;
  color: var(--nb-primary);
  background: #eef5f0;
}

.nb-auth__sent-ic .material-icons {
  font-size: 32px;
}

.nb-auth__hint {
  font-size: .8125rem;
  color: var(--nb-muted);
}

.nb-auth .alert {
  border-radius: 12px;
}

/* captcha (rdcaptcha, ajouté en fin de formulaire) : au-dessus du bouton d'envoi */
.nb-auth #customer-form,
.nb-auth #login-form {
  display: flex;
  flex-direction: column;
}

.nb-auth .rdcaptcha-widget {
  order: 1;
  margin-bottom: 1rem;
}

.nb-auth #customer-form > footer,
.nb-auth #login-form > .nb-auth__submit {
  order: 2;
}

/* =============================================================================
   Inscription société (rdcompany, thème : modules/rdcompany/…/register/index.tpl) : formulaire long en groupes
   ============================================================================= */
.nb-company-register .nb-form__group {
  margin-bottom: 1.25rem;
}

.nb-company-register__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}

.nb-company-register__row--postcode {
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
}

@media (max-width: 575.98px) {
  .nb-company-register__row,
  .nb-company-register__row--postcode {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* liste « Fonction dans l'entreprise » (select2) : même rendu que les autres champs */
.nb-company-register .select2-container {
  width: 100% !important;
}

.nb-company-register .select2-container--default .select2-selection--single {
  display: flex;
  align-items: center;
  height: 48px;
  border: 1px solid #d5ddd8;
  border-radius: 12px;
}

.nb-company-register .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-left: .9rem;
  line-height: 46px;
  color: var(--nb-ink);
}

.nb-company-register .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 11px;
  right: 10px;
}

.nb-company-register .select2-container--focus .select2-selection--single,
.nb-company-register .select2-container--open .select2-selection--single {
  border-color: var(--nb-primary);
  box-shadow: 0 0 0 4px rgba(73, 156, 111, .16);
}

.select2-dropdown {
  overflow: hidden;
  border-color: #d5ddd8;
  border-radius: 12px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--nb-primary);
}

/* formulaire long : visuel de gauche fixe pendant le défilement (grand écran) */
@media (min-width: 992px) {
  .nb-auth:has(.nb-company-register) .nb-auth__aside {
    position: sticky;
    top: calc(var(--nb-hdr-h, 72px) + 1rem);
    align-self: start;
  }
}
