:root {
  --bg-base: #06080e;
  --bg-surface: #0b0e15;
  --bg-panel: rgba(20, 24, 32, 0.6);
  --bg-panel-strong: rgba(16, 20, 28, 0.78);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 255, 255, 0.3);

  --text-primary: #ffffff;
  --text-secondary: #8a8f9a;
  --text-tertiary: rgba(255, 255, 255, 0.6);

  --accent: #ffffff;
  --accent-invert: #06080e;
  --brand: #11b88a;
  --brand-2: #4b48df;

  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body { height: 100%; }

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

.ambient-light {
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: width 0.3s, height 0.3s;
}

/* Shared shells */
.card {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

/* ---------- AUTH (login) ---------- */
.wrapper.auth-layout {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  padding: 40px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
  min-height: 100vh;
  align-items: center;
}

.left-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: fadeUp 1s var(--transition-smooth);
}

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

.badge {
  width: max-content;
  padding: 8px 16px;
  border-radius: 100px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.hero-title span { color: var(--text-secondary); }

.hero-text {
  max-width: 520px;
  color: var(--text-secondary);
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 48px;
}

.stats {
  display: flex;
  gap: 40px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 32px;
}

.stat-item h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.stat-item p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
}

.auth-container {
  display: flex;
  align-items: center;
  animation: fadeUp 1.2s var(--transition-smooth);
}

.auth-card {
  width: 100%;
  padding: 40px;
  border-radius: 24px;
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.brand-wordmark {
  color: var(--brand-2);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.role-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 32px;
  position: relative;
  border: 1px solid var(--border-subtle);
}

.role-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  transition: transform var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.role-switch.admin-active .role-slider { transform: translateX(100%); }

.role-btn {
  flex: 1;
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 0;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s;
}

.role-btn.active { color: var(--text-primary); }

.form-section-container { 
  display: grid; 
  position: relative;
}

.form-section {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.form-section.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}

.tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.tab {
  padding-bottom: 12px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.3s;
}

.tab:hover { color: #e0e0e0; }
.tab.active { color: var(--text-primary); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
}

.input-group { position: relative; margin-bottom: 16px; }

.input-group input {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-subtle);
  padding: 16px;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.input-group input::placeholder {
  color: var(--text-secondary);
}

.input-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  margin-top: 10px;
  background: var(--accent);
  color: var(--accent-invert);
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
}

.btn-primary:hover { background: #e0e0e0; transform: scale(0.99); }

.footer-note {
  margin-top: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Flash messages (login/signup feedback) */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  border: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.92);
}

.flash.error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.10);
  color: #ffd2d2;
}

.flash.success {
  border-color: rgba(17, 184, 138, 0.35);
  background: rgba(17, 184, 138, 0.10);
  color: #cdf3e6;
}

@media (max-width: 960px) {
  body { overflow: auto; }
  .wrapper.auth-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
  }
  .left-side { 
    display: none; /* Hide hero text on mobile so the form is immediately visible */
  }
  .auth-container {
    width: 100%;
    max-width: 440px;
  }
  .ambient-light { display: none; }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 28px 20px;
  }
  .brand-wordmark {
    font-size: 1.5rem;
  }
  .wrapper.auth-layout {
    padding: 16px;
  }
}

