/* Signin page — main.css */

:root {
  --color-logo: oklch(39.1% 0.095 251); /* #164776, see note on logo */
  --color-text: oklch(0.38 0.015 250);
  --color-text-muted: oklch(54.2% 0.029 250.2); /* #637180 */
  --color-text-highlighted: oklch(0.28 0.06 251);
  --color-primary: oklch(44.8% 0.13 252.9); /* #0C559A */
  --color-primary-active: oklch(41% 0.121 251.6); /* #004B89 */
  --color-background: oklch(100% 0 0);
  --color-background-elevated: oklch(100% 0 0);
  --color-background-soft: oklch(97.9% 0 0); /* #F8F8F8 */
  --color-border: oklch(94% 0.015 248);
  --color-border-accented: oklch(90.6% 0.039 247.1); /* #CCE3F9 */
  --color-error: oklch(57.8% 0.233 29.9); /* #E30F00 */

  /* extras from the site, optional */
  --color-primary-soft: oklch(90.6% 0.039 247.1); /* #CCE3F9 */
  --color-success: oklch(71.9% 0.181 127.6); /* #84B818 */
}

.dark {
  --color-logo: oklch(100% 0 0);
  --color-text: oklch(92% 0.01 250);
  --color-text-muted: oklch(0.708 0.02 250);
  --color-text-highlighted: oklch(100% 0 0);
  --color-primary: oklch(0.7 0.11 248);
  --color-primary-active: oklch(0.78 0.09 247);
  --color-background: oklch(0.16 0.02 252);
  --color-background-soft: oklch(0.27 0.03 252);
  --color-background-elevated: oklch(0.21 0.025 252);
  --color-border: oklch(0.29 0.03 252);
  --color-border-accented: oklch(0.38 0.04 252);
  --color-error: oklch(70% 0.19 28);

  --color-primary-soft: oklch(0.3 0.06 250);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  background-color: var(--color-background);
  color: var(--color-text);
}

/* ---- Page layout ---- */

.wrapper {
  display: flex;
  min-height: 100svh;
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

/* ---- Logo ---- */
.container svg {
  max-width: 10rem;
  display: block;
  width: 100%;
  fill: var(--color-logo);
}

/* ---- Card ---- */

.card {
  background: var(--color-background-elevated);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--color-border);
  padding: 1rem 1.5rem;
}

/* ---- Typography ---- */

p {
  font-size: 0.875rem;
}

h1 {
  color: var(--color-text-highlighted);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

h2 {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: normal;
  margin-top: 0.5rem;
}

/* ---- Form ---- */

form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
}

form {
  :where(& > :not(:last-child)) {
    margin-block-start: 0;
    margin-block-end: 1rem;
  }
}

/* ---- Form fields ---- */

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

label::after {
  content: '*';
  margin-inline-start: 0.125rem;
  color: #ef4444;
}

/* ---- Inputs ---- */

input[type='email'],
input[type='password'],
input[type='text'] {
  display: block;
  width: 100%;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.25rem;
  color: var(--color-text-highlighted);
  background: var(--color-background-elevated);
  border: none;
  border-radius: 0.375rem;
  box-shadow: inset 0 0 0 1px var(--color-border-accented);
  outline: none;
  appearance: none;
  transition: box-shadow 150ms;
}

input[type='email']::placeholder,
input[type='password']::placeholder,
input[type='text']::placeholder {
  color: var(--color-text-muted);
}

input[type='email']:focus-visible,
input[type='password']:focus-visible,
input[type='text']:focus-visible {
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

input:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

/* ---- Forgot password link ---- */

a {
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---- Submit button ---- */

button[type='submit'] {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--color-background-elevated);
  background: var(--color-primary);
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 150ms;
}

button[type='submit']:hover,
button[type='submit']:active {
  background: var(--color-primary-active);
}

button[type='submit']:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button[type='submit']:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

button[type='submit'].submit-link {
  padding: 0;
  background: none;
  color: var(--color-primary);
  text-decoration: none;
}

.submit-link:hover {
  text-decoration: underline;
}

/* ---- Error List ---- */
.errorlist {
  color: color-mix(in oklab, var(--color-error) 90%, transparent);
  background: color-mix(in oklab, var(--color-error) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-error) 25%, transparent);
  border-radius: 0.25rem;
  padding: 1rem;
  font-size: 0.875rem;
}

.oidc_provider_list {
  list-style: none;
  padding: 0;
}

.oidc_provider_list
  form[action='/hidp/login/oidc/authenticate/microsoft/']
  button::before {
  content: '';
  background-image: url("/static/svg/microsoft.319d9b9a39d5.svg");
  background-size: 21px;
  width: 21px;
  height: 21px;
}

.oidc_provider_list
  form[action='/hidp/login/oidc/authenticate/microsoft/']
  button {
  color: var(--color-text);
  background-color: var(--color-background-soft);
  gap: 6px;
  border: 1px solid var(--color-border-accented);
}
.oidc_provider_list
  form[action='/hidp/login/oidc/authenticate/microsoft/']
  button:hover {
  background-color: color-mix(
    in oklab,
    var(--color-border-accented) 75%,
    transparent
  );
}

/* ---- Welcome text and the one big sign-in button ---- */

.card h1 {
  font-size: 1.375rem;
  line-height: 1.3;
}

.card .lead {
  font-size: 1rem;
  color: var(--color-text);
  margin: 0.5rem 0 1.25rem;
}

.card .hint {
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}

.oidc_provider_list form {
  margin-top: 0;
}

.oidc_provider_list button[type='submit'] {
  width: 100%;
  justify-content: center;
  min-height: 3rem;
  font-size: 1rem;
  border-radius: 9999px;
}

/* Mobile friendly styles */
@media (max-width: 1023px) {
  .container {
    max-width: 100%;
  }
}
