:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --text: #1f2a37;
  --muted: #667085;
  --border: #d7e0ea;
  --brand: #4a76a8;
  --brand-dark: #315982;
  --accent: #2f9b8f;
  --danger: #c95d4c;
  --success: #3f8f68;
  --shadow: 0 20px 60px rgba(31, 42, 55, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Arial, "Helvetica Neue", sans-serif;
  background:
    linear-gradient(90deg, rgba(74, 118, 168, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(74, 118, 168, 0.07) 1px, transparent 1px),
    var(--bg);
  background-size: 38px 38px;
}

button,
input {
  font: inherit;
}

a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1fr);
  overflow: hidden;
  border: 1px solid rgba(215, 224, 234, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-height: 620px;
  padding: 34px;
  background: #233142;
  color: #fff;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 900;
}

.brand-lockup strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.brand-lockup span,
.auth-side p,
.auth-note {
  color: rgba(255, 255, 255, 0.72);
}

.auth-side h1 {
  margin: 0 0 14px;
  max-width: 360px;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-side p {
  max-width: 360px;
  margin: 0;
  line-height: 1.65;
}

.auth-preview {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.preview-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.preview-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #dfe8f2;
}

.preview-row:nth-child(2) .preview-thumb {
  background: #cfe8e4;
}

.preview-row:nth-child(3) .preview-thumb {
  background: #f1d6cf;
}

.preview-row strong {
  display: block;
  font-size: 14px;
}

.preview-row span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
}

.preview-badge {
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.auth-card {
  display: grid;
  align-content: center;
  gap: 22px;
  padding: 42px;
}

.auth-card__header {
  display: grid;
  gap: 8px;
}

.auth-card h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(74, 118, 168, 0.15);
}

.field small {
  color: var(--muted);
  line-height: 1.45;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 104px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 800;
}

.password-toggle:hover {
  background: #e9f0f8;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.primary-action {
  border: 0;
  background: var(--brand);
  color: #fff;
}

.primary-action:hover {
  background: var(--brand-dark);
}

.secondary-action {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand-dark);
}

.secondary-action:hover {
  background: var(--panel-soft);
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.message {
  display: none;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  line-height: 1.45;
}

.message.is-visible {
  display: block;
}

.message--success {
  border-color: rgba(63, 143, 104, 0.32);
  background: rgba(63, 143, 104, 0.1);
  color: #245f43;
}

.message--error {
  border-color: rgba(201, 93, 76, 0.35);
  background: rgba(201, 93, 76, 0.1);
  color: #923b2f;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

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

.auth-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}

.auth-footer p {
  margin: 0;
}

.forgot-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.forgot-box h3 {
  margin: 0;
  font-size: 16px;
}

.forgot-box .field input {
  background: #fff;
}

.legal-options {
  display: grid;
  gap: 9px;
}

.legal-options .consent-check {
  margin: 0;
}

@media (max-width: 820px) {
  .auth-page {
    padding: 18px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-side {
    min-height: auto;
    padding: 24px;
  }

  .auth-preview {
    display: none;
  }

  .auth-card {
    padding: 28px 22px;
  }
}

@media (max-width: 460px) {
  .auth-page {
    padding: 0;
  }

  .auth-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .auth-side,
  .auth-card {
    padding: 22px 16px;
  }

  .password-field input {
    padding-right: 90px;
  }

  .password-toggle {
    padding: 0 10px;
  }
}
