/* Login page is standalone, all related CSS is here */

@font-face {
  font-family: RedHatText;
  font-style: normal;
  font-weight: 400;
  src: url(fonts/RedHatText-Regular.woff2) format("woff2");
}

@font-face {
  font-family: RedHatText;
  font-style: normal;
  font-weight: 700;
  src: url(fonts/RedHatText-Medium.woff2) format("woff2");
}

*,
::after,
::before {
  box-sizing: border-box;
}

[hidden]:not([hidden="false"]) {
  display: none !important;
}

html {
  font-family: sans-serif;
  height: 100%;
  background: #000;
}

body {
  margin: 0;
  font-family: RedHatText, Helvetica, Arial, sans-serif;
  background-color: #333;
  color: #fff;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-size: 1.125rem;
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.3;
  padding: 0 0 1rem;
}

h2 {
  font-size: 1.3rem;
}

pre {
  white-space: pre-wrap;
}

.pf-c-button,
label {
  font-weight: 600;
}

.pf-c-button,
img {
  vertical-align: middle;
}

#option-group,
.pf-c-button,
.input-clear,
button {
  cursor: pointer;
}

#option-group svg,
.input-clear {
  opacity: 0.7;
}

a,
summary {
  color: #06c;
  text-decoration: none;
}

.pf-c-button:focus,
.host-remove:focus,
button:focus,
a:focus {
  outline: -webkit-focus-ring-color auto 5px;
  outline: dotted thin;
  outline-offset: -2px;
}

a:focus,
a:hover {
  color: #fff;
  text-decoration: underline;
}

img {
  border: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
  margin: 0;
  font-size: inherit;
  line-height: inherit;
}

button {
  overflow: visible;
  border-radius: 0.1875rem;
  border: none;
}

button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0;
}

p {
  margin: 0 0 1rem;
}

.container {
  margin-right: auto;
  margin-left: auto;
}

/* Bump options & connection away from user/pass */
#option-group,
#option-group[hidden] + #server-group {
  margin-top: 1rem;
}

#option-group {
  margin-bottom: 1rem;
}

.form-group:not(:first-child) {
  margin-top: 1rem;
}

.login-actions {
  display: flex;
  align-items: baseline;
  grid-gap: 1rem;
}

label {
  display: inline-block;
}

#option-group,
.control-label {
  font-size: 0.875rem;
}

[role="form"] .control-label,
form .control-label {
  display: flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0 0.5rem;
}

.form-control {
  color: #151515;
}

.pf-c-button.pf-m-control,
.form-control[type="password"],
.form-control[type="text"] {
  display: block;
  width: 100%;
  padding: 0.25rem 0.5rem;
  background-color: #fff;
  background-image: none;
  border: 1px solid #ededed;
  border-bottom-color: #72767b;
  border-radius: 1px;
  transition: border-color 0.15s ease-in-out;
  color: #151515;
}

.pf-c-button.pf-m-control:hover,
.form-control[type="password"]:hover,
.form-control[type="text"]:hover,
.form-control[type="password"]:focus,
.form-control[type="text"]:focus {
  border-bottom-color: #06c;
}

.pf-c-button.pf-m-control:focus,
.form-control[type="password"]:focus,
.form-control[type="text"]:focus {
  padding-bottom: calc(0.25rem - 1px);
  border-bottom-width: 2px;
}

.pf-c-button.pf-m-control:focus,
.form-control:focus {
  outline: 0;
}

.form-control::placeholder {
  color: #999;
  font-style: italic;
  opacity: 1;
}

.checkbox-row {
  margin: 1rem 0 0;
  display: flex;
  align-items: baseline;
}

.checkbox-row > input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  align-self: flex-start;
  margin-top: calc((1.5rem - 1rem) / 2);
  margin-right: 0.5rem;
}

label.checkbox {
  font: inherit;
}

.help-block {
  display: block;
  margin-top: 5px;
  margin-bottom: 1rem;
  color: #737373;
}

.pf-c-button,
.caret {
  display: inline-block;
}

.pf-c-button[spinning] .spinner {
  display: inline-flex;
}

.form-group::after {
  clear: both;
  margin-bottom: 1rem;
}

.pf-c-button {
  text-align: center;
  background-image: none;
  border: 1px solid transparent;
  white-space: nowrap;
  padding: 0.375rem 1rem;
  border-radius: 3px;
  font-size: inherit;
  font-weight: 400;
  user-select: none;
}

.pf-c-button:focus,
.pf-c-button:hover {
  text-decoration: none;
}

.pf-c-button:active {
  outline: 0;
  background-image: none;
}

.pf-m-primary {
  background-color: #06c;
  border-color: #06c;
  color: #fff;
}

.pf-m-primary:active,
.pf-m-primary:not([disabled]):focus,
.pf-m-primary:not([disabled]):hover {
  background-color: #004080;
  border-color: #004080;
  color: #fff;
  outline: none;
}

.pf-m-tertiary {
  background-color: transparent;
  border-color: #151515;
  color: #151515;
}

.pf-m-tertiary:active,
.pf-m-tertiary:focus,
.pf-m-tertiary:hover {
  background-color: transparent;
  border-color: #151515;
  color: #151515;
  border-width: 2px;
}

.pf-m-danger {
  background-color: #c9190b;
  border-color: #c9190b;
  color: #fff;
}

.pf-m-danger:hover,
.pf-m-danger:focus {
  background-color: #a30000;
  border-color: #a30000;
  outline: none;
}

.pf-c-button.pf-m-warning {
  background-color: #f0ab00;
  border-color: #f0ab00;
  color: black;
}

.pf-c-button.pf-m-warning:hover,
.pf-c-button.pf-m-warning:focus {
  background-color: #c58c00;
  border-color: #c58c00;
  color: black;
}

.login-pf {
  height: 100%;
}

.login-pf #brand img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

.unsupported-browser #brand {
  display: none;
}

.login-pf #banner {
  margin: 1rem 0 0.5rem;
  grid-area: banner;
  width: 100%;
}

#banner-message {
  white-space: pre-wrap;
  max-height: 12em;
  overflow: auto;
}

.login-pf .container {
  background-color: rgb(255 255 255 / 50%);
  background: white;
  color: #333;
  padding: 3rem 3rem 2rem;
  width: 100%;
}

#main {
  grid-area: login;
}

.login-pf .container .details p:first-child {
  border-top: 1px solid #474747;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.login-pf .details p {
  margin: 0;
}

.login-pf .details p + p {
  margin-top: 0.5rem;
}

.login-pf .container .control-label {
  font-weight: 600;
}

.login-pf .container .help-block {
  color: #fff;
}

.login-pf .container .form-group:last-child,
.login-pf .container .form-group:last-child .help-block:last-child {
  margin-bottom: 0;
}

.spinner {
  animation: 0.6s linear infinite rotation;
  border-bottom: 4px solid rgb(0 0 0 / 25%);
  border-left: 4px solid rgb(0 0 0 / 25%);
  border-right: 4px solid rgb(0 0 0 / 25%);
  border-radius: 100%;
  border-top: 4px solid rgb(0 0 0 / 75%);
  height: 1.5rem;
  width: 1.5rem;
}

/* Alerts */
.pf-c-alert {
  color: #151515;
  position: relative;
  grid-template-columns: max-content 1fr max-content;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "icon title   action"
    ".    content content";
  background-color: #fff;
  margin: 0 0 1.5rem;
  display: grid;
  border: 3px solid #009596;
  border-width: 2px 0 0;
  box-shadow: rgb(3 3 3 / 16%) 0 0.5rem 1rem 0, rgb(3 3 3 / 8%) 0 0 0.5rem 0;
}

.pf-c-alert.pf-m-inline {
  box-shadow: none;
}

.pf-c-alert > svg {
  grid-area: icon;
  height: 1.125rem;
  width: 1.125rem;
  margin: 1.25rem 1rem 1rem;
  float: left;
  color: #009596;
}

@supports (display: grid) {
  .pf-c-alert > svg {
    float: none;
    margin-right: 0;
  }
}

.pf-c-alert__title {
  grid-area: title;
  font-size: 1rem;
  margin: 1rem;
}

.pf-c-alert.pf-m-inline.pf-m-danger {
  background: #faeae8;
  border-color: #c9190b;
}

.pf-c-alert.pf-m-danger > svg {
  color: #c9190b;
}

.pf-c-alert.pf-m-danger .pf-c-alert__title {
  color: #a30000;
}

.pf-c-alert.pf-m-inline.pf-m-warning {
  background: #fdf7e7;
  border-color: #f0ab00;
}

.pf-c-alert.pf-m-warning > svg {
  color: #f0ab00;
}

.pf-c-alert.pf-m-warning .pf-c-alert__title {
  color: #795600;
}

.pf-c-alert.pf-m-inline.pf-m-info {
  background: #e7f1fa;
  border-color: #73bcf7;
}

.pf-c-alert.pf-m-info > svg {
  color: #73bcf7;
}

.pf-c-alert.pf-m-info .pf-c-alert__title {
  color: #004368;
}

#server-group::before {
  clear: both;
  margin-top: 5px;
}

.login-fatal {
  font-size: 130%;
}

.unsupported-browser ul {
  display: inline-block;
  margin: 0 auto;
  text-align: left;
}

.unsupported-browser a {
  font-weight: 700;
}

.input-clear,
.inline .container .help-block {
  color: #000;
}

.caret,
.server-box {
  position: relative;
}

.conversation-prompt {
  white-space: normal;
  word-wrap: break-word;
}

.control-label {
  white-space: nowrap;
}

.spinner {
  border-color: rgb(255 255 255 / 75%) rgb(255 255 255 / 25%) rgb(255 255 255 / 25%);
}

#hostkey-fingerprint {
  font-size: large;
  font-weight: bold;
  margin-bottom: 0;
}

#hostkey-type {
  font-size: small;
}

#hostkey-verify-help-cmds {
  border-radius: 0.25rem;
  padding: 0.5rem 1rem;
  background: #ddd;
}

.pf-c-button .spinner,
.pf-c-button[spinning] .button-text,
.hide-before::before {
  display: none;
}

/* Hide inline login screen by default */
.inline #badge,
.inline #brand,
.inline #login-details {
  display: none;
}

.inline body {
  background: 0 0 !important;
  color: #000;
}

.caret {
  vertical-align: middle;
  margin: calc((1.5rem - 16px) / 2) 0;
  margin-right: 0.25rem;
  transition: all 300ms;
}

[data-state="true"] svg.caret {
  transform: rotate(90deg) translateX(-3px);
  transform-origin: 0.5rem;
}

.input-clear {
  display: flex;
  padding: 0.5rem 0.75rem;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
}

.input-clear > svg {
  height: 1rem;
  width: auto;
}

/* Only show clear icon when the field has text */
.form-control:placeholder-shown + .input-clear {
  display: none;
}

/* Reserve a little space for the clear icon in the input */
.server-box > .form-control {
  padding-right: 2rem;
}

#option-group:hover svg,
.input-clear:hover {
  opacity: 1;
}

#option-group div {
  margin-left: -3px;
  margin-top: 3px;
  margin-bottom: 1rem;
}

.login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  flex-basis: 100%;
}

#hostkey-group:not([hidden]) ~ .login-actions > .login-button {
  flex-basis: max-content;
}

.pf-c-button[disabled] {
  background-color: #333;
  background-image: none;
  border-color: #555;
  cursor: default;
}

/*** Media breakpoints ***/

/* Optimize for mobile phones in portrait mode */
@media (max-width: 480px) {
  .login-pf {
    display: flex;
    flex-direction: column-reverse;
    position: relative;
  }

  .row {
    display: flex;
    flex-direction: column;
  }

  .login-pf .container {
    width: 100%;
    padding: 2rem;
  }

  .login-pf #badge {
    max-width: calc(100vw - 2rem);
  }

  /* Brand container */
  .login-pf #brand {
    font-size: inherit;
    background-position: 50% 50%;
  }

  .details {
    text-align: center;
  }
}

/* Large phones and desktops */
@media (min-width: 481px) {
  .unsupported-browser-heading {
    margin: 2rem 0 1rem;
  }

  .login-pf #brand {
    padding: 0;
    margin-bottom: 1rem;
  }
}

/* Desktop only */
@media (min-width: 1024px) {
  .control-label {
    text-align: right;
  }

  .login-pf #brand img {
    margin: 0;
    text-align: left;
  }

  .login-pf .container .login-area {
    border-right: 1px solid #474747;
  }
}

/* PF4-ish style overrides (depending on grid & CSS variables */

.row {
  display: flex;
  flex-flow: column;
  margin: 0;
}

body.login-pf {
  color: #151515;
  display: grid;
  grid-template-areas: "banner" "login" "details" "recent" "logo";
  grid-template-rows: repeat(3, auto) 1fr;
  background-position: 0 0 !important;
  padding: 0;
}

.login-pf .container .details p:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.login-button {
  width: 100%;
}

.login-pf .details {
  grid-area: details;
  padding: 1.5rem 3rem;
  width: 100%;
  background: #ededed;
}

#recent-hosts {
  grid-area: recent;
  margin-top: 1rem;
  padding: 3rem 1.5rem 1.5rem;
}

#recent-hosts > h1 {
  padding-left: 1.5rem;
}

.login-pf #badge {
  grid-area: logo;
}

.login-pf .container .login-area {
  border: none;
  width: auto;
}

details > summary {
  display: block;
  padding: 0.5rem 0;
  cursor: pointer;
}

details > summary:hover {
  text-decoration: underline;
}

details[open] > summary > .caret {
  transform: rotate(90deg) translateX(-3px);
}

.login-pf #brand {
  text-transform: initial;
}

#brand strong,
#brand b {
  font-weight: 600;
}

.login-pf #brand.text-brand {
  width: auto;
  background: none;
}

a:focus,
a:hover {
  color: #004080;
}

.caret polygon {
  fill: #06c;
}

.host-line {
  display: grid;
  grid: 1fr / 1fr auto;
  border: 1px solid #d2d2d2;
  border-width: 1px 0;
}

.host-line + .host-line {
  border-top-width: 0;
}

.host-name {
  flex: auto;
  text-align: left;
  color: #06c;
  border: none;
  /* As we're making the list flush to the card, we should indent the contents to align */
  padding: 0.5rem 1rem 0.5rem 1.5rem;
}

.host-name:hover {
  color: #004080;
  text-decoration: underline;
}

.host-remove {
  background: transparent;
  margin-right: 1.5rem;
  padding: 0.375rem 1rem;
  /* Allow ::before to size relative to .host-remove */
  position: relative;
}

/* As masking would hide outline, use ::before for the × SVG  */
.host-remove::before {
  /* ::before pseudoelement needs special CSS to be visible */
  content: "";
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #151515;
  border: none;
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' viewBox='0 0 352 512'%3E%3Cpath d='m242.7 256 100-100a31.5 31.5 0 0 0 0-44.5l-22.2-22.3a31.5 31.5 0 0 0-44.4 0L176 189.2 76 89.3a31.5 31.5 0 0 0-44.5 0L9.2 111.5a31.5 31.5 0 0 0 0 44.4l100 100.1-100 100a31.5 31.5 0 0 0 0 44.5l22.3 22.3a31.5 31.5 0 0 0 44.4 0l100.1-100 100 100a31.5 31.5 0 0 0 44.5 0l22.3-22.2a31.5 31.5 0 0 0 0-44.5L242.8 256z'/%3E%3C/svg%3E");
  mask-size: 1rem 1rem;
  opacity: 0.6;
}

.host-remove:focus::before,
.host-remove:hover::before {
  opacity: 1;
}

/* Mobile-specific */
@media (max-width: 1023px) {
  body.login-pf {
    justify-items: center;
  }

  #badge {
    background-position: center;
    margin: 2rem;
  }
}

/* Desktop-specific */
@media (min-width: 1024px) {
  body.login-pf {
    grid-template-areas:
      ". banner  banner ."
      ". .       .      ."
      ". login   logo   ."
      ". details logo   ."
      ". recent  logo   ."
      ". .       .      .";
    grid-template-rows: auto 1fr minmax(min-content, max-content) repeat(2, auto) 1fr;
    grid-template-columns: minmax(0, 1fr) repeat(2, minmax(auto, 34rem)) minmax(0, 1fr);
    grid-gap: 0 4rem;
  }
}

.unsupported-browser ul {
  color: #555;
  margin: 0 0 1rem;
}

.browser-recommendations {
  margin: 1rem 0 0;
}

.browser-recommendations h3 {
  font: inherit;
  margin-top: 0;
}

.dialog-error {
  margin: 0 0 1rem;
}

#login-again {
  display: block;
  margin-top: 1rem;
}

.password-with-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
}

.pf-c-button.login-password-toggle {
  display: flex;
  align-items: center;
  border-left-width: 0;
}

.login-password-toggle > svg {
  height: 1rem;
  width: auto;
}

/* Show the appropriate eye icon based on the password text status */
input[type="text"] + .login-password-toggle .password-show,
input[type="password"] + .login-password-toggle .password-hide {
  display: none;
}

.pf-c-helper-text {
  margin-top: 1rem;
}

.pf-c-helper-text.pf-m-warning {
  color: #795600;
}

/* Dark */
.pf-theme-dark {
  .login-pf .container,
  .login-pf .details {
    z-index: 2;
  }

  .login-pf .container {
    background: #26292d;
    color: #f0f0f0;
  }

  .login-pf .details {
    background: #151515;
    color: #f0f0f0;
  }

  .pf-c-button.pf-m-control,
  .form-control[type="password"],
  .form-control[type="text"] {
    background: #393f44;
    border-color: #393f44;
    border-bottom-color: #6c6f72;
    color: #f0f0f0;
  }

  a,
  a:active,
  a:focus,
  a:hover,
  summary {
    color: #8ac0f6;
  }

  .input-clear,
  .inline .container .help-block {
    color: #f0f0f0;
  }

  .host-line {
    border-color: #34373b;
  }

  /* The × icon's focus ring */
  .host-remove:focus {
    outline-color: #f1f1f1;
  }

  /* The × icon */
  .host-remove::before {
    background-color: #f1f1f1;
  }

  .unsupported-browser ul {
    color: #999;
  }

  .pf-c-alert.pf-m-inline.pf-m-danger {
    background: #1e2125;
    border-color: #fe5142;
  }

  .pf-c-alert.pf-m-danger > svg,
  .pf-c-alert.pf-m-danger .pf-c-alert__title {
    color: #fe5142;
  }

  .pf-c-button[disabled] {
    background-color: #444548;
    border-color: #444548;
    color: #c6c7c8;
  }

  /* Screen the background and logo darker */
  .login-pf::after {
    /* Pass through mouse events */
    pointer-events: none;
    background: #000;
    opacity: 0.66;
    display: block;
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
  }

  .pf-c-helper-text.pf-m-warning {
    color: #f0ab00;
  }
}

/* Animation */

@keyframes rotation {
  from {
    transform: rotate(0);
  }

  to {
    transform: rotate(359deg);
  }
}
