/* singhularity-ui-core — Auth UI Component
 * Indieprise Auth: login, MFA, social, API keys
 * Uses CSS custom properties from ids.css with fallbacks
 */

/* ═══ Container ═══ */
.ipr-auth {
  max-width: 400px;
  margin: 0 auto;
  padding: 32px 24px;
  font-family: var(--font-sans, "Geist Sans", "Satoshi", system-ui, sans-serif);
  color: var(--text-primary, #EDEDEF);
}

.ipr-auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.ipr-auth-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary, #EDEDEF);
  margin-bottom: 4px;
}

.ipr-auth-header p {
  font-size: 13px;
  color: var(--text-secondary, #A0A0A8);
}

/* ═══ Tabs ═══ */
.ipr-auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border, #2A2A2E);
  margin-bottom: 24px;
}

.ipr-auth-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-tertiary, #6B6B73);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ipr-auth-tab:hover {
  color: var(--text-secondary, #A0A0A8);
}

.ipr-auth-tab.active {
  color: var(--accent, #D97706);
  border-bottom-color: var(--accent, #D97706);
}

/* ═══ Form ═══ */
.ipr-auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ipr-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ipr-auth-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #A0A0A8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ipr-auth-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-sans, "Geist Sans", "Satoshi", system-ui, sans-serif);
  color: var(--text-primary, #EDEDEF);
  background: var(--bg-elevated, #1A1A1D);
  border: 1px solid var(--border, #2A2A2E);
  border-radius: var(--radius-sm, 6px);
  outline: none;
  transition: border-color 0.15s;
}

.ipr-auth-input:focus {
  border-color: var(--accent, #D97706);
}

.ipr-auth-input::placeholder {
  color: var(--text-tertiary, #6B6B73);
}

.ipr-auth-input.ipr-auth-input-mono {
  font-family: var(--font-mono, "Geist Mono", ui-monospace, monospace);
  font-size: 13px;
  letter-spacing: -0.02em;
}

/* MFA code input */
.ipr-auth-mfa-input {
  text-align: center;
  font-size: 24px;
  font-family: var(--font-mono, "Geist Mono", ui-monospace, monospace);
  letter-spacing: 0.3em;
  padding: 14px;
}

/* ═══ Buttons ═══ */
.ipr-auth-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #000;
  background: var(--accent, #D97706);
  border: none;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ipr-auth-btn:hover {
  background: var(--accent-hover, #B45309);
}

.ipr-auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ipr-auth-btn-secondary {
  background: var(--bg-elevated, #1A1A1D);
  color: var(--text-primary, #EDEDEF);
  border: 1px solid var(--border, #2A2A2E);
}

.ipr-auth-btn-secondary:hover {
  background: var(--bg-highest, #232326);
  border-color: var(--border-hover, #3A3A3E);
}

/* ═══ Social Buttons ═══ */
.ipr-auth-social-btn {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-primary, #EDEDEF);
  background: var(--bg-elevated, #1A1A1D);
  border: 1px solid var(--border, #2A2A2E);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ipr-auth-social-btn:hover {
  background: var(--bg-highest, #232326);
  border-color: var(--border-hover, #3A3A3E);
}

.ipr-auth-social-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ═══ Links ═══ */
.ipr-auth-links {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.ipr-auth-link {
  color: var(--text-secondary, #A0A0A8);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

.ipr-auth-link:hover {
  color: var(--accent, #D97706);
}

/* ═══ Error ═══ */
.ipr-auth-error {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--error, #EF4444);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm, 6px);
  display: none;
}

.ipr-auth-error.visible {
  display: block;
}

/* ═══ Skip ═══ */
.ipr-auth-skip {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #2A2A2E);
}

.ipr-auth-skip button {
  font-size: 13px;
  color: var(--text-tertiary, #6B6B73);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s;
}

.ipr-auth-skip button:hover {
  color: var(--text-secondary, #A0A0A8);
}

/* ═══ MFA ═══ */
.ipr-auth-mfa {
  text-align: center;
}

.ipr-auth-mfa p {
  font-size: 13px;
  color: var(--text-secondary, #A0A0A8);
  margin-bottom: 20px;
}

.ipr-auth-mfa-back {
  margin-top: 16px;
}

/* ═══ Loading ═══ */
.ipr-auth-loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-secondary, #A0A0A8);
  font-size: 13px;
}

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

.ipr-auth-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border, #2A2A2E);
  border-top-color: var(--accent, #D97706);
  border-radius: 50%;
  animation: ipr-auth-spin 0.6s linear infinite;
  margin-bottom: 8px;
}

/* ═══ API Key Generation (post-login) ═══ */
.ipr-auth-keygen {
  text-align: center;
}

.ipr-auth-keygen p {
  font-size: 13px;
  color: var(--text-secondary, #A0A0A8);
  margin-bottom: 16px;
}

.ipr-auth-secret {
  position: relative;
  margin: 16px 0;
  padding: 14px 48px 14px 14px;
  font-family: var(--font-mono, "Geist Mono", ui-monospace, monospace);
  font-size: 13px;
  color: var(--accent, #D97706);
  background: var(--bg-elevated, #1A1A1D);
  border: 1px solid var(--border, #2A2A2E);
  border-radius: var(--radius-sm, 6px);
  word-break: break-all;
  text-align: left;
}

.ipr-auth-copy-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-secondary, #A0A0A8);
  background: var(--bg-highest, #232326);
  border: 1px solid var(--border, #2A2A2E);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.ipr-auth-copy-btn:hover {
  color: var(--text-primary, #EDEDEF);
  border-color: var(--border-hover, #3A3A3E);
}

.ipr-auth-warning {
  font-size: 12px;
  color: var(--warning, #F59E0B);
  margin-top: 8px;
}

/* ═══ Tab Panel Visibility ═══ */
.ipr-auth-panel {
  display: none;
}

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

/* ═══ Divider ═══ */
.ipr-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  font-size: 12px;
  color: var(--text-tertiary, #6B6B73);
}

.ipr-auth-divider::before,
.ipr-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #2A2A2E);
}
