/* Parcours connexion / vérification par code : Exxon-bat */

.auth-flow-shell {
  width: 100%;
  max-width: 460px;
}

.auth-flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}

.auth-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 88px;
}

.auth-flow-step__dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  border: 2px solid var(--border, #e2e8f0);
  background: #fff;
  color: var(--text-muted, #64748b);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.auth-flow-step.is-done .auth-flow-step__dot,
.auth-flow-step.is-active .auth-flow-step__dot {
  border-color: var(--primary, #6665dd);
  background: var(--primary-soft, #ede9fe);
  color: var(--primary-dark, #4338ca);
}

.auth-flow-step.is-done .auth-flow-step__dot {
  background: var(--primary, #6665dd);
  color: #fff;
}

.auth-flow-step__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  text-align: center;
}

.auth-flow-step.is-active .auth-flow-step__label {
  color: var(--primary-dark, #4338ca);
}

.auth-flow-step__line {
  flex: 1;
  height: 2px;
  min-width: 24px;
  max-width: 48px;
  margin-top: -18px;
  background: var(--border, #e2e8f0);
}

.auth-flow-step__line.is-done {
  background: var(--primary, #6665dd);
}

.auth-card--flow {
  position: relative;
  overflow: hidden;
}

.auth-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary-soft, #ede9fe), #fff);
  border: 1px solid rgba(102, 101, 221, 0.2);
  margin-bottom: 16px;
}

.auth-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy, #0f172a);
  word-break: break-all;
}

.auth-email-chip__icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.auth-code-input {
  display: block;
  width: 100%;
  max-width: 240px;
  margin: 8px auto 20px;
  padding: 16px 12px;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 14px;
  background: #fff;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  text-align: center;
  color: var(--navy, #0f172a);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.auth-code-input:focus {
  outline: none;
  border-color: var(--primary, #6665dd);
  box-shadow: 0 0 0 3px rgba(102, 101, 221, 0.18);
}

.auth-code-input.is-error {
  border-color: #ef4444;
  background: #fef2f2;
  animation: auth-otp-shake 0.35s ease;
}

.auth-otp {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 20px;
}

.auth-otp-autofill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.01;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  z-index: 2;
  pointer-events: none;
}

.auth-otp__cell {
  position: relative;
  z-index: 1;
  width: 46px;
  height: 54px;
  padding: 0;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  color: var(--navy, #0f172a);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.auth-otp__cell:focus {
  outline: none;
  border-color: var(--primary, #6665dd);
  box-shadow: 0 0 0 3px rgba(102, 101, 221, 0.18);
}

.auth-otp__cell.is-filled {
  border-color: var(--primary, #6665dd);
  background: var(--primary-soft, #ede9fe);
}

.auth-otp__cell.is-error {
  border-color: #ef4444;
  background: #fef2f2;
  animation: auth-otp-shake 0.35s ease;
}

@keyframes auth-otp-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.auth-resend {
  text-align: center;
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
}

.auth-resend button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--primary-dark, #4338ca);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-resend button:disabled {
  color: var(--text-muted, #64748b);
  cursor: not-allowed;
  text-decoration: none;
}

.auth-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.auth-alert--success {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.auth-alert--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.auth-local-code {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fefce8;
  border: 1px solid #fde047;
  text-align: center;
}

.auth-local-code__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #854d0e;
  margin-bottom: 6px;
}

.auth-local-code__value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums;
  color: #713f12;
}

.auth-success {
  text-align: center;
  padding: 12px 0 8px;
}

.auth-success__check {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border: 2px solid #86efac;
  animation: auth-success-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-success__check::after {
  content: "";
  width: 14px;
  height: 28px;
  border: solid #15803d;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  margin-top: -6px;
}

@keyframes auth-success-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.auth-success h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  color: var(--navy, #0f172a);
}

.auth-success p {
  margin: 0 0 20px;
  color: var(--text-muted, #64748b);
  font-size: 0.95rem;
  line-height: 1.5;
}

.auth-success__redirect {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

.auth-flow-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  cursor: pointer;
}

.auth-flow-back:hover {
  color: var(--primary-dark, #4338ca);
}

@media (max-width: 480px) {
  .auth-page {
    padding: 24px 12px;
  }

  .auth-flow-shell {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 4 étapes inscription : min-width 88px×4 + 24px×3 = 424px → déborde à 375px */
  .auth-flow-steps {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .auth-flow-step {
    flex: 1 1 0;
    min-width: 0;
    gap: 4px;
  }

  .auth-flow-step__dot {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
  }

  .auth-flow-step__label {
    font-size: 0.58rem;
    letter-spacing: 0.02em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .auth-flow-step__line {
    flex: 0 1 16px;
    min-width: 8px;
    max-width: 20px;
    margin-top: -14px;
  }

  .auth-otp {
    gap: 6px;
  }

  .auth-otp__cell {
    width: 42px;
    height: 50px;
    font-size: 1.2rem;
    border-radius: 10px;
  }

  .auth-card--flow {
    padding: 28px 18px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .auth-card--flow h1,
  .auth-card--flow p,
  .auth-market-hint {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }
}

@media (max-width: 360px) {
  .auth-flow-step__dot {
    width: 26px;
    height: 26px;
    font-size: 0.68rem;
  }

  .auth-flow-step__label {
    font-size: 0.52rem;
  }

  .auth-flow-step__line {
    flex-basis: 10px;
    min-width: 6px;
    max-width: 14px;
  }

  .auth-card--flow {
    padding: 24px 14px;
  }
}

.auth-quick-access {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #eef2ff, #fff);
  text-align: center;
}

.auth-quick-access__title {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy, #0f172a);
}

.auth-quick-access__url {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--primary-dark, #4338ca);
}

.auth-quick-access__hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.auth-quick-access__install {
  margin: 0 auto;
}

/* Page facturation carte — barre retour + actions */
.billing-back-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
}

.billing-back-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary-dark, #4338ca);
  text-decoration: none;
}

.billing-back-bar__link:hover {
  text-decoration: underline;
}

.billing-carte-main {
  padding-top: 12px;
}

.billing-carte-hint {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.billing-carte-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.billing-carte-back-btn {
  text-align: center;
}

/* ── Page connexion pro (split layout) ── */
.auth-page--pro {
  min-height: calc(100vh - 72px);
  padding: 36px 24px 56px;
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(102, 101, 221, 0.12), transparent),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(16, 185, 129, 0.08), transparent),
    var(--bg, #f8fafc);
}

.auth-pro-layout {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 440px);
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}

.auth-pro-panel {
  padding: 8px 0;
}

.auth-pro-panel__badge {
  display: inline-block;
  margin-bottom: 18px;
  padding: 7px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 0;
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-pro-panel__title {
  margin: 0 0 14px;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  line-height: 1.15;
  color: var(--navy, #0f172a);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-pro-panel__lead {
  margin: 0 0 28px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-muted, #64748b);
  max-width: 36ch;
}

.auth-pro-features {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.auth-pro-features li {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted, #64748b);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-pro-features li:hover {
  border-color: rgba(15, 23, 42, 0.16);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.auth-pro-features__mark {
  display: block;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 3px;
  background: linear-gradient(135deg, #0f172a, #334155);
}

.auth-pro-features__body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.auth-pro-features li strong {
  display: block;
  margin: 0;
  color: var(--navy, #0f172a);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-pro-features__body > span {
  display: block;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.4;
}

.auth-pro-terrain {
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ecfdf5, #fff);
  border: 1px solid #a7f3d0;
}

.auth-pro-terrain__label {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #047857;
}

.auth-pro-terrain__link {
  font-size: 0.95rem;
  font-weight: 700;
  color: #059669;
  text-decoration: none;
}

.auth-pro-terrain__link:hover {
  text-decoration: underline;
}

.auth-quick-access--panel {
  margin: 0;
  text-align: left;
}

.auth-pro-form-col {
  width: 100%;
}

.auth-card--pro {
  max-width: none;
}

.auth-card__title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  color: var(--navy, #0f172a);
}

.auth-card__desc {
  margin: 0 0 20px;
  color: var(--text-muted, #64748b);
  font-size: 0.92rem;
  line-height: 1.5;
}

.auth-card--pro .field {
  margin-bottom: 18px;
}

.field__wrap--password {
  position: relative;
}

.field__wrap--password input {
  padding-right: 48px;
}

.field__password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.65;
}

.field__password-toggle:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.05);
}

.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  cursor: pointer;
}

.auth-remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary, #6665dd);
}

.auth-forgot-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark, #4338ca);
  text-decoration: none;
}

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

.auth-submit {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
}

.auth-footer-link--muted {
  margin-top: 12px;
  font-size: 0.82rem;
}

.auth-already--prominent {
  padding: 20px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ecfdf5, #fff);
  border: 1px solid #a7f3d0;
  text-align: center;
}

.auth-already__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: #059669;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
}

.auth-already--prominent .auth-already__lead {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--navy, #0f172a);
}

.auth-already__hint {
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.auth-already__logout {
  margin-top: 10px;
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

.auth-already__logout:hover {
  background: #fef2f2 !important;
}

.auth-card--pro .auth-security {
  margin-top: 18px;
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .auth-pro-layout {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .auth-pro-panel {
    order: 2;
  }

  .auth-pro-form-col {
    order: 1;
  }

  .auth-pro-panel__title {
    font-size: 1.35rem;
  }
}
