:root {
  color-scheme: light;
  --ink: #091a13;
  --ink-soft: #173929;
  --paper: #f5f5ef;
  --white: #fffefa;
  --muted: #526159;
  --line: rgb(9 26 19 / 14%);
  --lime: #d7ff72;
  --lime-hover: #c8f45e;
  --blue: #e1e6ff;
  --green-soft: #e6f2df;
  --amber-soft: #f1ddbd;
  --danger: #a52a2a;
  --danger-soft: #fff0ee;
  --focus: #08683f;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100svh;
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgb(9 26 19 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(9 26 19 / 5%) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--ink);
  font-family:
    "Instrument Sans",
    "Instrument Sans Fallback",
    system-ui,
    -apple-system,
    sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.display {
  font-family: "Space Grotesk", "Space Grotesk Fallback", system-ui, sans-serif;
  letter-spacing: -0.045em;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 50%;
  display: flex;
  min-height: 44px;
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  padding: 0 16px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transform: translate(-50%, -140%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.auth-page {
  display: grid;
  min-height: 100svh;
  grid-template-rows: auto 1fr auto;
  padding: 18px;
}

.auth-header,
.auth-footer,
.auth-layout {
  width: min(100%, 1240px);
  margin-inline: auto;
}

.auth-header {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 254 250 / 92%);
  padding: 8px 10px 8px 18px;
  box-shadow: 0 12px 32px rgb(9 26 19 / 6%);
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 15px;
  height: 34px;
}

.brand span {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
}

.account-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.875rem;
}

.account-prompt a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  padding: 0 15px;
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(440px, 0.9fr) minmax(520px, 1.1fr);
  align-items: stretch;
  align-self: center;
  gap: 14px;
  padding-block: clamp(20px, 3vh, 32px);
}

.auth-shell {
  display: contents;
}

.panel-brand {
  display: none;
}

.auth-form-panel,
.workspace-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--white);
  padding: clamp(32px, 5vw, 62px);
  box-shadow: 0 32px 72px -54px rgb(9 26 19 / 44%);
}

.form-kicker,
.workspace-eyebrow {
  color: #1c6845;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-form-panel h1 {
  max-width: 10ch;
  margin: 18px 0 10px;
  font-size: clamp(2.55rem, 4.3vw, 4.3rem);
  font-weight: 600;
  line-height: 0.95;
}

.form-intro {
  max-width: 32rem;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.status-message {
  margin-bottom: 16px;
  border: 1px solid #a8c89f;
  border-radius: 12px;
  background: #eef7e9;
  padding: 12px 14px;
  color: #28543b;
  font-size: 0.85rem;
  line-height: 1.4;
}

.error-message {
  margin-bottom: 16px;
  border: 1px solid #e1aaa4;
  border-radius: 12px;
  background: var(--danger-soft);
  padding: 12px 14px;
  color: var(--danger);
  font-size: 0.85rem;
  line-height: 1.4;
}

.hidden {
  display: none !important;
}

.social-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.social-button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8f8f4;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
  white-space: nowrap;
}

.social-button:hover {
  border-color: rgb(9 26 19 / 30%);
  background: #f0f1eb;
  transform: translateY(-1px);
}

.social-button svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-block: 24px;
  color: #6b766f;
  font-size: 0.72rem;
}

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

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

.name-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

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

.field label {
  color: #2e4439;
  font-size: 0.82rem;
  font-weight: 650;
}

.field-heading a {
  color: #17623d;
  font-size: 0.76rem;
  font-weight: 600;
  text-underline-offset: 4px;
}

.field input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgb(9 26 19 / 20%);
  border-radius: 13px;
  outline: 0;
  background: #f8f8f4;
  padding: 0 14px;
  color: var(--ink);
  font-size: 0.92rem;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.field input::placeholder {
  color: #7c8881;
}

.field input:hover {
  border-color: rgb(9 26 19 / 34%);
}

.field input:focus {
  border-color: var(--focus);
  background: var(--white);
  box-shadow: 0 0 0 3px rgb(8 104 63 / 14%);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #f8f8f4 inset;
  box-shadow: 0 0 0 1000px #f8f8f4 inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}

.submit-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--ink-soft);
  border-radius: 14px;
  background: var(--lime);
  padding: 6px 7px 6px 18px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.submit-button span:last-child {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--ink-soft);
  color: var(--lime);
  font-size: 1.1rem;
  transition: transform 150ms ease;
}

.submit-button:hover {
  background: var(--lime-hover);
  box-shadow: 0 10px 22px rgb(9 26 19 / 10%);
  transform: translateY(-1px);
}

.submit-button:hover span:last-child {
  transform: translateX(2px);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.66;
  transform: none;
}

.dev-fill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  color: #77827c;
  font-size: 0.68rem;
}

.dev-fill button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 0 10px;
  color: #516159;
  cursor: pointer;
}

.auth-layout > .dev-fill {
  grid-column: 1;
  margin: -2px 12px 0;
}

.auth-layout > .dev-fill button {
  min-height: 28px;
  border: 0;
  border-radius: 0;
  padding: 0 3px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workspace-panel {
  position: relative;
  display: flex;
  min-height: 640px;
  flex-direction: column;
  overflow: hidden;
  background: var(--blue);
  padding: clamp(30px, 4.5vw, 58px);
}

.workspace-panel::before {
  position: absolute;
  top: 50px;
  right: 42px;
  width: 130px;
  height: 130px;
  border: 1px solid rgb(45 65 111 / 15%);
  border-radius: 50%;
  box-shadow:
    0 0 0 36px rgb(255 255 255 / 10%),
    0 0 0 74px rgb(45 65 111 / 5%);
  content: "";
}

.workspace-copy {
  position: relative;
  z-index: 1;
}

.color-system-preview {
  display: none;
}

.workspace-eyebrow {
  color: #3a4e78;
}

.workspace-copy h2 {
  max-width: 12ch;
  margin: 20px 0 18px;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 0.93;
}

.workspace-copy > p {
  max-width: 36rem;
  margin: 0;
  color: #4f5d78;
  font-size: 0.95rem;
  line-height: 1.6;
}

.workspace-board {
  position: relative;
  z-index: 1;
  display: grid;
  margin-top: auto;
  overflow: hidden;
  border: 1px solid rgb(9 26 19 / 18%);
  border-radius: 24px;
  background: #f8f8f4;
  box-shadow: 0 26px 54px -38px rgb(9 26 19 / 42%);
}

.workspace-topline {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  color: #617068;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-topline span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.workspace-topline i,
.scope-note i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgb(215 255 114 / 25%);
}

.workspace-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.workspace-flow span {
  position: relative;
  display: grid;
  min-height: 70px;
  place-items: center;
  color: #617068;
  font-size: 0.65rem;
  font-weight: 650;
}

.workspace-flow span + span {
  border-left: 1px solid var(--line);
}

.workspace-flow span:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  right: -10px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: #607067;
  content: "→";
}

.workspace-card {
  display: grid;
  grid-template-columns: 1fr minmax(180px, 0.72fr);
  gap: 12px;
  padding: 16px;
}

.message-summary,
.approval-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 15px;
}

.message-summary {
  background: var(--white);
}

.message-summary > span,
.approval-card > span {
  color: #496456;
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-summary h3 {
  margin: 13px 0 7px;
  font-size: 0.95rem;
  letter-spacing: -0.025em;
}

.message-summary p {
  margin: 0;
  color: #617068;
  font-size: 0.72rem;
  line-height: 1.45;
}

.message-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.message-tags b {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #edf0e8;
  padding: 5px 7px;
  color: #4a5d53;
  font-size: 0.55rem;
}

.approval-card {
  display: flex;
  flex-direction: column;
  background: var(--green-soft);
}

.approval-card strong {
  margin-top: 13px;
  font-size: 0.88rem;
}

.approval-card small {
  margin-top: 6px;
  color: #526159;
  font-size: 0.62rem;
  line-height: 1.4;
}

.approval-card b {
  margin-top: auto;
  border-radius: 10px;
  background: var(--ink-soft);
  padding: 10px 11px;
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 650;
}

.scope-note {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 18px 4px 0;
  color: #435572;
  font-size: 0.65rem;
}

.form-meta {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.form-meta .scope-note {
  margin: 0;
}

.form-signup-prompt {
  margin: 0;
  color: #617068;
  font-size: 0.74rem;
}

.form-signup-prompt a {
  margin-left: 4px;
  color: var(--ink);
  font-weight: 700;
  text-underline-offset: 4px;
}

.signup-note {
  margin: 10px 0 0;
  color: #617068;
  font-size: 0.7rem;
  line-height: 1.45;
  text-align: center;
}

.auth-footer {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #617068;
  font-size: 0.72rem;
}

.language-picker {
  display: flex;
  align-items: center;
  gap: 4px;
}

[data-lang-btn] {
  min-width: 32px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #68766e;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 650;
  text-underline-offset: 5px;
}

[data-lang-btn][aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.current-version {
  color: #6b766f;
}

.current-version a {
  font-weight: 650;
  text-underline-offset: 4px;
}

:where(a, button, input):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .auth-layout {
    grid-template-columns: minmax(360px, 0.95fr) minmax(390px, 1.05fr);
  }

  .auth-form-panel,
  .workspace-panel {
    border-radius: 26px;
  }

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

  .approval-card b {
    margin-top: 16px;
  }
}

@media (max-width: 820px) {
  body {
    background-size: 42px 42px;
  }

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

  .auth-form-panel {
    min-height: 650px;
  }

  .workspace-panel {
    min-height: 600px;
  }

  .auth-layout > .dev-fill {
    grid-column: 1;
  }
}

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

  .auth-header {
    min-height: 66px;
    padding-left: 16px;
  }

  .account-prompt > span {
    display: none;
  }

  .account-prompt a {
    min-height: 44px;
    padding-inline: 12px;
    font-size: 0.78rem;
  }

  .auth-layout {
    gap: 10px;
    padding-block: 10px;
  }

  .auth-form-panel,
  .workspace-panel {
    border-radius: 22px;
  }

  .auth-form-panel {
    min-height: 0;
    padding: 34px 22px;
  }

  .auth-form-panel h1 {
    font-size: clamp(2.7rem, 14vw, 3.6rem);
  }

  .social-actions {
    grid-template-columns: 1fr;
  }

  .name-fields {
    grid-template-columns: 1fr;
  }

  .workspace-panel {
    min-height: 540px;
    padding: 30px 20px;
  }

  .workspace-panel::before {
    right: 12px;
    width: 96px;
    height: 96px;
  }

  .workspace-copy h2 {
    font-size: clamp(2.65rem, 13vw, 3.6rem);
  }

  .workspace-card {
    padding: 10px;
  }

  .workspace-flow span {
    min-height: 60px;
    font-size: 0.58rem;
  }

  .auth-footer {
    min-height: 64px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding-block: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link,
  .social-button,
  .field input,
  .submit-button,
  .submit-button span:last-child {
    transition: none;
  }

  .social-button:hover,
  .submit-button:hover,
  .submit-button:hover span:last-child {
    transform: none;
  }
}
