/*
 * The Techslon login's own address (plan 24 item 1), as in the owner's design: "Opening your
 * company…", "Choose company" and "no company yet" on Techslon dark blue, in the sign-in page's
 * colours (login/resources/css/techslon.css). The logo and the fonts are the login theme's own
 * files: Keycloak serves every theme's resources at /resources/<version>/<type>/<theme>/, so
 * ../../../login/techslon/ is the login theme from here.
 */
@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../../login/techslon/fonts/ubuntu-latin-400-normal.woff2")
    format("woff2");
}
@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../../../login/techslon/fonts/ubuntu-latin-500-normal.woff2")
    format("woff2");
}
@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../../../login/techslon/fonts/ubuntu-latin-700-normal.woff2")
    format("woff2");
}
@font-face {
  font-family: "Ubuntu Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../../login/techslon/fonts/ubuntu-mono-latin-400-normal.woff2")
    format("woff2");
}

:root {
  --page: #26316d;
  --indigo: #3f51b5;
  --indigo-dark: #303f9f;
  --line: #dbdee0;
  --box: #bbbbbb;
  --muted: #555555;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: #000;
  font-family: Ubuntu, system-ui, sans-serif;
}
[hidden] {
  display: none !important;
}
a {
  color: var(--indigo);
}
a:hover {
  color: var(--indigo-dark);
}
h1 {
  margin: 0;
  color: var(--indigo);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
p {
  margin: 0;
}
.muted {
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.mono {
  color: #000;
  font-family: "Ubuntu Mono", monospace;
}

.logo {
  display: block;
  width: 289px; /* the logo is 1200 x 432 */
  max-width: 100%;
  height: 104px;
  margin-bottom: -33px; /* its picture has room under the words */
  background: url("../../../login/techslon/img/techslon-logo.webp") center /
    contain no-repeat;
}

/* "Opening your company…" (and what went wrong, if anything did) */
.opening {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  color: #fff;
  text-align: center;
}
.opening .logo-small {
  width: 156px;
  height: 56px;
  margin: 0;
}
.opening p {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}
.opening a {
  color: #c5cae9;
}
.spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 3s;
  }
}

/* The other two screens: logo, card (and the footer box under "no company yet") */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(24px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}
.stack {
  margin: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
/* "Choose company" sits in the middle, with the same logo as the sign-in (the design file) */
.page.centred .stack {
  margin: auto 0;
}
.card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.card > h1 + .muted {
  margin-top: -12px;
}

/* Choose company */
.list-card {
  padding: 0;
  gap: 0;
  overflow: hidden;
}
.card-head {
  padding: 24px 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.companies {
  list-style: none;
  margin: 0;
  padding: 0;
}
.company {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 24px;
  background: #fff;
  border: 0;
  border-top: 1px solid var(--line);
  color: #000;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.company:hover {
  background: #f7f7f8;
}
.company:focus-visible {
  outline: 2px solid #5bc0de;
  outline-offset: -2px;
}
.company-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.company-name {
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.company-town {
  color: var(--muted);
  font-size: 13px;
}
.last-used {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--indigo);
  border-radius: 2px;
  color: var(--indigo);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.chevron {
  flex: none;
  width: 24px;
  height: 18px;
  color: var(--muted);
}
.card-foot {
  border-top: 1px solid var(--line);
  padding: 6px 12px;
  display: flex;
  justify-content: flex-end;
}
.link-button {
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  color: var(--indigo);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.link-button:hover {
  color: var(--indigo-dark);
}

/* No company yet */
.note {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: #fffde7;
  border: 1px solid #f0e2a0;
  border-radius: 3px;
  color: #6b4e00;
  font-size: 14px;
  line-height: 1.45;
}
.note svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.support {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.support svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.button {
  width: 100%;
  min-height: 40px;
  background: #fff;
  border: 1px solid var(--box);
  border-radius: 3px;
  color: #000;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.button:hover {
  background: #f7f7f8;
}
.footer {
  width: 100%;
  max-width: 440px;
  margin-top: -10px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 3px;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
}
.footer a {
  color: var(--indigo);
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 1023px) {
  .logo {
    width: 250px;
    height: 90px;
    margin-bottom: -29px;
  }
}
@media (max-width: 599px) {
  .stack {
    gap: 20px;
  }
  .logo {
    width: 206px;
    height: 74px;
    margin-bottom: -24px;
  }
  .footer {
    margin-top: -8px;
  }
  .button {
    min-height: 44px;
  }
}
@media (max-width: 480px) {
  .card {
    padding: 20px 16px;
  }
  .list-card {
    padding: 0;
  }
}
@media (max-width: 379px) {
  .footer {
    font-size: 11px;
  }
}
@media (max-height: 600px) {
  .stack,
  .page.centred .stack {
    gap: 14px;
  }
  .logo,
  .page.centred .logo {
    width: 144px;
    height: 52px;
    margin-bottom: -17px;
  }
}
