/**
 * ========================================================================
 * XANO AUTH MODAL - Login/Signup/User Menu Modal Styles
 * ========================================================================
 *
 * Usage:
 *   <link rel="stylesheet" href="https://orator.co/assets/css/xano-auth-modal.css">
 *
 * Requires: xano-auth-modal.js loaded
 *
 * ========================================================================
 */

/* ========================================
   GLOBAL AUTH MODAL STYLES
======================================== */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-modal-overlay.is-open {
  display: flex;
  opacity: 1;
}

.auth-modal {
  background: #fff;
  border-radius: 0;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.auth-modal-overlay.is-open .auth-modal {
  transform: translateY(0);
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #6b7280;
  transition: all 0.2s;
  z-index: 10;
}

.auth-modal-close:hover {
  background: #e5e7eb;
  color: #374151;
}

.auth-modal-header {
  padding: 32px 32px 0;
  text-align: center;
}

.auth-modal-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
}

.auth-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
}

.auth-modal-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.auth-modal-body {
  padding: 24px 32px 32px;
}

.auth-form-group {
  margin-bottom: 16px;
}

.auth-form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.auth-form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 0;
  font-size: 15px;
  color: #000;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-form-input:focus {
  outline: none;
  border-color: #0a0a0a;
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}

.auth-form-input::placeholder {
  color: #9ca3af;
}

.password-field-wrap {
  position: relative;
}

.password-field-wrap input {
  padding-right: 60px;
  color: #000 !important;
  -webkit-text-fill-color: #000;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
}

.password-toggle:hover {
  color: #374151;
}

.auth-form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0;
}

.auth-form-checkbox input {
  margin-top: 2px;
  accent-color: #0a0a0a;
}

.auth-form-checkbox label {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.auth-form-checkbox a {
  color: #0a0a0a;
  text-decoration: none;
}

.auth-form-checkbox a:hover {
  text-decoration: underline;
}

.auth-submit-btn {
  width: 100%;
  padding: 14px 24px;
  background: #0a0a0a;
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-submit-btn:hover {
  background: #333;
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-form-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: #9ca3af;
  font-size: 13px;
}

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

.auth-form-divider span {
  padding: 0 16px;
}

.auth-form-footer {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
}

.auth-form-footer a {
  color: #0a0a0a;
  font-weight: 500;
  text-decoration: none;
}

.auth-form-footer a:hover {
  text-decoration: underline;
}

.auth-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

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

.auth-message.success {
  display: block;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* User Menu (when logged in) */
.auth-user-menu {
  display: none;
  text-align: center;
  padding: 32px;
}

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

.auth-user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #0a0a0a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  margin: 0 auto 16px;
}

.auth-user-name {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px;
}

.auth-user-email {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 24px;
}

.auth-user-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-user-btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}

.auth-user-btn.primary {
  background: #0a0a0a;
  color: #fff;
  border: none;
}

.auth-user-btn.primary:hover {
  background: #333;
}

.auth-user-btn.secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.auth-user-btn.secondary:hover {
  background: #f9fafb;
}

.auth-user-btn.danger {
  background: #fff;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.auth-user-btn.danger:hover {
  background: #fef2f2;
}

/* Forgot Password Link */
.auth-forgot-link {
  display: block;
  text-align: right;
  font-size: 13px;
  color: #0a0a0a;
  text-decoration: none;
  margin-top: 8px;
}

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

/* Global Auth State Classes (add to body) */
body.auth-logged-in .auth-show-logged-out {
  display: none !important;
}
body.auth-logged-out .auth-show-logged-in {
  display: none !important;
}

/* Context banner for community signup */
.auth-context-banner {
  border-radius: 0;
}

/* Phase 2 avatar upload */
.auth-phase2-avatar {
  border: 2px dashed #d1d5db;
  transition: border-color 0.2s;
}

.auth-phase2-avatar:hover {
  border-color: #0a0a0a;
}

/* Shake animation */
@keyframes authShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}
.auth-shake {
  animation: authShake 0.3s ease-in-out;
}
