:root {
  --font-page-title: 30px;
  --font-body: 15px;
  --font-control: 14px;
  --font-label: 13px;
  --font-meta: 12px;
  --canvas: #fafafa;
  --surface-soft: #f5f6f7;
  --border-strong: #cfd3d9;
  --accent-hover: #075bd6;
  --brand: #dd4124;
  --success: #0f8a68;
  --success-bg: #e9f7f2;
  --warning: #9a6100;
  --warning-bg: #fff5db;
  --error: #b42318;
  --error-bg: #fff0f0;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  min-height: 100%;
}
body {
  margin: 0;
  min-width: 320px;
  font-size: var(--font-body);
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(8, 103, 242, 0.24);
  outline-offset: 2px;
}

.prototype-bar {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 22px;
  align-items: center;
  height: 28px;
  color: #586373;
  background: #e9edf3;
  border-bottom: 1px solid #d6dce5;
  font-size: 12px;
}
.prototype-bar label {
  display: flex;
  gap: 7px;
  align-items: center;
}
.prototype-bar select {
  padding: 2px 25px 2px 7px;
  color: #354154;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #cfd6df;
  border-radius: 6px;
  font-size: var(--font-meta);
}

.auth-shell {
  position: relative;
  min-height: calc(100vh - 28px);
  background: var(--surface);
}
.auth-header {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  height: 80px;
  padding: 0 22px;
  pointer-events: none;
}
.auth-brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  pointer-events: auto;
}
.auth-brand img {
  width: 24px;
  height: 26px;
  object-fit: contain;
}
.auth-header nav {
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
}
.header-action {
  min-height: 36px;
  padding: 0 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  font-size: var(--font-control);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.header-action:hover {
  background: #f5f6f7;
}
.auth-language {
  position: relative;
}
.language-button {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: var(--font-control);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.language-button:hover,
.language-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.13);
}
.language-button > svg:first-child {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}
.language-button .language-chevron {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
  transition: transform 120ms ease;
}
.language-button[aria-expanded="true"] .language-chevron {
  transform: rotate(180deg);
}
.language-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: 154px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(32, 33, 36, 0.14);
}
.language-menu button {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: var(--font-control);
  text-align: left;
  cursor: pointer;
}
.language-menu button:hover,
.language-menu button:focus-visible {
  background: var(--surface-soft);
}
.language-menu i {
  color: var(--accent);
  font-style: normal;
  visibility: hidden;
}
.language-menu button[aria-checked="true"] i {
  visibility: visible;
}

.auth-main {
  display: grid;
  grid-template-columns: minmax(500px, 48%) minmax(520px, 52%);
  min-height: calc(100vh - 28px);
}
.auth-content {
  display: grid;
  min-width: 0;
  padding: 104px clamp(42px, 7vw, 116px) 64px;
  background: var(--surface);
  overflow: auto;
  place-items: center;
}
.auth-content-inner {
  width: min(430px, 100%);
}
.auth-view {
  animation: view-in 180ms ease-out;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.auth-eyebrow {
  margin: 0 0 13px;
  color: var(--text-faint);
  font-size: var(--font-meta);
  font-weight: 600;
}
.auth-view h1 {
  margin: 0;
  font-size: var(--font-page-title);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.auth-description {
  margin: 14px 0 30px;
  color: var(--text-soft);
  font-size: var(--font-control);
  line-height: 1.55;
}
.auth-description strong {
  color: var(--text);
  font-weight: 500;
}

.auth-form {
  display: grid;
  gap: 18px;
}
.field {
  display: grid;
  gap: 8px;
}
.field > span:first-child,
.field-heading {
  color: #36393d;
  font-size: var(--font-label);
  font-weight: 500;
}
.field-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.field-heading button,
.auth-switch button,
.signed-account button {
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-size: var(--font-meta);
  font-weight: 400;
  cursor: pointer;
}
.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}
.field input:hover {
  border-color: var(--border-strong);
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 103, 242, 0.12);
}
.field.has-error input {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.09);
}
.mfa-field-label {
  color: #36393d;
  font-size: var(--font-label);
  font-weight: 500;
}
.mfa-code-input:not([data-recovery]) {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
}
.mfa-recovery-note {
  margin: 24px 0 0;
  color: var(--text-soft);
  font-size: var(--font-label);
  line-height: 1.5;
}
.password-field {
  position: relative;
  display: block;
}
.password-field input {
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
}
.password-toggle:hover {
  background: var(--surface-soft);
}
.password-toggle svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
}
.password-toggle::after {
  position: absolute;
  width: 20px;
  height: 1.3px;
  background: currentColor;
  opacity: 0;
  content: "";
  transform: rotate(45deg);
  transition: opacity 120ms ease;
}
.password-toggle[aria-pressed="true"]::after {
  opacity: 1;
}
.field-help,
.field-error {
  min-height: 0;
  color: var(--text-faint);
  font-size: var(--font-meta);
  line-height: 1.35;
}
.field-error:empty {
  display: none;
}
.field-error {
  color: var(--error);
}
.primary-button,
.secondary-button,
.text-action {
  min-height: 44px;
  padding: 0 15px;
  border-radius: 8px;
  font-size: var(--font-control);
  font-weight: 500;
  cursor: pointer;
}
.primary-button {
  color: white;
  background: linear-gradient(180deg, #1680ff 0%, var(--accent) 100%);
  border: 1px solid var(--accent);
  box-shadow:
    0 1px 2px rgba(8, 103, 242, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.primary-button:hover {
  background: var(--accent-hover);
}
.secondary-button {
  color: #354154;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}
.secondary-button:hover {
  background: var(--surface-soft);
}
.text-action {
  color: var(--accent);
  background: transparent;
  border: 0;
}
.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.full-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.button-link {
  text-decoration: none;
}
.form-message {
  min-height: 17px;
  margin: -4px 0 0;
  color: var(--text-soft);
  font-size: var(--font-meta);
  line-height: 1.45;
}
.form-message.is-error {
  color: var(--error);
}
.form-message.is-success {
  color: var(--success);
}
.auth-switch {
  display: flex;
  justify-content: center;
  gap: 5px;
  align-items: center;
  margin: 24px 0 0;
  color: var(--text-soft);
  font-size: var(--font-label);
  text-align: center;
}
.auth-switch button {
  font-size: inherit;
}
.consent-field {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: start;
  margin: -2px 0 0;
  color: var(--text-soft);
  font-size: var(--font-meta);
  line-height: 1.55;
}
.consent-field input {
  display: grid;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
  place-content: center;
}
.consent-field input::before {
  width: 9px;
  height: 5px;
  border-bottom: 2px solid white;
  border-left: 2px solid white;
  content: "";
  transform: rotate(-45deg) scale(0);
  transition: transform 100ms ease;
}
.consent-field input:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.consent-field input:checked::before {
  transform: rotate(-45deg) scale(1);
}
.consent-field input:focus-visible {
  outline: 3px solid rgba(8, 103, 242, 0.24);
  outline-offset: 2px;
}
.consent-field.has-error input {
  border-color: var(--error);
}
.consent-field .field-error {
  grid-column: 2;
}
.consent-field a {
  color: var(--accent);
  text-decoration: none;
}

.auth-state {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 13px;
  margin-bottom: 18px;
  padding: 15px;
  color: #354154;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.auth-state.is-success {
  color: #17664f;
  background: var(--success-bg);
  border-color: #bce3d7;
}
.auth-state.is-warning {
  color: #75500a;
  background: var(--warning-bg);
  border-color: #ecd79f;
}
.auth-state .state-icon {
  display: grid;
  width: 32px;
  height: 32px;
  color: currentColor;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
  place-items: center;
}
.state-icon svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.auth-state strong {
  font-size: var(--font-label);
  font-weight: 600;
}
.auth-state p {
  margin: 4px 0 0;
  font-size: var(--font-meta);
  line-height: 1.45;
}
.auth-state + .secondary-button + .form-message {
  margin-top: 10px;
}

.invitation-summary {
  margin: 0 0 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.invitation-summary div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
}
.invitation-summary div:last-child {
  border-bottom: 0;
}
.invitation-summary dt,
.invitation-summary dd {
  margin: 0;
  font-size: var(--font-meta);
}
.invitation-summary dt {
  color: var(--text-soft);
}
.invitation-summary dd {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}
.invitation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.signed-account {
  margin: 18px 0 0;
  color: var(--text-soft);
  font-size: var(--font-meta);
  text-align: center;
}

.auth-visual {
  position: relative;
  min-width: 0;
  isolation: isolate;
  color: #fff;
  background:
    radial-gradient(ellipse at 100% 100%, #ee6333 0%, transparent 66%),
    linear-gradient(145deg, #c3371e 0%, var(--brand) 52%, #e64e27 100%);
  overflow: hidden;
}
.visual-copy {
  position: relative;
  z-index: 3;
  width: min(480px, calc(100% - 112px));
  margin: clamp(128px, 15vh, 170px) 0 0 clamp(40px, 5vw, 80px);
}
.visual-copy > p {
  margin: 0 0 20px;
  color: #fff3ed;
  font-size: var(--font-label);
  font-weight: 500;
}
.visual-copy h2 {
  max-width: 460px;
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 2.8vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}
.visual-copy span {
  display: block;
  max-width: 390px;
  margin-top: 20px;
  color: #fff3ed;
  font-size: var(--font-control);
  line-height: 1.65;
}
.signal-stage {
  position: absolute;
  z-index: 1;
  inset: 28% -9% -10% -9%;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 22%, #000 100%);
}
.signal-stage canvas,
.signal-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.signal-stage[data-ready] .signal-fallback {
  display: none;
}
.signal-fallback {
  color: #ffe8dc;
}
.motion-toggle {
  position: absolute;
  z-index: 4;
  right: 24px;
  bottom: 22px;
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  color: #fff;
  background: #bf361e;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  font-size: var(--font-meta);
  cursor: pointer;
}
.motion-toggle:hover {
  background: #a92d18;
}
.motion-toggle:focus-visible {
  outline: 2px solid white;
  outline-offset: 4px;
}
.motion-toggle svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

@media (max-width: 1100px) {
  .auth-main {
    grid-template-columns: minmax(0, 52%) minmax(0, 48%);
  }
  .auth-content {
    padding-inline: 48px;
  }
  .visual-copy {
    width: calc(100% - 64px);
    margin-left: 32px;
  }
  .visual-copy h2 {
    font-size: 32px;
  }
  .signal-stage {
    top: 35%;
  }
}

@media (max-width: 760px) {
  .prototype-bar {
    justify-content: space-between;
    padding: 0 12px;
  }
  .prototype-bar strong {
    display: none;
  }
  .prototype-bar label {
    width: 100%;
    justify-content: space-between;
  }
  .prototype-bar select {
    max-width: 230px;
  }
  .auth-shell {
    display: flex;
    min-height: calc(100dvh - 28px);
    flex-direction: column;
  }
  .auth-header {
    height: 58px;
    padding-inline: 14px;
  }
  .auth-brand img {
    width: 24px;
    height: 26px;
  }
  .auth-header nav {
    gap: 4px;
  }
  .header-action {
    min-height: 34px;
    padding-inline: 10px;
    color: #354154;
    background: var(--surface);
    border-color: var(--border-strong);
    font-size: var(--font-label);
  }
  .header-action:hover {
    background: var(--surface-soft);
  }
  .language-button {
    padding-inline: 8px;
    color: #354154;
    font-size: var(--font-label);
  }
  .language-button:hover,
  .language-button[aria-expanded="true"] {
    background: var(--surface-soft);
  }
  .auth-main {
    display: block;
    flex: 1;
  }
  .auth-content {
    display: block;
    padding: 98px 20px 52px;
    overflow: visible;
  }
  .auth-content-inner {
    width: min(430px, 100%);
    margin: 0 auto;
  }
  .auth-view h1 {
    font-size: var(--font-page-title);
  }
  .auth-description {
    margin-bottom: 26px;
  }
  .auth-visual {
    display: block;
    min-height: 520px;
    border-top: 1px solid rgba(255, 255, 255, 0.24);
    border-left: 0;
  }
  .visual-copy {
    width: auto;
    margin: 0;
    padding: 42px 24px 0;
  }
  .visual-copy h2 {
    max-width: 340px;
    font-size: 30px;
  }
  .visual-copy span {
    max-width: 335px;
  }
  .signal-stage {
    inset: 39% -18% -5%;
  }
  .motion-toggle {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 390px) {
  .auth-content {
    padding-inline: 16px;
  }
  .invitation-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
