/* web/entry/signin.css — the sign-in page round Authelia's form (docs/archive/UI_REDESIGN_PLAN.md C1).
   Injected by authelia-proxy after brand.css; the html classes come from signin.js. */

html.mirai-signin {
  background-color: var(--brand-surface, #111114) !important;
  background-image: radial-gradient(rgba(157, 170, 184, .06) 1.3px, transparent 1.6px) !important;
  background-size: 28px 28px !important;
}
html.mirai-signin body { background: transparent !important; }

/* The orbit sits behind the form, on the first factor of a wide page only (signin.js draws none under 900 px). */
.ms-orbit.mirai-ground { position: fixed; inset: 0; z-index: -1; display: none; background: none; pointer-events: none; overflow: hidden; }
html.ms-first .ms-orbit { display: block; }
@media (max-width: 899.98px) {
  html.ms-first .ms-orbit { display: none; }
}

/* With the orbit the logo row is the pack's dark wordmark (the name in text without one): no ring, no mark. */
html[data-entry=orbit]:not(.mirai-inapp) #first-factor-stage > div > div > div:first-child::before {
  content: var(--brand-wordmark-text, ""); display: block; width: 100%; height: 36px; margin: 8px auto;
  border: 0; border-radius: 0; background: var(--brand-wordmark, none) center / auto 36px no-repeat;
  font: 800 26px/36px Inter, system-ui, sans-serif; letter-spacing: -0.5px; color: #E8EDF2; text-align: center;
}

/* Inside the app (docs/archive/LOGIN_IN_APP_PLAN.md D6): no orbit, the app's bar above, so less room over the form. */
html.mirai-inapp .ms-orbit { display: none !important; }
/* Authelia 4.39 centres the stage in 90vh (LoginLayout: flex min-h-[90vh] items-center): here it starts at the top,
   under the wordmark; signin.js adds --mi-shift so the submit stands where the start screen's button was. */
html.mirai-inapp #first-factor-stage {
  min-height: 0 !important; align-items: flex-start !important; margin-top: 0 !important;
  padding-top: calc(var(--mi-wordmark-top, 24px) + 52px + var(--mi-shift, 0px)) !important;
}
/* The logo row becomes the start screen's wordmark, at its height (--mi-wordmark-top, from the app). */
html.mirai-inapp #first-factor-stage > div > div > div:first-child {
  position: fixed; left: 0; right: 0; top: var(--mi-wordmark-top, 24px); z-index: 1; padding: 0 !important;
}
html.mirai-inapp #first-factor-stage > div > div > div:first-child::before {
  content: var(--brand-wordmark-text, ""); display: block; width: 100%; height: 28px; margin: 0;
  border: 0; border-radius: 0; background: var(--brand-wordmark, none) center / auto 28px no-repeat;
  font: 800 20px/28px Inter, system-ui, sans-serif; letter-spacing: -0.4px; color: #E8EDF2; text-align: center;
}
/* Authelia's "Accedi" heading: the app's bar already names the page. */
html.mirai-inapp #first-factor-stage > div > div > div:first-child + :not(.mt-2) { display: none !important; }
/* Its Button sets `uppercase`; inside the app the label reads as written, beside the bar's "Accedi". */
html.mirai-inapp #sign-in-button { text-transform: none !important; }

/* L7: why the page came back (a failed code exchange). */
.ms-notice {
  position: fixed; z-index: 10; top: 24px; left: 50%; transform: translateX(-50%);
  box-sizing: border-box; width: max-content; max-width: min(444px, calc(100vw - 32px)); margin: 0; padding: 12px 16px;
  border-radius: 10px; border: 1px solid rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .12);
  color: #E8EDF2; font: 500 14px/1.45 Inter, system-ui, sans-serif; text-align: center;
}
@media (min-width: 900px) {
  html[data-entry=orbit] .ms-notice { left: 25%; }
}

/* FEDERATED_SSO_PLAN D13: "Accedi con Microsoft", a neutral button on the page's surface (signin.js adds it
   only when <meta name="mirai-sso"> is there). The logo keeps Microsoft's four colours from its own file. */
.ms-sso { width: 100%; box-sizing: border-box; }
.ms-sso-first { margin-bottom: 4px; }
.ms-or {
  display: flex; align-items: center; gap: 12px; margin: 20px 0 14px;
  font: 500 12px/1.2 Inter, system-ui, sans-serif; color: #9DAAB8;
}
.ms-or::before, .ms-or::after { content: ""; flex-grow: 1; height: 1px; background: rgba(157, 170, 184, .24); }
.ms-ms {
  box-sizing: border-box; width: 100%; min-height: 58px; margin-bottom: 3px; padding: 8px 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  border: 1px solid rgba(157, 170, 184, .32); border-radius: 10px;
  background: var(--brand-surface, #111114); color: #E8EDF2; text-decoration: none;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
  transition: transform 170ms cubic-bezier(.2, .9, .3, 1.25), box-shadow 170ms ease, border-color 200ms ease;
}
.ms-ms:hover { transform: translateY(-1px); border-color: rgba(157, 170, 184, .55); }
.ms-ms:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0, 0, 0, .35); }
.ms-ms:focus-visible { outline: 2px solid #E8EDF2; outline-offset: 2px; }
.ms-ms img { flex: none; width: 21px; height: 21px; }
.ms-mst { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; line-height: 1.2; }
.ms-mst b { font: 600 15px/1.2 Inter, system-ui, sans-serif; }
.ms-mst small { font: 500 12px/1.2 Inter, system-ui, sans-serif; color: #9DAAB8; }
.ms-sso-hint { margin: 12px 0 0; font: 500 13.5px/1.45 Inter, system-ui, sans-serif; color: #E8EDF2; }
@media (prefers-reduced-motion: reduce) {
  .ms-ms, .ms-ms:hover, .ms-ms:active { transition: none; transform: none; }
}

/* Authelia's Caps Lock warning is not shown: the sign-in form stays clean and never moves. */
#form-login .grid > div:has(> [data-slot="alert"].border-warning) { display: none; }

/* A sign-in leaving for the app: the form steps aside, the orbit stays. */
html.ms-leaving #first-factor-stage {
  opacity: 0; transform: translateX(-56px);
  transition: opacity 560ms cubic-bezier(.4, 0, .9, .6), transform 560ms cubic-bezier(.4, 0, .9, .6);
}
@media (prefers-reduced-motion: reduce) {
  html.ms-leaving #first-factor-stage { transform: none; }
}
