/*
 * The sign-in page. Standalone on purpose: this is the only screen an
 * anonymous visitor sees, so it does not lean on anything but style.css.
 *
 * The palette is the one the title bar already uses — black, the elum amber
 * #ecb200, whitesmoke — so signing in looks like the same product as the page
 * you land on afterwards.
 */

/*
 * style.css sets no global box-sizing, and the card and the sign-in button are
 * both sized with width/max-width and a padding — under content-box the button
 * ends up its padding wider than the card that holds it.
 */
.login-page,
.login-page *,
.login-page *::before,
.login-page *::after {
  box-sizing: border-box;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(to top right, #fafafa, #e9e9e9);
}

.login-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 520px;
  padding: 3rem;
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  text-align: center;
}

/* The amber strip echoes the one the title bar puts left of the page title. */
.login-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background-color: #ecb200;
}

/*
 * logo.png is white lettering on transparency — it is drawn on the black
 * block of the title bar and disappears on anything pale. The badge gives it
 * that block back.
 */
.login-container .logo-badge {
  display: inline-flex;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  margin-bottom: 1.75rem;
  background-color: black;
  border-radius: 0.5rem;
}

.login-container .logo-badge img {
  max-height: 34px;
  vertical-align: middle;
}

.login-container .logo-badge .text {
  font-family: "Raleway", sans-serif;
  font-weight: 100;
  font-size: 25px;
  color: white;
  padding-left: 10px;
  letter-spacing: 4px;
}

#typewriter {
  /*
   * Small enough that the heading still fits on one line if Roboto is missing
   * and a wider fallback face is used — it is typed out a letter at a time,
   * and a card that reflows halfway through looks broken.
   */
  font-size: 1.375rem;
  font-weight: 500;
  color: #212529;
  margin: 0 0 0.75rem;
  /* Reserve the line so the card does not grow as the text appears. */
  min-height: 2rem;
  text-wrap: balance;
}

#typewriter::after {
  content: "|";
  animation: blink-caret 1.1s step-end infinite;
}

@keyframes blink-caret {
  from,
  to {
    color: transparent;
  }
  50% {
    color: #212529;
  }
}

.login-container .tagline {
  margin: 0 0 2rem;
  color: #6c757d;
  line-height: 1.5;
}

.login-container .alert {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  text-align: left;
}

.login-container .alert-danger {
  color: #842029;
  background-color: #f8d7da;
  border: 1px solid #f5c2c7;
}

.login-container .socialaccount_provider {
  display: block;
  margin-bottom: 0.5rem;
}

/*
 * allauth renders the provider as a plain link, so everything below styles an
 * <a>, not a <button>. It matches the link itself rather than the .google-btn
 * class login.js adds: the styling then holds from the first paint, instead of
 * a bare blue link showing until the script has run.
 *
 * Only the three properties hover changes are transitioned. Under `all`, the
 * class login.js adds would animate the padding and the colours from nothing,
 * so the button visibly assembles itself on load.
 */
.login-container .socialaccount_provider a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #212529;
  text-decoration: none;
  background-color: #fff;
  border: 2px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow:
    0 4px 6px rgba(50, 50, 93, 0.11),
    0 1px 3px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.2s ease-in-out,
    background-color 0.2s ease-in-out,
    border-color 0.2s ease-in-out;
}

.login-container .socialaccount_provider a:hover,
.login-container .socialaccount_provider a:focus-visible {
  transform: translateY(-2px);
  background-color: #f8f9fa;
  border-color: #ecb200;
}

/* The Google mark login.js puts in front of the label. */
.login-container .socialaccount_provider a svg {
  margin-right: 0.75rem;
}

/* On a phone the card is as wide as the screen, so 3rem of it is wasted. */
@media (max-width: 480px) {
  .login-container {
    padding: 2rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #typewriter::after {
    animation: none;
  }

  .login-container .socialaccount_provider a {
    transition: none;
  }

  .login-container .socialaccount_provider a:hover,
  .login-container .socialaccount_provider a:focus-visible {
    transform: none;
  }
}
