@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg: #f5f7fb;
  --ink: #1a1f36;
  --ink-soft: #3d4560;
  --muted: #7a829e;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --surface: #ffffff;
  --surface-soft: #f0f2f7;
  --surface-muted: #e8ebf2;
  --blue: #3b82f6;
  --blue-bright: #2563eb;
  --purple: #7c3aed;
  --blue-light: #818cf8;
  --blue-soft: rgba(59, 130, 246, 0.08);
  --blue-glow: rgba(37, 99, 235, 0.15);
  --purple-soft: rgba(124, 58, 237, 0.08);
  --dark: #f5f7fb;
  --dark-panel: #ffffff;
  --dark-mid: #eef0f6;
  --dark-border: rgba(0, 0, 0, 0.07);
  --primary: #3b82f6;
  --radius-xl: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-blue: 0 4px 20px rgba(37, 99, 235, 0.18);
}

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

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── AUTH LAYOUT ─── */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 50% 50% at 10% 15%, rgba(37,99,235,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 45% 50% at 85% 80%, rgba(124,58,237,0.05) 0%, transparent 55%),
    var(--bg);
  position: relative;
  overflow-y: auto;
}

/* Subtle dot pattern */
.auth-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.auth-body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.auth-shell {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 16px 48px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out;
}

/* ─── BRAND PANEL (LEFT) ─── */
.brand-panel {
  background: #ffffff;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Subtle blue gradient accent */
.brand-panel::before {
  content: '';
  position: absolute;
  right: -100px;
  bottom: -100px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, rgba(124, 58, 237, 0.03) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.brand-panel > * { position: relative; z-index: 1; }

/* Logo area */
.brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.logo {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-blue);
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-top strong {
  display: block;
  font-family: 'Sora', sans-serif;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-weight: 600;
}

.brand-top span {
  font-size: 11px;
  color: var(--blue);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 3px;
  display: block;
}

/* Hero copy */
.hero-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 0 28px;
  animation: fadeInUp 0.7s ease-out 0.2s both;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 22px;
  width: fit-content;
  background: rgba(59, 130, 246, 0.05);
  position: relative;
}

.version-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }
  50% { opacity: 0.5; box-shadow: 0 0 4px rgba(59, 130, 246, 0.2); }
}

.brand-panel h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 16px;
  font-weight: 700;
}

.brand-panel h1 em {
  background: linear-gradient(135deg, #3b82f6, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: normal;
}

.brand-panel p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 15px;
  font-weight: 400;
  max-width: 420px;
}

/* Feature pills */
.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
}

.feature-pill {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all 0.3s ease;
}

.feature-pill:hover {
  background: rgba(59, 130, 246, 0.06);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--blue);
}

/* Mini card */
.mini-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  display: grid;
  gap: 8px;
  animation: fadeInUp 0.7s ease-out 0.3s both;
}

.mini-card strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.mini-card span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
  font-weight: 400;
}

/* ─── AUTH CARD (RIGHT) ─── */
.auth-card {
  background: #fafbfe;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--border);
  animation: fadeInUp 0.7s ease-out 0.15s both;
}

.auth-heading {
  margin-bottom: 28px;
}

.auth-heading h2 {
  font-family: 'Sora', sans-serif;
  font-size: 30px;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.15;
}

.auth-heading p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 400;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}

.tabs button {
  flex: 1;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 16px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
  position: relative;
}

.tabs button.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.25);
}

.tabs button:not(.active):hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.03);
}

/* Inputs */
input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 400;
}

input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

/* Buttons */
button {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  letter-spacing: 0.01em;
}

.primary {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.25);
  position: relative;
  overflow: hidden;
  border: none;
}

.primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1));
  pointer-events: none;
}

.primary:hover {
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.2);
}

/* Misc */
.hidden { display: none !important; }

.hint {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 12px;
  line-height: 1.6;
  font-weight: 400;
}

.hint b { color: var(--ink-soft); font-weight: 600; }

#message {
  min-height: 22px;
  color: var(--blue);
  font-weight: 600;
  font-size: 13.5px;
  margin-top: 4px;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
    border-radius: var(--radius-md);
  }

  .brand-panel {
    padding: 32px 28px;
    min-height: auto;
  }

  .auth-card {
    padding: 32px 28px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .feature-list {
    grid-template-columns: 1fr 1fr;
  }

  .brand-panel h1 {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .auth-body { padding: 12px; }

  .feature-list { grid-template-columns: 1fr; }

  .auth-card { padding: 24px 20px; }

  .brand-panel { padding: 24px 20px; }

  .brand-panel h1 {
    font-size: 24px;
  }

  .auth-heading h2 {
    font-size: 24px;
  }
}
