:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --bg: #f8fafc;
  --bg-2: #ffffff;
  --bg-3: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 12px 34px rgba(15, 23, 42, 0.12);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

[data-theme='dark'] {
  --bg: #0f172a;
  --bg-2: #1a2744;
  --bg-3: #1e3a5f;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.17), transparent 45%),
    radial-gradient(circle at 88% 100%, rgba(59, 130, 246, 0.15), transparent 35%),
    var(--bg);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth-side {
  padding: 46px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 170px;
  height: auto;
}

.pitch {
  max-width: 500px;
  margin-top: 36px;
  animation: riseIn 0.45s ease;
}

.pitch h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.8vw, 3rem);
  line-height: 1.08;
}

.pitch p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 1.03rem;
  line-height: 1.65;
}

.signals {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.signal {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-2) 92%, var(--accent) 8%);
  border-radius: 14px;
  padding: 12px;
  font-size: 0.95rem;
}

.demo-box {
  margin-top: 24px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.demo-box h3 {
  font-family: var(--font-display);
  font-size: 1rem;
}

.demo-item {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.demo-item p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.demo-fill {
  border: 0;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(520px, 100%);
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  box-shadow: var(--shadow);
  padding: 26px;
  animation: riseIn 0.4s ease;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.auth-head h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
}

.auth-head p {
  color: var(--text-muted);
  margin-top: 4px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-3);
  cursor: pointer;
}

.theme-icon {
  font-size: 1rem;
}

[data-theme='light'] .theme-icon.moon,
[data-theme='dark'] .theme-icon.sun {
  display: none;
}

.role-switch {
  margin-top: 18px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.role-btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  font-weight: 700;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-btn.active {
  background: var(--bg-2);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.form {
  margin-top: 16px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.89rem;
  font-weight: 600;
}

.input-wrap {
  position: relative;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-2);
  color: var(--text);
  padding: 12px 13px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.field-error {
  display: none;
  color: #dc2626;
  font-size: 0.78rem;
  margin-top: 2px;
}

.field-error.show {
  display: block;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.remember input {
  width: auto;
}

.link-btn,
.link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.primary-btn {
  margin-top: 14px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-family: var(--font-display);
  padding: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-btn:hover {
  background: var(--accent-dark);
}

.primary-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.form-note {
  margin-top: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.banner {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 0.86rem;
  display: none;
}

.banner.error {
  display: block;
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.banner.success {
  display: block;
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.pro-fields {
  display: none;
  animation: riseIn 0.2s ease;
}

.pro-fields.show {
  display: grid;
}

.toast {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 11px 13px;
  font-size: 0.86rem;
  transform: translateY(12px);
  opacity: 0;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-side {
    padding: 24px 20px;
  }

  .pitch {
    margin-top: 22px;
  }

  .auth-main {
    padding-top: 0;
  }
}

@media (max-width: 580px) {
  .auth-card {
    padding: 18px;
  }

  .auth-head {
    flex-direction: column;
  }

  .row {
    flex-direction: column;
    align-items: flex-start;
  }
}
