/**
 * Module a4w_authflow - Email-first authentication flow
 * @author allforweb
 */

/* Container */
.authflow {
  max-width: 500px;
  margin: 0 auto;
}

/* Step transitions */
.authflow__step {
  animation: authflowFadeIn 0.3s ease-in-out;
}

@keyframes authflowFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Email step ─── */

.authflow-email__intro {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #666;
}

.authflow-email__input {
  font-size: 1rem;
  padding: 0.75rem 1rem;
}

.authflow-email__btn {
  margin-top: 1rem;
  padding: 0.75rem;
  font-size: 1rem;
}

.authflow-email__error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ─── Email badge ─── */

.authflow__email-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.authflow__email-display {
  font-weight: 600;
  word-break: break-all;
}

.authflow__change-email {
  font-size: 0.875rem;
  white-space: nowrap;
}

/* ─── Login step ─── */

.authflow-login__welcome {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

/* Login method toggle buttons */
.authflow-login__methods {
  margin-bottom: 1.25rem;
}

.authflow-login__methods-intro {
  text-align: center;
  margin-bottom: 0.75rem;
  color: #666;
}

.authflow-login__method-btns {
  display: flex;
  gap: 0;
  border-radius: 0.375rem;
  overflow: hidden;
}

.authflow-login__method-btn {
  flex: 1;
  border: none;
  border-radius: 0;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: #fff;
  color: #666;
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
}

.authflow-login__method-btn:hover {
  background: #f8f9fa;
  color: #333;
}

.authflow-login__method-btn--active,
.authflow-login__method-btn--active:hover {
  background: var(--bs-primary, #232323);
  color: #fff;
  border-color: var(--bs-primary, #232323);
}

.authflow-login__method-btn + .authflow-login__method-btn {
  border-left: 1px solid #dee2e6;
}

/* ─── Code login section ─── */

.authflow-code__desc {
  text-align: center;
  color: #666;
  margin-bottom: 1rem;
}

.authflow-code__send-btn {
  padding: 0.75rem;
  font-size: 1rem;
}

.authflow-code__sent-msg {
  text-align: center;
  color: #666;
  margin-bottom: 1.25rem;
}

.authflow-code__input {
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.5rem;
  padding: 0.75rem 1rem;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

.authflow-code__error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.authflow-code__resend {
  font-size: 0.875rem;
}

/* ─── Register step ─── */

.authflow-register__intro {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Readonly email in registration form */
.authflow__email--readonly {
  background-color: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.8;
}

/* ─── Spinners ─── */

.authflow-email__spinner,
.authflow-code__spinner {
  width: 1rem;
  height: 1rem;
}

/* === v1.2.0 — error alerts + cooldown state === */

.authflow-code__send-error,
.authflow-code__resend-error {
  font-size: 0.9rem;
  margin-bottom: 0;
}

.authflow-code__resend[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === v1.2.0 — checkout integration === */

body.authflow-checkout-active #checkout-personal-information-step .nav-tabs,
body.authflow-checkout-active #checkout-personal-information-step > .step__content > .tab-content > .tab-pane {
  display: none !important;
}

body.authflow-checkout-active #checkout-personal-information-step .authflow-checkout-wrapper {
  display: block !important;
}
