/* Espace client — overlay connexion / inscription */

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

.cdo-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.cdo-auth-overlay[hidden] {
  display: none !important;
}

.cdo-auth-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.cdo-auth-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 450px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.cdo-auth-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0.75rem 1rem 0;
}

.cdo-auth-modal__header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cdo-text, #1f2432);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.cdo-auth-modal__header-btn:hover,
.cdo-auth-modal__header-btn:focus {
  background: #f7f7f7;
  color: var(--cdo-text, #1f2432);
}

.cdo-auth-modal__header-spacer {
  width: 2rem;
  height: 2rem;
}

.cdo-auth-modal__logo {
  display: flex;
  justify-content: center;
  padding: 0.25rem 1.5rem 0.5rem;
}

.cdo-auth-modal__logo img {
  display: block;
  width: auto;
  max-width: 180px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
}

.cdo-auth-modal__body {
  padding: 0.5rem 1.5rem 2rem;
}

.cdo-auth-modal__title {
  margin: 0 0 1.5rem;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--cdo-text, #1f2432);
  text-align: center;
}

.cdo-auth-modal__subtitle {
  margin: -0.75rem 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--cdo-text-muted, #6c757d);
  text-align: center;
}

.cdo-auth-modal__email-badge {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #f7f7f7;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cdo-text, #1f2432);
  text-align: center;
  word-break: break-word;
}

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

.cdo-auth-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cdo-text, #1f2432);
}

.cdo-auth-field input {
  width: 100%;
  padding: 0.875rem 0.75rem;
  border: 1px solid #b0b0b0;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--cdo-text, #1f2432);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cdo-auth-field input:focus,
.cdo-auth-field input:focus-visible {
  outline: none;
  border-color: #aaa;
  box-shadow: none;
}

.cdo-auth-field--password {
  position: relative;
}

.cdo-auth-field--password input {
  padding-right: 5rem;
}

.cdo-auth-field__toggle {
  position: absolute;
  right: 0.75rem;
  bottom: 0.875rem;
  border: 0;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: underline;
  color: var(--cdo-text, #1f2432);
  cursor: pointer;
}

.cdo-auth-error {
  margin-bottom: 1rem;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  background: #fff5f5;
  border: 1px solid #f5c2c7;
  color: #842029;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.cdo-auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.875rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--cdo-accent, #a50021);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.cdo-auth-submit:hover,
.cdo-auth-submit:focus {
  background: var(--cdo-accent-hover, #8a001c);
  color: #fff;
}

.cdo-auth-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.cdo-auth-link {
  display: block;
  margin-top: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cdo-text, #1f2432);
  text-align: center;
  text-decoration: underline;
}

.cdo-auth-link:hover,
.cdo-auth-link:focus {
  color: var(--cdo-accent, #a50021);
}

.cdo-auth-step[hidden] {
  display: none !important;
}

@media (max-width: 575.98px) {
  .cdo-auth-overlay {
    padding: 1rem;
    align-items: center;
  }

  .cdo-auth-modal {
    max-height: calc(100dvh - 2rem);
    border-radius: 16px;
  }

  .cdo-auth-modal__body {
    padding: 0.5rem 1rem 1.5rem;
  }
}
