:root {
  --background: #f8fafc;
  --surface: #ffffff;
  --text: #111827;
  --muted: #667085;
  --border: #dfe4ea;
  --primary: #111827;
  --secondary: #2563eb;
  --accent: #06b6d4;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--background); }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

button,
input { font: inherit; }

a { color: inherit; text-decoration: none; }

.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(340px, 42%) minmax(0, 1fr);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: clamp(32px, 5vw, 72px);
  overflow: hidden;
  background: #111827;
  color: #ffffff;
  flex-direction: column;
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
}

.brand-logo {
  display: block;
  width: 142px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center;
}

.brand-mark {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #ffffff;
}

.brand-mark svg { width: 21px; height: 21px; }

.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 16px; font-weight: 700; }
.brand em { margin-top: 4px; color: #aeb7c5; font-size: 10px; font-style: normal; font-weight: 500; }

.brand-message {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: auto 0;
}

.brand-kicker {
  display: block;
  margin-bottom: 18px;
  color: #67e8f9;
  font-size: 11px;
  font-weight: 700;
}

.brand-message h2 {
  max-width: 450px;
  margin: 0;
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 600;
  line-height: 1.18;
}

.brand-message p {
  max-width: 410px;
  margin: 20px 0 0;
  color: #aeb7c5;
  font-size: 14px;
  line-height: 1.8;
}

.brand-foot {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #7f8a9b;
  font-size: 11px;
}

.auth-workspace {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100vh;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(64px, 9vh, 96px) clamp(28px, 7vw, 100px) 48px;
  background: var(--surface);
}

.auth-theme-toggle {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 3;
  display: inline-flex;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.auth-theme-toggle:hover { border-color: #b9c2ce; color: var(--text); }
.auth-theme-toggle svg { width: 18px; height: 18px; }
.auth-theme-toggle .theme-label { display: none; }

.mobile-brand { display: none; }

.auth-panel {
  width: min(100%, 440px);
}

.auth-header { margin-bottom: 30px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--secondary);
  font-size: 10px;
  font-weight: 700;
}

h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.25;
}

.auth-header > p:last-child {
  max-width: 420px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-form { display: grid; gap: 19px; }
.field-group { display: grid; gap: 8px; }

.field-group > label,
.label-row label {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.label-row a {
  color: var(--secondary);
  font-size: 11px;
  font-weight: 600;
}

.label-row a:hover,
.secondary-action:hover { color: #1d4ed8; }

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

.input-wrap > svg {
  position: absolute;
  left: 14px;
  z-index: 1;
  width: 17px;
  height: 17px;
  color: #98a2b3;
  pointer-events: none;
}

input {
  width: 100%;
  height: 50px;
  padding: 0 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input::placeholder { color: #98a2b3; }

input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.11);
}

.password-toggle {
  position: absolute;
  right: 7px;
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #667085;
  cursor: pointer;
}

.password-toggle:hover { background: #f2f4f7; color: var(--text); }
.password-toggle svg { width: 17px; height: 17px; }

.field-note {
  margin: -1px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.primary,
.secondary-action {
  display: inline-flex;
  width: 100%;
  height: 50px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  gap: 9px;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.primary {
  margin-top: 5px;
  padding: 0 18px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
}

.primary:hover { background: #1f2937; }
.primary:active,
.secondary-action:active { transform: translateY(1px); }
.primary svg,
.secondary-action svg { width: 17px; height: 17px; }

.secondary-action {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.secondary-action:hover { border-color: #b9c2ce; background: #f8fafc; }

.auth-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 25px 0 18px;
  color: var(--muted);
  font-size: 10px;
}

.auth-divider::before {
  position: absolute;
  width: 100%;
  border-top: 1px solid var(--border);
  content: "";
}

.auth-divider span { position: relative; padding: 0 12px; background: #ffffff; }

.alert {
  display: flex;
  align-items: flex-start;
  margin: -8px 0 22px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.55;
  gap: 9px;
}

.alert svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.alert.error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.alert.success { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }

.support-note {
  display: flex;
  margin-bottom: 22px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  gap: 12px;
}

.note-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #e8efff;
  color: var(--secondary);
  flex: 0 0 34px;
}

.note-icon svg { width: 17px; height: 17px; }
.support-note strong { display: block; font-size: 12px; font-weight: 600; }
.support-note p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37,99,235,.16);
}

@media (max-width: 820px) {
  .auth-page { display: block; min-height: 100vh; background: #ffffff; }
  .auth-brand-panel { display: none; }
  .auth-workspace {
    display: block;
    min-height: 100vh;
    padding: 28px clamp(20px, 6vw, 48px) 40px;
  }
  .auth-theme-toggle { top: 28px; right: clamp(20px, 6vw, 48px); }
  .mobile-brand { display: block; margin-bottom: 52px; }
  .mobile-brand .brand-mark { border-color: #dfe4ea; background: #f8fafc; color: var(--text); }
  .mobile-brand .brand em { color: var(--muted); }
  .auth-panel { margin: 0 auto; }
}

@media (max-width: 480px) {
  .auth-workspace { padding: 24px 20px 32px; }
  .auth-theme-toggle { top: 28px; right: 20px; }
  .mobile-brand { margin-bottom: 42px; }
  .brand-mark { width: 36px; height: 36px; }
  .auth-header { margin-bottom: 25px; }
  h1 { font-size: 26px; }
  .auth-form { gap: 17px; }
  input,
  .primary,
  .secondary-action { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
