/* Login page. Mirrors the OMA Login design: a brand panel beside the sign-in
   column on wide viewports, sign-in column alone below 880px. */

/* Only this page's layout loads this file. The design system does not reset
   body, and the default margin would show beside the columns and push the
   100vh grid into a scrollbar. */
body {
  margin: 0;
}

.login-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--os-background-2);
  font-family: var(--os-font-family);
}

/* Brand panel */

.login-brand {
  position: relative;
  overflow: hidden;
  background-color: var(--os-color-primary-900);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Photo by Jessica Ruscello on Unspplash */
.login-brand--login {
  background-image: url("/assets/login-bg-b76c569e.jpg");
  background-image: image-set(url("/assets/login-bg-e76fffd3.webp") type("image/webp"), url("/assets/login-bg-b76c569e.jpg") type("image/jpeg"));
}

/* Photo by Mika Baumeister on Unsplash */
.login-brand--redeem {
  background-image: url("/assets/redeem-bg-bc9af693.jpg");
  background-image: image-set(url("/assets/redeem-bg-51a4f733.webp") type("image/webp"), url("/assets/redeem-bg-bc9af693.jpg") type("image/jpeg"));
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, hsla(240, 30%, 8%, 0.72) 0%, hsla(240, 30%, 8%, 0.55) 45%, hsla(240, 30%, 8%, 0.82) 100%);
}

.login-brand__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--os-space-3xl);
  height: 100%;
  padding: var(--os-space-3xl);
  box-sizing: border-box;
}

.login-brand__logo {
  width: 190px;
  height: auto;
}

.login-brand__copy {
  display: flex;
  flex-direction: column;
  gap: var(--os-space-md);
  max-width: 30ch;
}

.login-brand__title {
  margin: 0;
  font-size: var(--os-font-size-3xl);
  font-weight: 500;
  line-height: 120%;
  color: #fff;
  text-wrap: pretty;
}

.login-brand__text {
  margin: 0;
  font-size: var(--os-font-size-md);
  line-height: 150%;
  color: hsla(0, 0%, 100%, 0.78);
  text-wrap: pretty;
}

.login-brand__support {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--os-space-lg);
  font-size: var(--os-font-size-sm);
  color: hsla(0, 0%, 100%, 0.72);
}

.login-support__item {
  display: flex;
  align-items: center;
  gap: var(--os-space-sm);
}

/* Sign-in column */

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--os-space-4xl) var(--os-space-3xl);
  background: var(--os-background-1);
}

.login-form {
  width: 100%;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: var(--os-space-2xl);
}

.login-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--os-space-md);
}

.login-header__titles {
  display: flex;
  flex-direction: column;
  gap: var(--os-space-2xs);
}

.login-header__logo {
  display: none;
}

.login-title {
  margin: 0;
  font-size: var(--os-font-size-2xl);
  font-weight: 500;
  color: var(--os-foreground-1);
}

.login-subtitle {
  margin: 0;
  font-size: var(--os-font-size-sm);
  color: var(--os-foreground-2);
}

/* Error. The design system's danger toast fills with a saturated red and
   leaves the description near-black on it, which is 2.93:1. The design asks
   for a tint with the red in the border and icon instead. */

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--os-space-sm);
  padding: var(--os-space-md);
  background: var(--os-color-danger-05pct);
  border: 1px solid var(--os-color-danger-500);
  border-radius: var(--os-border-radius);
}

.login-alert__icon {
  margin-top: 2px;
  color: var(--os-color-danger-600);
}

.login-alert__body {
  display: flex;
  flex-direction: column;
  gap: var(--os-space-2xs);
}

.login-alert__title {
  font-size: var(--os-font-size-sm);
  font-weight: 700;
  color: var(--os-foreground-1);
}

.login-alert__text {
  font-size: var(--os-font-size-sm);
  color: var(--os-foreground-2);
}

/* Provider buttons: design system buttons, only the width is ours */

.login-actions {
  display: flex;
  flex-direction: column;
  gap: var(--os-space-sm);
}

.login-actions .button {
  width: 100%;
}

/* Secondary links */

.login-links {
  display: flex;
  flex-direction: column;
  gap: var(--os-space-md);
  padding-top: var(--os-space-lg);
  border-top: 1px solid var(--os-border-color-subtle);
}

/* Anchor-qualified with :visited so these tie the design system's
   a:not(.button) rules and win on order: no underline on hover, and the same
   colour whether or not the dialog has been opened before. */
a.login-links__item,
a.login-links__item:visited {
  display: flex;
  align-items: center;
  gap: var(--os-space-sm);
  color: var(--os-text-primary-color);
  font-size: var(--os-font-size-sm);
}

a.login-links__item:hover {
  color: var(--os-text-primary-color);
  text-decoration: none;
}

.login-support--narrow {
  display: none;
}

@media (max-width: 879px) {
  .login-page {
    display: flex;
    flex-direction: column;
  }

  .login-brand {
    display: none;
  }

  .login-panel {
    flex: 1;
    align-items: flex-start;
    padding: var(--os-space-xl) var(--os-space-lg) var(--os-space-3xl);
  }

  .login-header__logo {
    display: block;
    width: 170px;
    height: auto;
    margin-bottom: var(--os-space-md);
  }

  .login-support--narrow {
    display: flex;
    flex-wrap: wrap;
    gap: var(--os-space-lg);
    font-size: var(--os-font-size-sm);
    color: var(--os-foreground-2);
  }
}

/* Login dialogs use the design system modal as it comes, including its size.
   The partial is shared with the device return terms dialog. */

/* Same typography in both dialogs, whichever partial fills them. */
.login-page .modal-body p {
  margin: 0;
  font-size: var(--os-font-size-md);
  line-height: 160%;
  text-wrap: pretty;
}
