:root {
  color-scheme: light;
  --ink: #17202f;
  --muted: #687386;
  --line: #dce2ea;
  --paper: #ffffff;
  --canvas: #f4f6fa;
  --brand: #4438ca;
  --brand-dark: #3025a8;
  --accent: #d5006c;
  --focus: #67a9ff;
  --note: #fafbfe;
  --error-bg: #fff3f6;
  --error-border: #f0b9c9;
  --error-text: #8e173c;
  --button-bg: #4438ca;
  --button-hover: #3025a8;
  --button-border: transparent;
  --button-text: #ffffff;
  --button-shadow: rgba(68, 56, 202, 0.18);
  --button-shadow-hover: rgba(68, 56, 202, 0.24);
}

html.dark {
  color-scheme: dark;
  --ink: #f4f4f3;
  --muted: #aaa9a4;
  --line: #3a3a3a;
  --paper: #171717;
  --canvas: #101010;
  --brand: #d6d3d1;
  --brand-dark: #a8a29e;
  --accent: #e7a8c5;
  --focus: #d6d3d1;
  --note: #1d1d1d;
  --error-bg: rgba(127, 29, 29, .3);
  --error-border: #991b1b;
  --error-text: #fecaca;
  --button-bg: #252525;
  --button-hover: #303030;
  --button-border: #505050;
  --button-text: #f4f4f3;
  --button-shadow: rgba(0, 0, 0, 0.28);
  --button-shadow-hover: rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

.login-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(29rem, 43%) 1fr;
  background: var(--paper);
}

.login-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(2rem, 4.5vw, 4.75rem);
  background: var(--paper);
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

.login-brand-mark {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, var(--brand), #695cf0);
  box-shadow: 0 10px 24px rgba(68, 56, 202, 0.24);
}

.login-brand-mark svg {
  width: 1.55rem;
  height: 1.55rem;
}

.login-brand-name {
  font-size: 1.22rem;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.login-brand-name span {
  color: var(--accent);
}

.login-content {
  width: min(100%, 27rem);
  margin: auto 0;
  padding: clamp(3.5rem, 10vh, 7rem) 0;
}

.login-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.login-title {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(2.25rem, 4vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: -0.052em;
}

.login-intro {
  max-width: 37rem;
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.login-form {
  margin-top: 2.25rem;
}

.microsoft-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 3.4rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--button-border);
  border-radius: 0.7rem;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 720;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 10px 22px var(--button-shadow);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.microsoft-button:hover {
  transform: translateY(-1px);
  background: var(--button-hover);
  box-shadow: 0 14px 28px var(--button-shadow-hover);
}

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

.microsoft-button:focus-visible,
.login-brand:focus-visible,
.login-help a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.microsoft-mark {
  display: grid;
  grid-template-columns: repeat(2, 0.55rem);
  grid-template-rows: repeat(2, 0.55rem);
  gap: 2px;
  padding: 0.23rem;
  border-radius: 0.2rem;
  background: #fff;
}

.microsoft-mark i:nth-child(1) { background: #f35325; }
.microsoft-mark i:nth-child(2) { background: #81bc06; }
.microsoft-mark i:nth-child(3) { background: #05a6f0; }
.microsoft-mark i:nth-child(4) { background: #ffba08; }

.login-access-note {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.15rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--note);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.login-access-note svg {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.08rem;
  color: var(--brand);
}

.login-error {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--error-border);
  border-radius: 0.7rem;
  background: var(--error-bg);
  color: var(--error-text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.login-help {
  margin: 1.45rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.login-help a {
  color: var(--brand);
  font-weight: 650;
  text-underline-offset: 0.18em;
}

.login-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.login-footer .dot {
  color: #bcc3ce;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #1f1b55;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(23, 18, 72, 0.08), rgba(23, 18, 72, 0.72)),
    linear-gradient(100deg, rgba(24, 19, 73, 0.25), transparent 58%);
}

.login-visual::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: -10%;
  left: -11rem;
  width: 18rem;
  height: 120%;
  border-radius: 50%;
  background: var(--paper);
}

.login-visual img {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100svh;
  object-fit: cover;
  object-position: 56% center;
  filter: saturate(0.88) contrast(1.03);
}

.visual-copy {
  position: absolute;
  z-index: 3;
  right: clamp(2rem, 5vw, 5rem);
  bottom: clamp(2.5rem, 7vh, 5.5rem);
  width: min(31rem, calc(100% - 9rem));
  color: #fff;
}

.visual-kicker {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.visual-kicker span {
  width: 2rem;
  height: 2px;
  background: #f5a5c9;
}

.visual-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 3.3vw, 3.65rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.visual-copy p {
  max-width: 38rem;
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (min-width: 901px) {
  .login-shell {
    height: 100vh;
    height: 100svh;
    overflow: hidden;
  }

  .login-panel {
    height: 100vh;
    height: 100svh;
    overflow-y: auto;
  }

  .login-visual,
  .login-visual img {
    height: 100vh;
    height: 100svh;
    min-height: 0;
  }
}

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

  .login-panel {
    min-height: 100vh;
    min-height: 100svh;
    padding: 1.5rem clamp(1.25rem, 7vw, 3.5rem);
  }

  .login-content {
    width: min(100%, 31rem);
    margin-inline: auto;
  }

  .login-title {
    max-width: 15ch;
  }

  .login-visual {
    display: none;
  }

  .login-footer {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .login-panel {
    padding-block: 1.2rem;
  }

  .login-content {
    padding-block: 3.25rem;
  }

  .login-brand-mark {
    width: 2.4rem;
    height: 2.4rem;
  }

  .login-title {
    font-size: 2.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .microsoft-button {
    transition: none;
  }
}
