/* (Reverted header layout fix. No custom .topbar, .brand-group, .controls, or button styles here.) */

.auth-container {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: transparent;
}

body.theme-dark .auth-container {
  background: #0b1d33;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border);
  min-height: 520px;
  position: relative;
  z-index: 2;
}

body.theme-dark .auth-card {
  background: #0b1d33;
  backdrop-filter: none;
}

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

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 14px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-md);
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition-base);
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.form-button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.form-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.form-button:disabled {
  background: var(--border);
  cursor: not-allowed;
  transform: none;
  opacity: 0.6;
}

.divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 45%;
  height: 1px;
  background: var(--border);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.google-button {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.google-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.guest-button {
  margin-top: 12px;
}

.google-icon {
  width: 20px;
  height: 20px;
}

.guest-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
}

.error-message {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  display: none;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

body.theme-dark .error-message {
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
  border-color: rgba(220, 53, 69, 0.4);
}

.error-message.show {
  display: block;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

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

.signup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

#signupForm .signup-row .form-group {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .signup-row {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
  }

  #signupForm .signup-row .form-group {
    margin-bottom: 20px;
  }
}
