/* MK AUTOMATION AI — Auth modals (WEB AUTH RC1) */

#auth-modal {
  transition: opacity 0.25s ease;
}

#auth-modal:not(.active) {
  opacity: 0;
  pointer-events: none;
}

#auth-modal.active {
  opacity: 1;
  pointer-events: auto;
}

#auth-modal-panel {
  transition: transform 0.25s ease;
  transform: scale(0.95) translateY(8px);
}

#auth-modal.active #auth-modal-panel {
  transform: scale(1) translateY(0);
}

.auth-panel {
  display: none;
}

.auth-panel.is-active {
  display: block;
}

.auth-field {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
  color: #0a1628;
}

.auth-field:focus {
  outline: none;
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.auth-password-wrap {
  position: relative;
  margin-top: 0.35rem;
}

.auth-password-wrap .auth-field-password {
  margin-top: 0;
  padding-right: 2.75rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  color: #64748b;
  opacity: 0.75;
  pointer-events: auto;
}

.auth-password-toggle:hover {
  opacity: 1;
  color: #0a1628;
}

.auth-password-icon {
  display: inline-flex;
  pointer-events: none;
}

.auth-password-icon-eye-off {
  display: none;
}

.auth-password-toggle.is-visible .auth-password-icon-eye {
  display: none;
}

.auth-password-toggle.is-visible .auth-password-icon-eye-off {
  display: inline-flex;
}

.auth-field-error {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: #b91c1c;
}

.auth-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
}

.auth-steps li.is-current {
  color: #0891b2;
}

.auth-steps li.is-done {
  color: #0f766e;
}

.auth-otp {
  letter-spacing: 0.35em;
  text-align: center;
  font-size: 1.15rem;
  max-width: 100%;
}

#auth-email-otp-resend:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .auth-otp {
    letter-spacing: 0.2em;
  }
}

.auth-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
}

.auth-btn-primary {
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(to right, #06b6d4, #0891b2);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.25);
}

.auth-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-oauth {
  margin-top: 1rem;
}

.auth-oauth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: #6b7280;
  font-size: 0.75rem;
}

.auth-oauth-divider::before,
.auth-oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

.auth-btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #1f2937;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  cursor: pointer;
}

.auth-btn-google:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

.auth-btn-google:focus-visible {
  outline: 2px solid #0891b2;
  outline-offset: 2px;
}

.auth-btn-google:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-btn-google svg {
  flex: 0 0 auto;
}

.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0891b2;
  cursor: pointer;
}

.auth-link-btn:hover {
  color: #0e7490;
  text-decoration: underline;
}

.auth-login-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
}

.auth-remember-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  user-select: none;
  max-width: min(100%, 16rem);
  line-height: 1.35;
}

.auth-remember-checkbox {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  margin: 0;
  accent-color: #0891b2;
  cursor: pointer;
}

.auth-login-forgot {
  margin-left: auto;
  text-align: right;
}

.auth-msg {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.auth-msg.is-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.auth-msg.is-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.auth-msg.is-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

.auth-nav-btn {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.auth-nav-btn:hover {
  color: #0891b2;
  background: rgba(6, 182, 212, 0.08);
}

.auth-nav-btn-register {
  color: #fff;
  background: linear-gradient(to right, #06b6d4, #0891b2);
  border: none;
  padding: 0.45rem 0.85rem;
}

.auth-nav-btn-register:hover {
  color: #fff;
  background: linear-gradient(to right, #0891b2, #0e7490);
}

/* RC3: legacy auth-user-menu hidden — header.js owns customer chrome */
#auth-user-menu {
  display: none !important;
}

#auth-user-menu {
  display: none;
  align-items: center;
  gap: 0.5rem;
  max-width: min(220px, 45vw);
}

#auth-user-menu.is-visible {
  display: flex;
}

.auth-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #06b6d4, #1a3d6e);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#auth-user-email {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
}

@media (min-width: 640px) {
  #auth-user-email {
    display: block;
  }
}

.auth-logout-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  padding: 0.35rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
}

.auth-logout-btn:hover {
  color: #b91c1c;
  border-color: #fecaca;
}

#auth-guest-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

#auth-guest-actions.is-hidden {
  display: none;
}
