:root {
  color-scheme: dark;
  --bg: #0b0f19;
  --surface: rgba(17, 24, 39, 0.45);
  --surface-alt: rgba(31, 41, 55, 0.55);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-strong: #a855f7;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  --glow-1: rgba(99, 102, 241, 0.15);
  --glow-2: rgba(168, 85, 247, 0.15);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(255,255,255,0.015), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(255,255,255,0.015), transparent 25%);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4, h5, h6, .brand-name {
  font-family: 'Outfit', system-ui, sans-serif;
}

/* Abstract Background Orbs */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: floatOrb 20s infinite alternate ease-in-out;
  opacity: 0.7;
}
.orb-1 {
  width: 50vw; height: 50vw;
  background: linear-gradient(to right, var(--primary), var(--primary-strong));
  top: -10vw; left: -10vw;
}
.orb-2 {
  width: 40vw; height: 40vw;
  background: linear-gradient(to right, var(--primary-strong), #ec4899);
  bottom: -5vw; right: -5vw;
  animation-delay: -5s;
}
@keyframes floatOrb {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-50px) scale(1.1); }
}

.page-shell {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.top-nav {
  width: min(1200px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  height: 64px; width: auto; object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(168, 85, 247, 0.3));
  transform: translateY(6px);
}
.brand-name {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-weight: 600; transition: color 0.2s;
}
.nav-links a:hover { color: #fff; }

.auth-shell {
  width: min(1150px, 100%);
  position: relative;
  border-radius: 40px;
  z-index: 2;
  overflow: hidden;
}

.auth-track {
  display: flex;
  width: 150%;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.auth-shell.register-active .auth-track { transform: translateX(-33.333%); }

.panel {
  position: relative;
  border-radius: 36px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 40px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.05));
  display: flex; flex-direction: column; justify-content: center;
  align-items: center;
}

.panel-content {
  max-width: 480px; position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0;
}

.brand-tag {
  display: inline-flex; padding: 8px 16px; border-radius: 999px;
  background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.3);
  color: #e879f9; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}

.hero-text {
  margin-top: -55px; z-index: 1; position: relative; width: 120%;
}

.panel-title {
  margin: 0; font-size: clamp(3rem, 5vw, 4.5rem); line-height: 0.9; letter-spacing: -0.04em;
  background: linear-gradient(to bottom, #ffffff 30%, rgba(255,255,255,0.05)); -webkit-background-clip: text; color: transparent;
  opacity: 0.5; text-transform: uppercase; font-weight: 800;
}

.panel-copy { margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

.hero-avatar {
  width: clamp(170px, 15vw, 220px); display: block; margin: 0 auto;
  border-radius: 28px; position: relative; z-index: 2;
  transition: all 0.5s ease;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
  animation: floatImage 6s ease-in-out infinite alternate;
}
@keyframes floatImage {
  to { transform: translateY(-15px); }
}

.register-hero {
  position: absolute; top: 40px; right: 40px;
  width: clamp(170px, 15vw, 220px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0;
  opacity: 0; transform: translateX(40px); transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 10; pointer-events: none;
}
.auth-shell.register-active .register-hero {
  opacity: 1; transform: translateX(0); pointer-events: auto;
}
.auth-shell.register-active .hero-avatar.login-avatar {
  opacity: 0; transform: translateX(-40px) scale(0.9);
}
.hero-avatar.register-avatar { max-width: 100%; border-radius: 28px; z-index: 2; position: relative; }

.register-hero-text {
  margin-top: 16px; z-index: 1; position: relative;
  display: flex; flex-direction: column; align-items: flex-end; text-align: right; width: 115%;
}

.slogan-title {
  margin: 0; font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.35; letter-spacing: -0.01em;
  color: #f8fafc; font-weight: 500;
}
.social-proof-text {
  margin: 12px 0 0; color: #a5b4fc; font-weight: 500; font-size: 0.85rem; line-height: 1.4;
  text-align: right; max-width: 140px;
}

.form-panel, .hero-panel, .auth-spacer { flex: 0 0 33.333%; }
.auth-spacer { display: flex; flex-direction: column; justify-content: center; padding-left: 30px; }

.testimonials-container {
  display: flex; flex-direction: column; gap: 20px; max-width: 340px; margin-top: -60px;
  opacity: 0; transform: translateX(40px); transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1) 0.1s;
}
.auth-shell.register-active .testimonials-container { opacity: 1; transform: translateX(0); }

.testimonial-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px;
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); box-shadow: var(--shadow);
  position: relative; transition: transform 0.3s ease;
}
.testimonial-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.4); }
.testimonial-card.t-1 { margin-left: 40px; }
.testimonial-card.t-2 { margin-left: 0; }

.stars { color: #fbbf24; font-size: 1.1rem; margin-bottom: 12px; letter-spacing: 2px; }
.testimonial-card p { color: #f8fafc; font-size: 1rem; line-height: 1.5; margin: 0 0 20px 0; font-style: italic; }
.t-author { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.t-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.95rem; }
.bg-purple { background: linear-gradient(135deg, #a855f7, #c084fc); box-shadow: 0 4px 12px rgba(168,85,247,0.3); }
.bg-indigo { background: linear-gradient(135deg, #6366f1, #818cf8); box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.t-info { display: flex; flex-direction: column; }
.t-info strong { color: #fff; font-size: 0.95rem; font-weight: 600; line-height: 1.2; }
.t-info span { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }

.form-panel {
  padding: 40px; border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.6); box-shadow: -20px 0 60px rgba(0,0,0,0.3);
}

.form-shell { width: 100%; max-width: 480px; overflow: hidden; transition: height 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.view-track {
  display: flex; width: 200%; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  align-items: flex-start;
}
.form-shell.register-active .view-track { transform: translateX(-50%); }
.form-view { width: 50%; flex-shrink: 0; padding-right: 24px; transition: opacity 0.3s; animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.form-shell.register-active .form-view { padding-right: 0; padding-left: 24px; }
.form-view.hidden { opacity: 0; pointer-events: none; }

.form-header { margin-bottom: 24px; }
.form-header h2 { margin: 0; font-size: 2.2rem; letter-spacing: -0.03em; color: #fff; }
.form-header p { margin: 12px 0 0; color: var(--muted); font-size: 1.05rem; }

.auth-form { display: grid; gap: 16px; }
.field-group { display: grid; gap: 6px; }
.field-group label { font-size: 0.9rem; font-weight: 600; color: #e2e8f0; }

.input-group { position: relative; }
.input-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 1.1rem; pointer-events: none; transition: color 0.3s;
}

input, select {
  width: 100%; border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 18px 14px 48px; background: rgba(0, 0, 0, 0.2);
  color: #fff; font-size: 1rem; font-family: inherit;
  transition: all 0.3s ease;
}
select {
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center; background-size: 16px;
}
select option { background: #1e293b; color: #fff; }

input:focus, select:focus {
  outline: none; border-color: var(--primary); background: rgba(0,0,0,0.3);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
input:focus ~ .input-icon { color: var(--primary); }

.label-row, .form-row { display: flex; align-items: center; justify-content: space-between; }
.checkbox-label { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.95rem; cursor: pointer; }
.checkbox-label input { width: 18px; height: 18px; accent-color: var(--primary); border-radius: 4px; padding: 0; }

.primary-button {
  width: 100%; border: none; border-radius: 16px; padding: 16px; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
  font-family: 'Outfit', sans-serif;
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4); filter: brightness(1.1); }
.primary-button:active { transform: translateY(0); }

.divider {
  display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; font-weight: 600;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.social-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.social-button {
  border: 1px solid var(--border); background: rgba(255,255,255,0.03);
  border-radius: 16px; padding: 14px; color: #fff; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit;
}
.social-button:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }

.helper-text { color: var(--muted); font-size: 0.95rem; text-align: center; margin-top: 10px; }

.link-button, .link-button-inline, .text-button, a {
  color: #a855f7; text-decoration: none; font-weight: 600; background: none; border: none; cursor: pointer; font-family: inherit; transition: color 0.2s; padding: 0;
}
.link-button:hover, .link-button-inline:hover, .text-button:hover, a:hover { color: #d8b4fe; text-decoration: underline; }

.text-button { color: var(--muted); font-size: 0.95rem; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 24px; }
.text-button:hover { color: #fff; text-decoration: none; }

.double-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  opacity: 1; transition: opacity 0.3s;
}
.modal-backdrop.hidden { opacity: 0; pointer-events: none; }
.modal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 28px;
  padding: 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow);
  position: relative; transform: scale(1); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-backdrop.hidden .modal-card { transform: scale(0.95); }
.close-button {
  position: absolute; top: 24px; right: 24px; background: none; border: none;
  font-size: 1.8rem; color: var(--muted); cursor: pointer; transition: color 0.2s; line-height: 1;
}
.close-button:hover { color: #fff; }

.modal-card h2 { margin: 0 0 12px 0; font-size: 2rem; color: #fff; }
.modal-card p { color: var(--muted); margin-bottom: 24px; line-height: 1.6; }

.modal-buttons {
  display: flex; gap: 12px; justify-content: flex-end;
}

.modal-buttons .secondary-button {
  flex: 1; padding: 12px 24px;
}

.modal-buttons .primary-button {
  flex: 1; padding: 12px 24px;
}

.secondary-button {
  border: 1px solid var(--border); border-radius: 16px; padding: 16px;
  background: rgba(255,255,255,0.05); color: #fff; font-weight: 700;
  font-size: 1.05rem; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  font-family: 'Outfit', sans-serif;
}

.secondary-button:hover {
  background: rgba(255,255,255,0.1); transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255,255,255,0.1);
}

.secondary-button:active { transform: translateY(0); }

.danger-button {
  background: linear-gradient(135deg, #ff4757 0%, #ee5a6f 100%);
  border-color: #ff4757;
}

.danger-button:hover {
  background: linear-gradient(135deg, #ff3838 0%, #ee4255 100%);
  border-color: #ff3838;
}

/* Animations on elements */
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
  .auth-track { width: 100%; }
  .hero-panel, .form-panel, .auth-spacer { flex: 0 0 50%; }
  .auth-shell.register-active .auth-track { transform: translateX(-50%); }
  .top-nav { flex-wrap: wrap; justify-content: center; }
  .register-hero { top: 32px; right: 32px; opacity: 0; transform: translateX(20px); }
  .auth-shell.register-active .register-hero { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
  .page-shell { padding: 12px; }
  .top-nav { display: none; }
  .hero-panel { display: none; }
  .form-panel, .auth-spacer { flex: 0 0 100%; }
  .auth-shell.register-active .auth-track { transform: translateX(-100%); }
  .form-panel { padding: 32px 24px; border-radius: 36px; }
  .register-hero { top: 20px; left: 50%; transform: translateX(-50%) scale(0.9); width: 80%; display: none; }
  .double-fields { grid-template-columns: 1fr; }
}
