/**
 * AXITRAQ Auth Widget Styles v1.0
 * Self-contained styling for the auth widget.
 * All classes prefixed with .axq- to avoid conflicts with host site CSS.
 */

.axq-auth-widget {
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 2.25rem;
  background: #1a1f2e;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  color: #e2e8f0;
  box-sizing: border-box;
}

.axq-auth-widget *, .axq-auth-widget *::before, .axq-auth-widget *::after {
  box-sizing: border-box;
}

.axq-auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.axq-auth-logo {
  margin-bottom: 0.5rem;
}

.axq-auth-logo img {
  width: 220px;
  height: auto;
  margin: 0 auto;
  display: block;
  border-radius: 6px;
}

.axq-logo-light {
  display: none;
}

.axq-logo-dark {
  display: block;
  margin: 0 auto;
}

.axq-auth-subtitle {
  font-size: 0.9rem;
  color: #94a3b8;
  margin: 0.5rem 0 0 0;
  font-weight: 400;
}

.axq-auth-hint {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0.4rem 0 0 0;
}

.axq-auth-icon {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 0.3rem;
}

.axq-alert {
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.axq-alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.axq-auth-form {
  margin: 0;
  padding: 0;
}

.axq-form-group {
  margin-bottom: 1rem;
}

.axq-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.axq-input {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  color: #f1f5f9;
  background: #0f1219;
  border: 1px solid #334155;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.axq-input:focus {
  border-color: #d4a843;
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

.axq-input::placeholder {
  color: #475569;
}

.axq-input-code {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  padding: 0.8rem;
}

.axq-checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.axq-checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #d4a843;
  cursor: pointer;
}

.axq-checkbox-group label {
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.axq-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  font-family: inherit;
  text-align: center;
  line-height: 1.4;
}

.axq-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.axq-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.axq-btn-primary {
  background: linear-gradient(135deg, #d4a843, #b8922e);
  color: #0f1219;
}

.axq-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #e0b84e, #c49e35);
}

.axq-auth-links {
  text-align: center;
  margin-top: 1.2rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.axq-auth-links a {
  font-size: 0.8rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}

.axq-auth-links a:hover {
  color: #d4a843;
  text-decoration: underline;
}

.axq-auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #1e293b;
}

.axq-auth-footer span {
  font-size: 0.75rem;
  color: #64748b;
}

.axq-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(15, 18, 25, 0.3);
  border-top-color: #0f1219;
  border-radius: 50%;
  animation: axq-spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

@keyframes axq-spin {
  to { transform: rotate(360deg); }
}

/* Light theme support (for sites with light backgrounds) */
@media (prefers-color-scheme: light) {
  .axq-auth-widget[data-theme="auto"] {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
  }
  .axq-auth-widget[data-theme="auto"] .axq-logo-dark { display: none; }
  .axq-auth-widget[data-theme="auto"] .axq-logo-light { display: block; margin: 0 auto; }
  .axq-auth-widget[data-theme="auto"] .axq-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
  }
  .axq-auth-widget[data-theme="auto"] .axq-input:focus {
    border-color: #b8922e;
  }
  .axq-auth-widget[data-theme="auto"] .axq-label { color: #475569; }
  .axq-auth-widget[data-theme="auto"] .axq-auth-subtitle { color: #64748b; }
  .axq-auth-widget[data-theme="auto"] .axq-auth-hint { color: #64748b; }
  .axq-auth-widget[data-theme="auto"] .axq-checkbox-group label { color: #64748b; }
  .axq-auth-widget[data-theme="auto"] .axq-auth-footer { border-top-color: #e2e8f0; }
}

/* Explicit light theme class */
.axq-auth-widget.axq-theme-light {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
}
.axq-auth-widget.axq-theme-light .axq-logo-dark { display: none; }
.axq-auth-widget.axq-theme-light .axq-logo-light { display: block; margin: 0 auto; }
.axq-auth-widget.axq-theme-light .axq-input {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #1e293b;
}
.axq-auth-widget.axq-theme-light .axq-input:focus {
  border-color: #b8922e;
}
.axq-auth-widget.axq-theme-light .axq-input::placeholder { color: #94a3b8; }
.axq-auth-widget.axq-theme-light .axq-label { color: #475569; }
.axq-auth-widget.axq-theme-light .axq-auth-subtitle { color: #64748b; }
.axq-auth-widget.axq-theme-light .axq-auth-hint { color: #64748b; }
.axq-auth-widget.axq-theme-light .axq-checkbox-group label { color: #64748b; }
.axq-auth-widget.axq-theme-light .axq-auth-footer { border-top-color: #e2e8f0; }
.axq-auth-widget.axq-theme-light .axq-alert-error {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.2);
}
.axq-auth-widget.axq-theme-light .axq-auth-links a { color: #64748b; }
.axq-auth-widget.axq-theme-light .axq-auth-links a:hover { color: #b8922e; }

/* Responsive */
@media (max-width: 480px) {
  .axq-auth-widget {
    padding: 1.5rem 1.25rem;
    border-radius: 0;
    max-width: none;
  }
  .axq-auth-logo img {
    width: 180px;
  }
}
