/* Login page — clean light SaaS aesthetic */

:root {
  --accent-glow: rgba(59, 130, 246, 0.15);
  --border-focus: rgba(59, 130, 246, 0.4);
  --error-bg: rgba(239, 68, 68, 0.06);
  --error-border: rgba(239, 68, 68, 0.15);
  --error-text: #dc2626;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.login-page {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'DM Sans', system-ui, sans-serif;
  overflow: hidden;
  position: relative;
}

/* Ambient glow */
.login-glow {
  position: fixed; top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle,
    rgba(59, 130, 246, 0.06) 0%,
    rgba(59, 130, 246, 0.02) 40%,
    transparent 70%);
  pointer-events: none;
  animation: glowPulse 8s ease-in-out infinite;
}

/* ── Layout ── */
.login-main {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem 1.5rem;
  position: relative; z-index: 1;
}

/* ── Brand ── */
.login-brand {
  display: flex; align-items: center; gap: 0.75rem;
  text-decoration: none; color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.login-brand-icon {
  height: 2.5rem; width: auto;
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.15));
}

.login-subtitle {
  font-size: 0.9375rem; color: var(--text-muted);
  margin-bottom: 2.5rem; letter-spacing: 0.01em;
}

/* ── Card ── */
.login-card {
  width: 100%; max-width: 400px;
  border-radius: 16px; padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 8px 40px rgba(0, 0, 0, 0.06);
}

/* ── Tabs ── */
.login-tabs {
  display: flex; gap: 0.25rem;
  margin-bottom: 1.75rem; padding: 3px;
  border-radius: 10px;
  background: var(--accent-soft);
}
.login-tab {
  flex: 1; padding: 0.5rem 0;
  border-radius: 8px; border: none;
  background: transparent; color: var(--text-muted);
  font-size: 0.8125rem; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: all 0.2s ease;
}
.login-tab:hover { color: var(--text-secondary); }
.login-tab--active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ── Error ── */
.login-error {
  margin-bottom: 1.25rem; padding: 0.75rem 1rem;
  border-radius: 10px; font-size: 0.8125rem;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

/* ── Fields ── */
.login-field { margin-bottom: 1.125rem; }
.login-label {
  display: block; margin-bottom: 0.375rem;
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.03em; text-transform: uppercase;
}
.login-input {
  width: 100%; padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem; font-family: inherit;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input::placeholder {
  color: var(--text-secondary); opacity: 0.5;
}
.login-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

/* ── Submit button ── */
.login-submit {
  width: 100%; padding: 0.75rem 1.5rem;
  margin-top: 0.5rem;
  border-radius: 10px; border: none;
  background: var(--accent);
  color: #fff; font-size: 0.875rem;
  font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.25);
}
.login-submit:hover {
  opacity: 0.92; transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}
.login-submit:active {
  transform: translateY(0); opacity: 0.85;
}
.login-submit:disabled {
  opacity: 0.5; cursor: wait; transform: none;
}

/* Loading spinner */
.login-spinner-wrap {
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.login-spinner {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
}

/* ── Back link ── */
.login-back {
  margin-top: 2rem;
  font-size: 0.8125rem; color: var(--text-muted);
  text-decoration: none; transition: color 0.2s;
}
.login-back:hover { color: var(--text-secondary); }

/* ── Animations ── */
@keyframes glowPulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.15); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .login-card { padding: 1.5rem; }
  .login-brand-icon { height: 2rem; }
  .login-brand-text { font-size: 1.125rem; }
}
