/**
 * Authentication Modal Styles
 * Braun-inspired minimal design
 */

/* Modal Container */
.auth-modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
}

.auth-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Box */
.auth-modal {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 420px;
  padding: var(--space-lg);
  position: relative;
  animation: slideUp 0.3s ease-out;
}

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

/* Close Button */
.auth-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.auth-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Header */
.auth-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.auth-logo {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: var(--space-sm);
}

.auth-header h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 var(--space-xs) 0;
  color: var(--text-primary);
}

.auth-header p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.auth-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--radius-sm) - 2px);
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-tab:hover:not(.active) {
  color: var(--text-primary);
}

/* Form */
#authForm {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group {
  position: relative;
}

#authForm input,
#authForm select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: all 0.2s ease;
}

#authForm input:focus,
#authForm select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

#authForm input::placeholder {
  color: var(--text-tertiary);
}

/* Submit Button */
.auth-submit {
  width: 100%;
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  color: white;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: var(--space-xs);
}

.auth-submit:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(230, 126, 34, 0.3);
}

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

/* Error Message */
.auth-error {
  padding: var(--space-sm);
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: var(--radius-sm);
  color: #dc3545;
  font-size: var(--text-sm);
  text-align: center;
}

/* Divider */
.auth-divider {
  position: relative;
  text-align: center;
  margin: var(--space-lg) 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.auth-divider span {
  position: relative;
  padding: 0 var(--space-md);
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* OAuth Buttons */
.auth-oauth-buttons {
  display: flex;
  gap: var(--space-sm);
}

.auth-oauth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-oauth:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-tertiary);
}

.auth-oauth svg {
  flex-shrink: 0;
}

/* Footer */
.auth-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

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

/* Success Notification */
.auth-notification {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 10001;
}

.auth-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .auth-modal {
    padding: var(--space-md);
    margin: var(--space-sm);
  }
  
  .auth-oauth-buttons {
    flex-direction: column;
  }
  
  .auth-notification {
    top: var(--space-sm);
    right: var(--space-sm);
    left: var(--space-sm);
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .auth-modal {
    background: #1a1a1a;
  }
  
  #authForm input,
  #authForm select {
    background: #0a0a0a;
    border-color: #333;
  }
  
  .auth-oauth {
    background: #0a0a0a;
    border-color: #333;
  }
  
  .auth-oauth:hover {
    background: #1a1a1a;
    border-color: #444;
  }
}