@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --color-bg-deep: #020612;
  --color-brand-primary: #0066FF;
  --color-brand-primary-hover: #2979FF;
  --color-brand-sapphire: #032051;
  --color-brand-cyan: #0066FF;
  --color-brand-cyan-hover: #2979FF;
  --color-brand-blue: #0049C7;
  --color-brand-violet: #1D4ED8;
  --color-card-bg: rgba(2, 10, 28, 0.84);
  --color-card-border: rgba(0, 102, 255, 0.24);
  --color-input-bg: rgba(2, 7, 20, 0.7);
  --color-input-border: rgba(255, 255, 255, 0.12);
  --color-text-primary: #ffffff;
  --color-text-secondary: rgba(255, 255, 255, 0.72);
  --color-text-muted: rgba(255, 255, 255, 0.45);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-deep);
  color: var(--color-text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   Login Background & Atmospheric Canvas
   ============================================================================ */
.login-background {
  position: fixed;
  inset: 0;
  background-image: url('/static/assets/login-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.login-background__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(2, 8, 22, 0.4) 0%, rgba(2, 6, 18, 0.8) 75%, #01040e 100%),
              linear-gradient(180deg, rgba(2, 8, 22, 0.2) 0%, rgba(1, 4, 14, 0.85) 100%);
  backdrop-filter: blur(2px);
  z-index: 1;
}

/* Subtle glowing electric aura */
.login-background__glow {
  position: absolute;
  width: 650px;
  height: 650px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 102, 255, 0.15) 0%, rgba(3, 32, 81, 0.08) 45%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* ============================================================================
   Content Container & Glassmorphic Card
   ============================================================================ */
.login-container {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.card-glass-dark {
  width: 100%;
  max-width: 460px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 18px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.9),
              0 0 50px rgba(0, 102, 255, 0.14),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

/* Prominent, high-impact MGC Logo */
.login-brand-logo {
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto 1.5rem auto;
  display: block;
  filter: drop-shadow(0 6px 22px rgba(0, 102, 255, 0.35));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.login-brand-logo:hover {
  transform: scale(1.03);
  filter: drop-shadow(0 8px 28px rgba(0, 102, 255, 0.5));
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

/* ============================================================================
   Mode Tabs (Sign In / Sign Up)
   ============================================================================ */
.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.5rem;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--color-text-secondary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: rgba(0, 102, 255, 0.2);
  color: #60A5FA;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(0, 102, 255, 0.25);
}

/* ============================================================================
   OAuth Buttons Grid
   ============================================================================ */
.oauth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  background: rgba(13, 20, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.oauth-btn:hover {
  background: rgba(22, 34, 60, 0.95);
  border-color: rgba(0, 102, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 15px rgba(0, 102, 255, 0.2);
}

.oauth-btn svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.oauth-btn:hover svg {
  transform: scale(1.1);
}

/* ============================================================================
   Divider
   ============================================================================ */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 1.25rem 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 0.875rem;
  background: var(--color-card-bg);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ============================================================================
   Form Inputs & Labels
   ============================================================================ */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  text-align: left;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: 9px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  background: rgba(4, 14, 38, 0.9);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.25);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

/* ============================================================================
   Submit Button
   ============================================================================ */
.btn-submit {
  width: 100%;
  padding: 0.875rem 1.5rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #0066FF 0%, #0045B5 100%);
  color: #ffffff;
  border: none;
  border-radius: 9px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.38);
  transition: all 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0, 102, 255, 0.52);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

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

/* ============================================================================
   Feedback Alerts
   ============================================================================ */
.alert-box {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  line-height: 1.4;
  display: none;
}

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

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* ============================================================================
   Footer & Demo Link
   ============================================================================ */
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.demo-link-container {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.demo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #3B82F6;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.demo-link:hover {
  color: #60A5FA;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.page-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.page-footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.page-footer a:hover {
  color: #ffffff;
}

/* ============================================================================
   Cognispace Bottom-Right Watermark / Badge
   ============================================================================ */
.cognispace-badge {
  position: fixed;
  bottom: 22px;
  right: 26px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 6px 14px;
  background: rgba(8, 12, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 9999px;
  text-decoration: none;
  opacity: 0.8;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cognispace-badge:hover {
  opacity: 1;
  background: rgba(12, 18, 36, 0.9);
  border-color: rgba(0, 102, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 102, 255, 0.2);
}

.cognispace-badge-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}

.cognispace-badge-img {
  height: 18px;
  width: auto;
  display: block;
  filter: brightness(1.1);
}

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 480px) {
  .card-glass-dark {
    padding: 1.75rem 1.25rem;
  }

  .login-brand-logo {
    max-width: 250px;
  }

  .login-title {
    font-size: 1.375rem;
  }

  .oauth-grid {
    grid-template-columns: 1fr;
  }

  .cognispace-badge {
    bottom: 12px;
    right: 12px;
    padding: 5px 10px;
  }

  .cognispace-badge-img {
    height: 15px;
  }
}
