:root {
  --bg: #f3f8f6;
  --surface: #ffffff;
  --ink: #1f3433;
  --muted: #647d7a;
  --line: #d3e1de;
  --line-strong: #bdd3cf;
  --accent: #168672;
  --accent-dark: #145b52;
  --accent-soft: #e8f4f1;
  --error: #a63a4b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fbfefd 0%, var(--bg) 100%);
}

.auth-shell {
  width: min(1240px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 36px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--accent-dark);
  box-shadow: 0 14px 30px rgba(20, 91, 82, 0.16);
}

.brand-symbol {
  position: relative;
  display: block;
  width: 20px;
  height: 26px;
  border: 4px solid #fff;
  border-right-width: 6px;
  border-radius: 2px 13px 13px 2px;
}

.brand-symbol::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 8px;
  width: 14px;
  height: 7px;
  border: 4px solid #fff;
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: var(--accent-dark);
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-text strong {
  font-size: 1.32rem;
  line-height: 1;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.plain-link,
.text-button,
.login-help a {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.plain-link:hover,
.text-button:hover,
.login-help a:hover {
  text-decoration: underline;
}

.select-field {
  min-width: 118px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 11px 14px;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(410px, 0.82fr) minmax(460px, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 22px 56px rgba(23, 63, 60, 0.1);
  overflow: hidden;
}

.auth-panel {
  padding: clamp(34px, 5vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.workspace-context {
  padding: clamp(32px, 5vw, 58px);
  color: #f4fbfa;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.06), transparent 32%),
    linear-gradient(180deg, #1b685f 0%, #143f42 100%);
}

.workspace-context .eyebrow {
  color: rgba(244, 251, 250, 0.72);
}

.workspace-context h2,
.auth-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.auth-panel h3 {
  margin-top: 8px;
  font-size: clamp(2rem, 3vw, 2.55rem);
  line-height: 1.05;
}

.workspace-context h2 {
  max-width: 16ch;
  margin-top: 14px;
  font-size: clamp(2.1rem, 3.2vw, 3.25rem);
  line-height: 1.03;
}

.context-copy,
.form-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1.02rem;
}

.context-copy {
  color: rgba(244, 251, 250, 0.78);
  max-width: 46ch;
}

.mode-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  margin-bottom: 20px;
}

.toggle {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--accent-dark);
  cursor: pointer;
}

.toggle.is-active {
  background: #fff;
  box-shadow: 0 10px 22px rgba(21, 69, 65, 0.08);
}

.form {
  margin-top: 8px;
  width: 100%;
  max-width: 520px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.form-head {
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grid.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-label {
  font-size: 0.94rem;
  font-weight: 750;
}

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

input {
  width: 100%;
  min-height: 54px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 14px 16px;
  color: var(--ink);
  font: inherit;
  box-shadow: 0 1px 0 rgba(28, 58, 55, 0.02);
}

input:focus,
.select-field:focus,
.button:focus-visible,
.text-button:focus-visible,
.plain-link:focus-visible {
  outline: 3px solid rgba(22, 134, 114, 0.22);
  outline-offset: 2px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.button {
  border: 0;
  border-radius: 13px;
  min-height: 54px;
  padding: 15px 20px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 18px 34px rgba(20, 91, 82, 0.2);
}

.button-primary:hover {
  filter: brightness(0.98);
}

.login-help {
  margin: 4px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7fbfa;
  color: var(--muted);
  font-size: 0.94rem;
}

.login-help span {
  display: block;
  color: var(--ink);
  font-weight: 750;
  margin-bottom: 2px;
}

.product-preview {
  margin: 34px 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.preview-head,
.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
}

.preview-head {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.preview-head span,
.preview-row span {
  color: rgba(244, 251, 250, 0.7);
}

.preview-head strong {
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
}

.preview-row {
  margin-top: 10px;
}

.preview-row strong {
  font-variant-numeric: tabular-nums;
}

.preview-bar {
  height: 8px;
  margin-top: 20px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.16);
}

.preview-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #b9eadf;
}

.intro-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.intro-points li {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 12px;
  align-items: start;
  color: rgba(244, 251, 250, 0.86);
  line-height: 1.38;
  font-weight: 650;
}

.point-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: #b9eadf;
  box-shadow: 0 0 0 5px rgba(185, 234, 223, 0.12);
}

.notice {
  border: 1px solid #c6e2dc;
  background: #eef8f5;
  color: var(--accent-dark);
  border-radius: 16px;
  padding: 13px 15px;
  margin-bottom: 16px;
  line-height: 1.45;
}

.notice.info {
  background: #eef8f5;
  border-color: var(--line);
  color: var(--accent-dark);
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #1e4d4b;
  color: #fff;
  box-shadow: 0 18px 36px rgba(18, 45, 43, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--error);
}

@media (max-width: 980px) {
  .auth-shell {
    padding: 24px;
    gap: 24px;
  }

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

  .workspace-context {
    order: 2;
  }

  .workspace-context h2 {
    max-width: 18ch;
  }
}

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

  .auth-topbar {
    align-items: flex-start;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand-symbol {
    transform: scale(0.82);
  }

  .brand-text strong {
    font-size: 1.12rem;
  }

  .topbar-actions {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 8px;
  }

  .plain-link {
    font-size: 0.9rem;
  }

  .select-field {
    min-width: 92px;
    padding: 9px 12px;
  }

  .auth-panel,
  .workspace-context {
    padding: 24px;
  }

  .workspace-context {
    display: none;
  }

  .auth-panel h3 {
    font-size: 2rem;
  }

  .field-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .grid.two-up {
    grid-template-columns: 1fr;
  }
}
