/* The editor's sign-in page, drawn like the customs-core login (Keycloak theme theme-so on keycloak.v2 /
   PatternFly 5): same background, logo, card, fonts, fields and black button. Sizes measured on that page.
   Fonts: Red Hat Display and Red Hat Text (SIL Open Font License), the files Keycloak's login uses, with
   PatternFly's mapping: Display "400" is the Medium cut, Text "700" is the Medium cut. */
@font-face {
  font-family: "RedHatDisplay";
  src: url("lab/RedHatDisplay-Medium.woff2") format("woff2");
  font-weight: 400;
  font-display: fallback;
}
@font-face {
  font-family: "RedHatText";
  src: url("lab/RedHatText-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: fallback;
}
@font-face {
  font-family: "RedHatText";
  src: url("lab/RedHatText-Medium.woff2") format("woff2");
  font-weight: 700;
  font-display: fallback;
}

:root {
  --text: #1e252d;
  --line: #f0f0f0;
  --line-bottom: #8a8d90;
  --focus: #0066cc;
  --danger: #c9190b;
  --danger-text: #a30000;
  --page: #eceff2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  padding: 0 5px;
  background: var(--page) url("lab/background.jpg") no-repeat center center fixed;
  background-size: cover;
  color: var(--text);
  font: 400 16px/1.5 "RedHatText", helvetica, arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0 48px;
}

.logo {
  width: 71px;
  height: 71px;
  margin: 0 auto 24px;
  background: url("lab/logo.svg") no-repeat center / contain;
}

.card {
  width: 100%;
  max-width: 34rem;
  background: #fff;
  box-shadow: 0 16px 32px rgba(3, 3, 3, 0.16), 0 0 8px rgba(3, 3, 3, 0.1);
  padding: 48px 48px 32px;
}

h1 {
  margin: 0 0 16px;
  font: 400 28px/1.3 "RedHatDisplay", helvetica, arial, sans-serif;
}

.login-form > .user {
  display: none;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.control {
  display: flex;
}

.control input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-right: 0;
  border-bottom-color: var(--line-bottom);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.control input:focus {
  border-bottom-color: var(--focus);
  box-shadow: inset 0 -1px 0 var(--focus);
}

.eye {
  width: 50px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-bottom);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.eye svg {
  fill: currentColor;
}

.eye .slash {
  display: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.eye .slash.gap {
  stroke: #fff;
  stroke-width: 5;
}

.eye[aria-pressed="true"] .slash {
  display: inline;
}

.eye:focus-visible,
.submit:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* A wrong password: red line under the field, the message under it (code-server writes div.error). */
.field:has(.error) .control input {
  border-bottom-color: var(--danger);
  box-shadow: inset 0 -1px 0 var(--danger);
  padding-right: 32px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23c9190b'/%3E%3Crect x='7' y='3.5' width='2' height='6' rx='1' fill='%23fff'/%3E%3Ccircle cx='8' cy='12' r='1.1' fill='%23fff'/%3E%3C/svg%3E")
    no-repeat right 8px center / 16px;
}

.error {
  margin-top: 4px;
  color: var(--danger-text);
  font-size: 14px;
  line-height: 1.5;
}

.help {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #000;
}

.submit {
  width: 100%;
  height: 36px;
  margin-top: 24px;
  padding: 6px 16px;
  border: 0;
  border-radius: 3px;
  background: #000;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 576px) {
  .login {
    justify-content: flex-start;
  }
  .card {
    padding: 48px 32px 32px;
  }
}
