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

:root {
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-light: #818cf8;
  --accent: #06b6d4;
  --surface: #ffffff;
  --bg: #f8faff;
  --text: #0f0f1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --error: #ef4444;
  --radius: 14px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --glow: 0 0 40px rgba(99,102,241,0.18);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

/* ── Left panel ── */
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  background: var(--surface);
  position: relative;
  z-index: 1;
  animation: slideInLeft 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.login-inner {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

/* Wordmark */
.login-wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 52px;
  animation: fadeDown 0.5s 0.1s both;
}

.wordmark-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
  animation: iconPop 0.5s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.wordmark-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wordmark-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

/* Headings */
.login-heading {
  font-size: 34px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  animation: fadeUp 0.5s 0.15s both;
}

.login-sub {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 40px;
  animation: fadeUp 0.5s 0.2s both;
}

/* Form */
.form-field {
  margin-bottom: 20px;
  position: relative;
  animation: fadeUp 0.5s both;
}

.form-field:nth-child(1) { animation-delay: 0.25s; }
.form-field:nth-child(2) { animation-delay: 0.32s; }

.form-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.input-wrap {
  position: relative;
}

.input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke var(--transition);
}

.form-field input {
  width: 100%;
  padding: 13px 16px 13px 42px;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 11px;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.form-field input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-field input:focus + svg,
.input-wrap:focus-within svg {
  stroke: var(--brand);
}

/* Error */
.error-message {
  font-size: 13px;
  color: var(--error);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 9px;
  padding: 10px 14px;
  margin-bottom: 18px;
  animation: shake 0.4s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Login button */
.login-button {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border: none;
  border-radius: 11px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.5s 0.38s both;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}

.login-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.45);
}

.login-button:hover::before { opacity: 1; }
.login-button:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.login-button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* Ripple */
.login-button .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}

.login-footer-text {
  margin-top: 32px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  animation: fadeUp 0.5s 0.45s both;
}

/* ── Right panel ── */
.brand-panel {
  background: linear-gradient(145deg, #4f46e5 0%, #6366f1 40%, #06b6d4 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
  animation: slideInRight 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Animated mesh background */
.brand-panel::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: floatOrb 8s ease-in-out infinite;
}

.brand-panel::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,0.15) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation: floatOrb 10s ease-in-out infinite reverse;
}

.brand-orb {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  top: 50%;
  left: 30%;
  animation: floatOrb 6s ease-in-out infinite 2s;
}

/* Grid lines */
.brand-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridDrift 20s linear infinite;
}

.brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.brand-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  animation: iconFloat 3s ease-in-out infinite, fadeUp 0.6s 0.3s both;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.brand-icon-wrap svg {
  width: 36px;
  height: 36px;
  stroke: #fff;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-tagline {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  text-align: center;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s 0.35s both;
}

.brand-tagline span {
  display: inline-block;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-desc {
  margin-top: 16px;
  font-size: 15px;
  color: rgba(255,255,255,0.72);
  text-align: center;
  max-width: 300px;
  line-height: 1.65;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s 0.45s both;
}

.brand-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 36px;
  position: relative;
  z-index: 1;
}

.pill {
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  transition: background var(--transition), transform var(--transition);
  animation: fadeUp 0.5s both;
}

.pill:nth-child(1) { animation-delay: 0.5s; }
.pill:nth-child(2) { animation-delay: 0.58s; }
.pill:nth-child(3) { animation-delay: 0.66s; }
.pill:nth-child(4) { animation-delay: 0.74s; }

.pill:hover { background: rgba(255,255,255,0.22); transform: translateY(-2px); }

/* Stats row */
.brand-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s 0.8s both;
}

.stat-item { text-align: center; }
.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ── Animations ── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-7px); }
  40%       { transform: translateX(7px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

@keyframes iconPop {
  from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(20px, -30px) scale(1.05); }
  66%       { transform: translate(-15px, 20px) scale(0.95); }
}

@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 48px 48px; }
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  body { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .login-panel { padding: 40px 24px; }
}
