:root {
  color-scheme: dark;
  --canvas: #121116;
  --panel: #1b1a21;
  --panel-soft: #222029;
  --line: #34313d;
  --text: #f7f4fb;
  --muted: #aaa4b3;
  --accent: #a88bf2;
  --accent-strong: #8c6fe0;
  --accent-wash: #a88bf21c;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--canvas);
  color: var(--text);
}

button,
input {
  font: inherit;
}

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

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(480px, 1.08fr);
}

.login-story {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  padding: 42px clamp(36px, 5vw, 76px);
  border-right: 1px solid var(--line);
  background: linear-gradient(155deg, #24202d 0%, #17151c 58%, #121116 100%), var(--canvas);
}

.login-story::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(#ffffff0d 1px, transparent 1px), linear-gradient(90deg, #ffffff0d 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom right, #000, transparent 72%);
}

.ambient {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(12px);
  pointer-events: none;
}

.ambient-one {
  width: 390px;
  height: 390px;
  top: 12%;
  right: -180px;
  background: radial-gradient(circle, #9f7bea4f, #9f7bea00 68%);
}

.ambient-two {
  width: 300px;
  height: 300px;
  bottom: -100px;
  left: -90px;
  background: radial-gradient(circle, #e4a7c72e, #e4a7c700 70%);
}

.login-brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 720;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.login-brand small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.brand-mark,
.secure-mark {
  display: grid;
  place-items: center;
  border: 1px solid #ffffff17;
  background: #ffffff09;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.brand-mark svg,
.secure-mark svg {
  width: 20px;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.story-copy {
  max-width: 560px;
  margin: auto 0;
  padding: 90px 0;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.story-copy h1 {
  max-width: 520px;
  margin: 0;
  font-size: clamp(42px, 5.2vw, 72px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.story-copy > p:not(.eyebrow) {
  max-width: 520px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.workspace-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}

.workspace-tags span {
  padding: 8px 12px;
  border: 1px solid #ffffff13;
  border-radius: 999px;
  background: #ffffff08;
  color: #d6d0dd;
  font-size: 12px;
}

.story-foot {
  margin: 0;
  color: #77727e;
  font-size: 12px;
}

.login-panel {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 100vh;
  padding: 48px clamp(28px, 7vw, 110px);
  background: radial-gradient(circle at 70% 15%, #8f6fe018, transparent 26%), var(--canvas);
}

.login-card,
.security-note {
  width: min(100%, 460px);
}

.login-card {
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 32px 90px #0000003d;
}

.login-card header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.secure-mark {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-wash);
}

.login-card header .eyebrow {
  margin-bottom: 5px;
}

.login-card h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.login-intro {
  margin: 22px 0 30px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

#login-form {
  display: grid;
  gap: 10px;
}

#login-form label {
  margin-top: 8px;
  color: #d5d0dc;
  font-size: 13px;
  font-weight: 600;
}

#login-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: 0;
  background: var(--panel-soft);
  color: var(--text);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

#login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 70px !important;
}

.password-field button {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 7px 9px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.password-field button:hover,
.password-field button:focus-visible {
  background: #ffffff0a;
  color: var(--text);
}

.submit-button {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  border: 0;
  border-radius: 11px;
  background: var(--accent-strong);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 12px 30px #6e4bc538;
  transition:
    transform 0.15s,
    background 0.15s;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #9879e8;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.submit-button svg {
  width: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-message {
  min-height: 20px;
  margin: 4px 0 0;
  color: #f0a9b9;
  font-size: 13px;
  line-height: 1.5;
}

.security-note {
  margin: 18px 0 0;
  color: #77727e;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --canvas: #f7f6f9;
    --panel: #ffffff;
    --panel-soft: #f5f3f8;
    --line: #e7e3eb;
    --text: #242128;
    --muted: #746e7b;
    --accent: #7958ca;
    --accent-strong: #7655d2;
    --accent-wash: #7655d218;
  }

  .login-story {
    background: linear-gradient(155deg, #eee9f6 0%, #f8f5fa 58%, #f4f2f6 100%);
  }

  .login-story::before {
    opacity: 0.45;
    background-image:
      linear-gradient(#513c6e0c 1px, transparent 1px), linear-gradient(90deg, #513c6e0c 1px, transparent 1px);
  }

  .brand-mark,
  .secure-mark,
  .workspace-tags span {
    border-color: #4a355314;
  }

  .workspace-tags span,
  #login-form label {
    color: #574f5e;
  }

  .login-card {
    box-shadow: 0 32px 90px #4b365415;
  }
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: auto;
    padding: 26px 24px 36px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .story-copy {
    padding: 64px 0 28px;
  }

  .story-copy h1 {
    max-width: 620px;
    font-size: clamp(38px, 11vw, 58px);
  }

  .story-copy > p:not(.eyebrow) {
    font-size: 14px;
  }

  .story-foot {
    display: none;
  }

  .login-panel {
    min-height: auto;
    padding: 42px 20px 52px;
  }
}

@media (max-width: 480px) {
  .workspace-tags {
    display: none;
  }

  .login-card {
    padding: 25px 20px;
    border-radius: 17px;
  }

  .login-card h2 {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
