:root {
  --font: "DM Sans", system-ui, sans-serif;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;
  --surface: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 14px;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
}

.split-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.left-side {
  flex: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: linear-gradient(145deg, var(--brand-800) 0%, var(--brand-600) 45%, #7c3aed 100%);
  position: relative;
  overflow: hidden;
}

.left-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 40%);
}

.overlay {
  position: relative;
  z-index: 1;
  max-width: 420px;
  color: #fff;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.overlay h1 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.overlay p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
}

.feature-list {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.right-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--surface);
}

.form-box {
  width: 100%;
  max-width: 420px;
  padding: 2.25rem;
  background: #fff;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.brand-heading {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.35rem;
}

.form-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: -0.5rem;
}

.form input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form input:focus {
  outline: none;
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auth-error {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.9rem;
  border: 1px solid #fecaca;
}

.auth-error.visible {
  display: block;
}

.btn {
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, opacity 0.2s;
}

.btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--brand-600);
  border: 1px solid var(--border);
  margin-top: 0.5rem;
}

.form-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  text-align: center;
}

.form-footer a {
  color: var(--brand-600);
  text-decoration: none;
  font-weight: 500;
}

.form-footer a:hover {
  text-decoration: underline;
}

.form-footer a.secondary {
  color: var(--muted);
}

#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  background: #1e293b;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.3s, transform 0.3s;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  background: #065f46;
}

.toast-error {
  background: #991b1b;
}

.toast-info {
  background: #1e3a8a;
}

@media (max-width: 900px) {
  .split-layout {
    flex-direction: column;
  }

  .left-side {
    padding: 2rem 1.5rem;
    min-height: auto;
  }

  .feature-list {
    display: none;
  }
}
