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

:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #818cf8;
  --primary-glow:   rgba(99, 102, 241, 0.3);
  --accent:         #06b6d4;

  --bg-dark:        #0b0b18;
  --surface:        rgba(255, 255, 255, 0.03);
  --surface-hover:  rgba(255, 255, 255, 0.06);

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  --border:         rgba(255, 255, 255, 0.08);
  --border-focus:   rgba(99, 102, 241, 0.55);

  --error:          #f87171;
  --error-bg:       rgba(248, 113, 113, 0.07);
  --success:        #34d399;

  --font:           'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --t:              0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring:       0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: blobMove 10s ease-in-out infinite alternate;
}

.blob-1 {
  width: 650px; height: 650px;
  background: radial-gradient(circle, rgba(99,102,241,0.55) 0%, transparent 70%);
  top: -200px; left: -120px;
  animation-delay: 0s;
}

.blob-2 {
  width: 550px; height: 550px;
  background: radial-gradient(circle, rgba(6,182,212,0.45) 0%, transparent 70%);
  bottom: -180px; right: -120px;
  animation-delay: -4s;
}

.blob-3 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(139,92,246,0.35) 0%, transparent 70%);
  top: 45%; left: 45%;
  animation: blobCenter 10s ease-in-out infinite alternate;
  animation-delay: -7s;
}

@keyframes blobMove {
  0%   { transform: translate(0,   0)   scale(1); }
  100% { transform: translate(50px, 40px) scale(1.1); }
}
@keyframes blobCenter {
  0%   { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(calc(-50% + 35px), calc(-50% + 25px)) scale(1.12); }
}

.page-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  height: 100vh;
  align-items: stretch;
}

.left-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 46%;
  min-width: 380px;
  padding: 48px 52px;
  background: linear-gradient(
    155deg,
    rgba(99,102,241,0.11) 0%,
    rgba(139,92,246,0.06) 50%,
    rgba(6,182,212,0.05) 100%
  );
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  animation: slideInLeft var(--t-spring) both;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.logo-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.left-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0;
}

.left-title {
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1.2px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #f1f5f9 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.left-subtitle {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 360px;
  margin-bottom: 44px;
}

.features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 44px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--t);
}

.feature-item:hover { color: var(--text-primary); }

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--primary-light);
  flex-shrink: 0;
  transition: all var(--t);
}

.feature-item:hover .feature-icon {
  background: rgba(99,102,241,0.15);
  border-color: var(--border-focus);
}

.feature-icon svg { width: 16px; height: 16px; }

.stats-row {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.left-footer {
  font-size: 12px;
  color: var(--text-muted);
}

.right-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
  animation: slideInRight var(--t-spring) 0.1s both;
}

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

.form-card {
  width: 100%;
  max-width: 420px;
}

.form-header { margin-bottom: 32px; }

.form-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.field-group { margin-bottom: 20px; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
  transition: color var(--t);
}

.field-group:focus-within .field-label { color: var(--primary-light); }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--t);
  z-index: 1;
}

.input-icon svg { width: 16px; height: 16px; }

.field-input {
  width: 100%;
  height: 50px;
  padding: 0 48px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--t);
}

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

.field-input:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.14);
}

.field-input:focus {
  background: rgba(99,102,241,0.06);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-wrapper:focus-within .input-icon { color: var(--primary-light); }

.field-group.has-error .field-input {
  border-color: var(--error);
  background: var(--error-bg);
  box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
}

.field-group.has-error .field-label { color: var(--error); }
.field-group.has-error .input-icon  { color: var(--error); }

.field-group.is-valid .field-input {
  border-color: rgba(52,211,153,0.5);
}

.field-error {
  display: block;
  font-size: 12px;
  color: var(--error);
  margin-top: 5px;
  min-height: 16px;
  padding-left: 2px;
}

.field-group.has-error .field-error {
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  60%       { transform: translateX(5px); }
}

.toggle-password {
  position: absolute;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--t);
}

.toggle-password:hover {
  color: var(--primary-light);
  background: rgba(99,102,241,0.1);
}

.eye-icon { width: 17px; height: 17px; }

.hidden { display: none !important; }

.form-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
  flex-shrink: 0;
}

.checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) scale(0);
  transition: transform var(--t);
  margin-top: -2px;
}

.checkbox-input:checked ~ .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.checkbox-input:checked ~ .checkbox-custom::after {
  transform: rotate(45deg) scale(1);
}

.checkbox-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.forgot-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--t);
}

.forgot-link:hover { color: white; text-decoration: underline; }

.btn-submit {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--t);
}

.btn-submit:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,0.55);
}

.btn-submit:not(:disabled):hover::before { opacity: 1; }

.btn-submit:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}

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

.btn-spinner svg {
  width: 18px;
  height: 18px;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.3px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.social-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 0;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
}

.btn-social:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.14);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-social:active { transform: translateY(0); }

.signup-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.signup-link {
  color: var(--primary-light);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--t);
}

.signup-link:hover { color: white; text-decoration: underline; }

.toast {
  position: fixed;
  bottom: -90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 280px;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  transition: bottom 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  background: rgba(18,18,40,0.95);
}

.toast.show { bottom: 32px; }

.toast.toast-success {
  background: rgba(10,38,28,0.95);
  border-color: rgba(52,211,153,0.4);
}

.toast.toast-error {
  background: rgba(38,10,10,0.95);
  border-color: rgba(248,113,113,0.4);
}

.toast-icon { font-size: 16px; flex-shrink: 0; }

@media (max-width: 920px) {
  html, body { overflow: auto; }

  .page-wrapper {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .left-panel {
    width: 100%;
    min-width: unset;
    padding: 32px 28px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    animation: fadeInDown 0.5s ease both;
  }

  .left-content { padding: 20px 0; }
  .left-title { font-size: 28px; }
  .left-subtitle { margin-bottom: 28px; }
  .left-footer { display: none; }

  .features {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .feature-item { font-size: 12px; }

  .right-panel {
    padding: 40px 20px;
    animation: fadeInUp 0.5s ease 0.1s both;
  }

  @keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 480px) {
  .social-buttons { grid-template-columns: 1fr; }
  .form-title { font-size: 22px; }
  .stats-row { gap: 16px; }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }
