/* The layout of the sign-in page at / and at /auth/login
   (internal/templates/login.templ).
   app.css gives the fonts, the colour tokens and the light and dark modes. */

/* Two halves: a panel with the product name on the left and the sign-in
   form on the right. On a small screen, the halves are one column. */
.login {
  min-height: 100dvh;
  display: flex;
  flex-wrap: wrap;
}

.login-panel {
  flex: 1 1 26rem;
  box-sizing: border-box;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  height: 1.8rem;
  font-size: var(--fs-lg);
  font-weight: 600;
}

/* The maker name after the product name is muted, so "Wren" stays the
   main text. */
.login-by {
  color: var(--muted);
  font-weight: 400;
}

.login-main {
  flex: 1 1 26rem;
  box-sizing: border-box;
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The error page has only the main half, at the full height of the window.
   Its parts are closer together than the parts of the sign-in form. */
.error-page {
  min-height: 100dvh;
}

.error-page .login-form {
  gap: 1rem;
}

.error-page .eyebrow,
.error-page p {
  margin: 0;
}

.login-form {
  width: 100%;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  gap: 1.85rem;
}

.login-form h1 {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 600;
}

.providers {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* A provider link is a full-width row with the provider icon, the label
   and an arrow. */
a.provider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3.2rem;
  padding: 0 1.05rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-md);
  font-weight: 500;
  text-decoration: none;
}

a.provider:hover {
  color: var(--ink);
  background: var(--hover);
  border-color: var(--ink);
}

a.provider:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.provider svg {
  width: 1.2rem;
  height: 1.2rem;
  flex: none;
}

.provider .label {
  flex: 1;
}

.provider .arrow {
  color: var(--muted);
}

.login-note {
  margin: 0;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
}

/* Below this width the panel is above the form, so it does not need the
   empty item. */
@media (max-width: 52rem) {
  .login-panel::after {
    display: none;
  }
}

@media (max-width: 40rem) {
  .login-panel {
    padding: 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
