/* Enterprise Microsoft sign-in: full-width desktop page, not a phone card.
   Official "Sign in with Microsoft" button follows Microsoft identity branding
   (logo + wording, light/dark color schemes, 21px four-square mark). */

body.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: block;
  background: var(--paper, #F8FAFD);
  overflow-x: hidden;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

body.login-page *,
body.login-page *::before,
body.login-page *::after {
  box-sizing: border-box;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 42%) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
}

.login-brand {
  background: #26366B;
  color: #fff;
  padding: clamp(32px, 6vw, 80px) clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.login-brand .login-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: min(280px, 100%);
  margin: 0 0 32px;
}

.login-brand .kicker {
  margin: 0;
  color: #3F9F7F;
  font-family: "Noto Sans", "Noto Sans 400 Fallback", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-brand h1 {
  margin: 10px 0 16px;
  color: #fff;
  font-family: "Noto Serif", "Noto Serif 400 Fallback", Georgia, serif;
  font-size: clamp(32px, 3.6vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  max-width: 16ch;
}

.login-brand .lede {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-family: "Noto Sans", "Noto Sans 400 Fallback", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  max-width: 28ch;
}

.login-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  background: var(--card, #fff);
}

body.login-page .login-card {
  width: auto;
  max-width: none;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  margin: 0;
  padding: clamp(32px, 6vw, 80px) clamp(28px, 6vw, 80px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-card-inner {
  width: 100%;
  max-width: 28rem;
  min-width: 0;
}

body.login-page .login-card h2 {
  margin: 0 0 8px;
  color: var(--heading, #26366B);
  font-family: "Noto Serif", "Noto Serif 400 Fallback", Georgia, serif;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
}

body.login-page .login-card .lede {
  margin: 0 0 24px;
  color: var(--ink, #1a2030);
  font-size: 16px;
  line-height: 1.5;
}

body.login-page .login-card .flash {
  margin: 0 0 20px;
  width: 100%;
}

/* Official Microsoft identity button (light / dark). Do not recolor the logo. */
a.ms-signin,
button.ms-signin {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: 41px;
  padding: 0 12px;
  margin: 8px 0 0;
  background: #ffffff;
  border: 1px solid #8C8C8C;
  border-radius: 0;
  color: #5E5E5E;
  font-family: "Noto Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  max-width: 100%;
  box-shadow: none;
}

a.ms-signin:hover,
a.ms-signin:visited,
button.ms-signin:hover {
  background: #ffffff;
  border-color: #5E5E5E;
  color: #5E5E5E;
  text-decoration: none;
}

a.ms-signin:focus-visible,
button.ms-signin:focus-visible {
  outline: 2px solid #26366B;
  outline-offset: 2px;
}

a.ms-signin svg,
button.ms-signin svg {
  display: block;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

.ms-signin-hint {
  margin: 12px 0 0;
  color: var(--muted, #5b6575);
  font-family: "Noto Sans", "Noto Sans 400 Fallback", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  max-width: 100%;
}

.login-secondary {
  margin: 32px 0 0;
  font-family: "Noto Sans", "Noto Sans 400 Fallback", sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.login-secondary a,
a.login-break-glass {
  color: var(--muted, #5b6575);
  text-decoration: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.login-secondary a:hover,
a.login-break-glass:hover {
  color: var(--heading, #26366B);
  text-decoration: underline;
}

body.login-page details.login-alt {
  margin: 32px 0 0;
  width: 100%;
  max-width: 28rem;
  font-size: 13px;
  color: var(--muted, #5b6575);
}

body.login-page details.login-alt summary {
  cursor: pointer;
  list-style: none;
  color: var(--muted, #5b6575);
}

body.login-page details.login-alt summary::-webkit-details-marker { display: none; }

body.login-page details.login-alt .stack {
  margin-top: 16px;
}

body.login-page .login-card .muted {
  margin: 28px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted, #5b6575);
}

body.login-page .login-main > .foot {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  height: 32px;
  padding: 0 16px;
  font-family: "Noto Sans", "Noto Sans 400 Fallback", sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #5b6575);
  border-top: 1px solid var(--line, #e2e7ee);
  background: var(--paper, #F8FAFD);
  width: 100%;
}

body.login-page .foot .ver,
body.login-page .foot .foot-text {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted, #5b6575);
  white-space: nowrap;
}

/* Dark theme: official dark Microsoft button; brand rail stays navy. */
html[data-theme="dark"] body.login-page {
  background: #171D2F;
}

html[data-theme="dark"] .login-main {
  background: #171D2F;
}

html[data-theme="dark"] body.login-page .login-card h2 {
  color: #fff;
}

html[data-theme="dark"] a.ms-signin,
html[data-theme="dark"] button.ms-signin,
html[data-theme="dark"] a.ms-signin:hover,
html[data-theme="dark"] a.ms-signin:visited {
  background: #2F2F2F;
  border-color: #2F2F2F;
  color: #ffffff;
}

html[data-theme="dark"] a.ms-signin:focus-visible,
html[data-theme="dark"] button.ms-signin:focus-visible {
  outline-color: #3F9F7F;
}

html[data-theme="dark"] .login-secondary a:hover,
html[data-theme="dark"] a.login-break-glass:hover {
  color: #fff;
}

/* Stack on small screens; stay usable on a phone without looking like a card modal. */
@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-brand {
    padding: 28px 24px 24px;
    min-height: auto;
  }

  .login-brand .login-logo {
    height: 36px;
    margin-bottom: 20px;
  }

  .login-brand h1 {
    font-size: 28px;
    margin: 8px 0 10px;
  }

  .login-brand .lede {
    max-width: none;
    font-size: 15px;
  }

  .login-main {
    min-height: auto;
    flex: 1 1 auto;
  }

  body.login-page .login-card {
    padding: 28px 24px 40px;
    justify-content: flex-start;
  }

  a.ms-signin,
  button.ms-signin {
    width: 100%;
    max-width: 28rem;
    justify-content: center;
  }
}

/* No horizontal scroll in the 1024–2560 desktop range. */
@media (min-width: 1024px) and (max-width: 2560px) {
  body.login-page,
  .login-shell,
  .login-main,
  body.login-page .login-card {
    overflow-x: hidden;
    max-width: 100%;
  }
}
