:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #687386;
  --line: #dce2ea;
  --surface: #ffffff;
  --page: #f5f7fb;
  --blue: #1768e5;
  --blue-dark: #1257c2;
  --blue-soft: #eaf2ff;
  --danger: #d63c45;
  --danger-soft: #fff1f1;
  --shadow: 0 24px 70px rgba(26, 39, 63, 0.11), 0 2px 10px rgba(26, 39, 63, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

.ambient {
  position: fixed;
  z-index: 0;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(4px);
}

.ambient--top {
  top: -310px;
  left: -190px;
  background: radial-gradient(circle, rgba(105, 166, 255, 0.23), rgba(105, 166, 255, 0));
}

.ambient--bottom {
  right: -290px;
  bottom: -320px;
  background: radial-gradient(circle, rgba(147, 117, 255, 0.18), rgba(147, 117, 255, 0));
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(470px, 0.92fr);
  width: 100%;
  min-height: 100vh;
}

.brand-side {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 720px;
  overflow: hidden;
  padding: clamp(40px, 5vw, 72px) clamp(44px, 7vw, 112px);
  background:
    radial-gradient(circle at 80% 8%, rgba(255, 255, 255, 0.13), transparent 26%),
    linear-gradient(145deg, #0d56c7 0%, #164bc2 48%, #233fa8 100%);
  color: #fff;
}

.brand-side::after {
  position: absolute;
  right: -190px;
  bottom: -210px;
  width: 540px;
  height: 540px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 84px rgba(255, 255, 255, 0.028), 0 0 0 170px rgba(255, 255, 255, 0.022);
}

.brand {
  position: relative;
  z-index: 2;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.35px;
  text-decoration: none;
}

.brand b,
.mobile-brand b {
  font-weight: 720;
}

.brand__mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.brand__mark svg {
  width: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-copy {
  position: relative;
  z-index: 2;
  max-width: 610px;
  margin-top: clamp(72px, 10vh, 128px);
}

.eyebrow {
  margin: 0 0 17px;
  color: #6a93ff;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.brand-copy .eyebrow {
  color: rgba(255, 255, 255, 0.7);
}

.brand-copy h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(42px, 4.4vw, 68px);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.brand-copy__text {
  max-width: 510px;
  margin: 27px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 17px;
  line-height: 1.7;
}

.workspace-preview {
  position: relative;
  z-index: 2;
  width: 440px;
  height: 190px;
  margin-top: 46px;
}

.preview-card {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 42px rgba(10, 38, 101, 0.18);
  backdrop-filter: blur(18px);
}

.preview-card--main {
  inset: 0 70px 0 0;
  padding: 24px;
  border-radius: 24px;
}

.preview-card--small {
  right: 0;
  bottom: 24px;
  display: grid;
  grid-template-columns: 44px 72px;
  gap: 12px;
  align-items: center;
  width: 156px;
  height: 76px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 45px rgba(8, 36, 100, 0.28);
}

.preview-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mini-logo {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.16);
}

.mini-logo svg {
  width: 24px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
}

.preview-dots {
  color: rgba(255, 255, 255, 0.56);
  font-size: 16px;
  letter-spacing: 2px;
}

.preview-line {
  width: 74%;
  height: 7px;
  margin-top: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.13);
}

.preview-line--strong {
  width: 55%;
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.34);
}

.preview-files {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.preview-file {
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.preview-file--blue::before,
.preview-file--green::before,
.preview-file--violet::before {
  display: block;
  width: 17px;
  height: 17px;
  margin: 10px;
  border-radius: 5px;
  content: "";
}

.preview-file--blue::before { background: #7db2ff; }
.preview-file--green::before { background: #64d5b0; }
.preview-file--violet::before { background: #a9a0ff; }

.file-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  background: #eaf2ff;
}

.file-icon svg {
  width: 23px;
  fill: none;
  stroke: #1768e5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.preview-card--small .preview-line {
  height: 5px;
  margin-top: 8px;
  background: #dce3ec;
}

.preview-card--small .preview-line--strong {
  width: 69px;
  margin-top: 0;
  background: #8f9bad;
}

.preview-card--small .preview-line--short {
  width: 48px;
}

.security-note {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: auto 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.security-note svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.auth-side {
  display: grid;
  min-height: 720px;
  padding: 64px clamp(32px, 6vw, 96px);
  place-items: center;
}

.auth-card {
  width: min(100%, 440px);
}

.mobile-brand {
  display: none;
}

.auth-card__header {
  margin-bottom: 36px;
}

.auth-card__header h2 {
  margin: 0;
  font-size: 35px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.auth-card__header > p:last-child {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.field {
  margin-bottom: 19px;
}

.field label,
.label-row label {
  display: block;
  margin: 0 0 9px;
  color: #2a3443;
  font-size: 13px;
  font-weight: 650;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.caps-hint {
  display: none;
  margin: 0 0 9px;
  color: #9a6500;
  font-size: 11px;
  font-weight: 600;
}

.caps-hint.is-visible {
  display: inline;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap > svg {
  position: absolute;
  left: 16px;
  width: 19px;
  fill: none;
  stroke: #8b96a8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 53px;
  padding: 0 48px 0 46px;
  outline: none;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-wrap input::placeholder {
  color: #a0a9b7;
}

.input-wrap input:hover {
  border-color: #c3ccd8;
}

.input-wrap input:focus {
  border-color: #4c8bef;
  box-shadow: 0 0 0 4px rgba(23, 104, 229, 0.1);
}

.field.is-invalid .input-wrap input {
  border-color: #e17077;
  background: #fffafa;
  box-shadow: 0 0 0 4px rgba(214, 60, 69, 0.08);
}

.field-error {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.field-error:not(:empty) {
  margin-top: 7px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  cursor: pointer;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8792a4;
}

.password-toggle:hover {
  background: #f2f5f8;
  color: #556174;
}

.password-toggle:focus-visible {
  outline: 2px solid #4c8bef;
  outline-offset: 1px;
}

.password-toggle svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.remember {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  gap: 10px;
  color: #596579;
  font-size: 13px;
  user-select: none;
}

.remember input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.checkbox-ui {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border: 1px solid #c8d0dc;
  border-radius: 5px;
  background: #fff;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.checkbox-ui svg {
  width: 11px;
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  opacity: 0;
}

.remember input:checked + .checkbox-ui {
  border-color: var(--blue);
  background: var(--blue);
}

.remember input:checked + .checkbox-ui svg {
  opacity: 1;
}

.remember input:focus-visible + .checkbox-ui {
  box-shadow: 0 0 0 4px rgba(23, 104, 229, 0.12);
}

.form-alert {
  display: none;
  grid-template-columns: 30px 1fr;
  gap: 11px;
  align-items: start;
  margin-top: 20px;
  padding: 13px 14px;
  border: 1px solid #f0c9cb;
  border-radius: 12px;
  background: var(--danger-soft);
  animation: alert-in 220ms ease both;
}

.form-alert.is-visible {
  display: grid;
}

.form-alert__icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #f9d7d9;
  color: #c9343d;
  font-size: 14px;
  font-weight: 800;
}

.form-alert strong {
  display: block;
  color: #a92931;
  font-size: 13px;
  line-height: 1.4;
}

.form-alert p {
  margin: 2px 0 0;
  color: #9b4c50;
  font-size: 12px;
  line-height: 1.45;
}

.submit-button {
  display: grid;
  width: 100%;
  height: 53px;
  margin-top: 24px;
  cursor: pointer;
  place-items: center;
  border: 0;
  border-radius: 13px;
  background: var(--blue);
  box-shadow: 0 9px 20px rgba(23, 104, 229, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.submit-button:hover {
  background: var(--blue-dark);
  box-shadow: 0 11px 25px rgba(23, 104, 229, 0.26);
  transform: translateY(-1px);
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button:focus-visible {
  outline: 3px solid rgba(23, 104, 229, 0.25);
  outline-offset: 3px;
}

.submit-button:disabled {
  cursor: wait;
  background: #6e9ee9;
  box-shadow: none;
  transform: none;
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 650ms linear infinite;
}

.submit-button.is-loading .submit-button__label {
  display: none;
}

.submit-button.is-loading .spinner {
  display: block;
}

.auth-card__footer {
  margin: 27px 0 0;
  color: #8a94a4;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
  .page-shell {
    grid-template-columns: minmax(370px, 0.9fr) minmax(430px, 1.1fr);
  }

  .brand-side {
    padding-right: 48px;
    padding-left: 48px;
  }

  .workspace-preview {
    width: 380px;
    transform: scale(0.92);
    transform-origin: left center;
  }
}

@media (max-width: 820px) {
  .page-shell {
    display: block;
  }

  .brand-side {
    display: none;
  }

  .auth-side {
    min-height: 100vh;
    padding: 48px 24px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 58px;
    color: #1a2b46;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.35px;
  }

  .mobile-brand .brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--blue);
    box-shadow: 0 8px 20px rgba(23, 104, 229, 0.21);
    color: #fff;
  }
}

@media (max-width: 520px) {
  body {
    background: #fff;
  }

  .ambient {
    display: none;
  }

  .auth-side {
    align-items: start;
    padding: 31px 20px 40px;
  }

  .mobile-brand {
    margin-bottom: 54px;
  }

  .auth-card__header {
    margin-bottom: 31px;
  }

  .auth-card__header h2 {
    font-size: 31px;
  }

  .input-wrap input,
  .submit-button {
    height: 52px;
  }
}

@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;
  }
}
