:root {
  --primary: #0277fa;
  --primary-hover: #0167d8;
  --primary-soft: #e6f1ff;
  --text: #0f172a;
  --text-body: #344054;
  --text-muted: #667085;
  --text-subtle: #98a2b3;
  --border: #d0d5dd;
  --border-soft: #eaecf0;
  --surface: #ffffff;
  --surface-muted: #f2f4f7;
  --bg: #f9fafb;
  --danger: #d92d20;
  --radius-control: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --focus: 0 0 0 4px rgba(2, 119, 250, 0.16);
}

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

html, body { margin: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- Layout ---------- */
.page {
  display: grid;
  grid-template-columns: minmax(0, 720fr) minmax(0, 704fr);
  gap: 16px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
}

/* ---------- Brand panel ---------- */
.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-height: calc(100dvh - 32px);
  padding: 56px 40px 24px;
  border-radius: 24px;
  background: linear-gradient(180deg, #eaf4ff 0%, #d9ebff 100%);
  overflow: hidden;
}

.brand__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding-inline: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.logo__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: #fff;
}
.logo__text { display: flex; flex-direction: column; }
.logo__text strong { font-size: 14px; line-height: 20px; font-weight: 600; }
.logo__text span { font-size: 12px; line-height: 16px; color: #64748b; }

.brand__headline { display: flex; flex-direction: column; gap: 12px; }
.brand__headline h1 {
  font-size: 34px;
  line-height: 42px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand__headline p {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-body);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.chip svg { color: var(--primary); flex: none; }

.brand__illustration {
  width: 100%;
  max-width: 640px;
  height: auto;
  aspect-ratio: 640 / 427;
  object-fit: cover;
  align-self: center;
}

/* ---------- Auth column ---------- */
.auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 32px 16px 16px;
}

.card {
  width: 100%;
  max-width: 456px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  margin-top: auto;
}

.card__head { display: flex; flex-direction: column; gap: 8px; }
.card__head h2 { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -0.01em; }
.card__head p { font-size: 15px; line-height: 22px; color: var(--text-muted); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-muted);
}
.tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 41, 0.1);
}
.tab[aria-selected="true"] svg { color: var(--primary); }
.tab:focus-visible { outline: none; box-shadow: var(--focus); }

/* Form */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field[hidden] { display: none; }
.note a { color: var(--primary); font-weight: 600; text-decoration: none; }
.note a:hover { text-decoration: underline; }
.field label { font-size: 14px; font-weight: 500; color: var(--text-body); }

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.input__icon { flex: none; color: var(--text-subtle); }
.input input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  line-height: 20px;
  color: var(--text);
}
.input input::placeholder { color: var(--text-subtle); opacity: 1; }
.input__toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: -5px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.input__toggle:hover { color: var(--text); background: var(--surface-muted); }
.input__toggle:focus-visible { outline: none; box-shadow: var(--focus); }

.field.has-error .input { border-color: var(--danger); }
.field.has-error .input:focus-within { box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.14); }
.field__error { font-size: 13px; line-height: 18px; color: var(--danger); }
.field__error:empty { display: none; }

.form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-body);
  cursor: pointer;
  user-select: none;
}
.checkbox input { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 0; cursor: pointer; }
.checkbox__box {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: #fff;
  transition: background-color .15s ease, border-color .15s ease;
}
.checkbox__box svg { opacity: 0; }
.checkbox input:checked + .checkbox__box { background: var(--primary); border-color: var(--primary); }
.checkbox input:checked + .checkbox__box svg { opacity: 1; }
.checkbox input:focus-visible + .checkbox__box { box-shadow: var(--focus); }

.link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border-radius: 4px;
}
.link:hover { text-decoration: underline; }
.link:focus-visible { outline: none; box-shadow: var(--focus); }

/* Button */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  padding: 13px 16px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--primary-hover); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn[disabled] { cursor: progress; opacity: .85; }
.btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.is-loading .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Note */
.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-control);
  background: var(--primary-soft);
}
.note svg { flex: none; color: var(--primary); margin-top: 1px; }
.note p { font-size: 13px; line-height: 20px; color: var(--text-body); }

.footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-subtle);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .brand__headline h1 { font-size: 30px; line-height: 38px; }
  .br-lg { display: none; }
}

@media (max-width: 960px) {
  .page { grid-template-columns: 1fr; gap: 0; padding: 0; }
  .brand {
    min-height: 0;
    padding: 32px 24px 0;
    border-radius: 0 0 24px 24px;
    gap: 16px;
  }
  .brand__copy { padding-inline: 0; gap: 20px; max-width: 560px; }
  .brand__headline h1 { font-size: 26px; line-height: 34px; }
  .brand__headline p { font-size: 15px; line-height: 22px; }
  .brand__illustration { max-width: 420px; margin-bottom: -8px; }
  .auth { padding: 0 16px 24px; }
  .card { margin-top: -24px; position: relative; }
}

@media (max-width: 520px) {
  .brand { padding: 24px 16px 0; }
  .brand__illustration { display: none; }
  .brand { padding-bottom: 48px; }
  .card { padding: 24px 20px; gap: 20px; }
  .card__head h2 { font-size: 24px; line-height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0s !important; }
}
