/*
Material design recommends #121212 as dark theme surface color.
High-emphasis text should have an opacity of 87%
Medium emphasis text is applied at 60%
Disabled text uses an opacity of 38%.
*/

@media (prefers-color-scheme: dark) {
  :root {
    --desktop-font-size: 16px;
    --mobile-font-size: 16px;
    --background-color: #343a40;
    --disabled-color: #888;
    --text-color: #000;
    --error-color: #f44336;
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --desktop-font-size: 16px;
    --mobile-font-size: 16px;
    --background-color: #fff;
    --disabled-color: #888;
    --text-color: #000;
    --error-color: #b00020;
  }
}

html,
body {
  height: calc(100% - 10px);
  margin: 0;
}

body {
  background-color: var(--background-color);
  font-family: "Roboto", "Open sans", sans-serif;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-noscript {
  background: #ffcc00;
  color: #111;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 600;
  margin-bottom: 18px;
  text-align: center;
}

button {
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 2px;
  color: #fff;
  cursor: pointer;
  display: block;
  font-size: 22px;
  /* fallback */
  font-size: var(--mobile-font-size);
  font-weight: 500;
  margin: 3px 0 0 0;
  padding: 10px;
}

button:hover {
  background-color: #ccc;
  color: black;
}

button#signin {
  margin: 0px 0 0 0;
}

button#toggle-password {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 300;
  padding: 0;
  /* Display at the top right of the password section */
  position: absolute;
  top: -4px;
  right: -2px;
}

div#password-constraints {
  margin: 5px 0 0 0;
  font-size: 16px;
}

form {
  margin: 0 auto;
  max-width: 500px;
  text-align: center;
  border: 1px solid rgba(200, 200, 200, 0.75);
  border-radius: 8px;
  padding: 28px 24px;
}

@media (max-width: 640px) {
  form {
    border: none;
    box-shadow: none;
  }
}

.login-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 6px auto;
  flex-wrap: nowrap;
  width: fit-content;
  max-width: 100%;
  flex-direction: row;
}

.login-brand > * {
  flex: 0 0 auto;
}

.chatapp-logo {
  display: block;
  margin: 0;
}

h1 {
  font-size: 30px;
  font-weight: 600;
  font-weight: 700;
  margin: 0 0 20px 0;
  padding: 0;
  line-height: 1.05;
  position: relative;
  display: flex;
  align-items: center;
  white-space: nowrap;
  color: rgb(25, 118, 210);
}

.login-brand h1::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  border-bottom: 1px solid rgb(25, 118, 210);
}

@media (max-width: 480px) {
  .chatapp-logo {
    width: 72px;
    height: 72px;
  }

  .login-brand {
    gap: 10px;
  }

  .login-brand h1 {
    font-size: 24px;
  }
}

input {
  outline: none;
  font-size: 22px;
  /* fallback */
  font-size: var(--mobile-font-size);
  padding: 10px;
  width: 90%;
  /* fallback */
  width: calc(100% - 68px);
  /* full width minus padding */
  border: 2px solid #ccc;
  border-radius: 10px;
  color: var(--text-color);
}

input:focus {
  border: 2px solid rgb(25, 118, 210);
}

input:disabled {
  border: 2px solid #ccc;
}

input[type="email"]:not(:focus):invalid,
input[type="password"]:not(:focus):invalid {
  color: red;
  outline-color: red;
}

button {
  font-size: 22px;
  /* fallback */
  font-size: var(--mobile-font-size);
  padding: 10px;
  width: 100%;
  border-radius: 10px;
  /* fallback */
  /* full width minus padding */
  background-color: rgb(25, 118, 210);
}

label {
  display: block;
  font-size: 20px;
  font-size: var(--mobile-font-size);
  font-weight: 500;
  margin: 0 0 3px 0;
}

form section {
  margin: 0 0 20px 0;
  position: relative;
  color: rgb(25, 118, 210);
}

#reset-status {
  display: block;
  margin: 15px 0 0 0;
  font-size: 11px;
  color: var(--text-color);
}

img.eye_visible {
  float: right;
  margin-left: -25px;
  margin-top: -44px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

img.eye_visible:hover {
  opacity: 1;
}

section#error {
  /* fallback */
  /* var(--desktop-font-size); */
  overflow-x: hidden;
  width: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px;
  color: var(--error-color);
}

@media (min-width: 450px) {
  body {
    margin: 0;
  }

  button {
    font-size: 14px;
    /* fallback */
    font-size: var(--desktop-font-size);
  }

  button#signin {
    margin: 40px 0 0 0;
  }

  div#password-constraints {
    font-size: 14px;
  }

  h1 {
    font-size: 28px;
    font-size: calc(2 * var(--desktop-font-size));
    font-weight: 500;
    margin: 0 0 20px 0;
  }

  input {
    font-size: 14px;
    /* fallback */
    font-size: var(--desktop-font-size);
  }

  label {
    font-size: 14px;
    /* fallback */
    font-size: var(--desktop-font-size);
  }
}

@media (min-width: 800px) and (min-height: 580px) {
  body {
    margin: 0px;
  }

  form {
    box-shadow: 4px 6px rgba(200, 200, 200, 0.1);
    margin: 0px auto;
    padding: 10px;
    max-width: 500px;
    border: 1px solid rgba(200, 200, 200, 0.5);
  }
}

@media (max-height: 385px) {
  .chatapp-logo {
    width: 128px;
    height: 128px;
  }
  h1 {
    margin: 0 0 20px 0;
  }
}

input {
  padding-right: 50px;
}

hr {
  border: none;
  border-top: 1px double rgb(25, 118, 210);
  color: rgb(25, 118, 210);
  overflow: visible;
  text-align: center;
  height: 1px;
  margin: 0 0 20px 0;
}

hr:after {
  background: var(--background-color);
  color: rgb(25, 118, 210);
  content: " or ";
  padding: 0 20px;
  position: relative;
  top: -11px;
}

.register {
  width: 100%;
  text-align: center;
  margin: 0 auto;
  color: rgb(25, 118, 210);
}

footer {
  width: 100%;
  text-align: center;
  margin: 0 auto;
}

.separator:before {
  content: " | ";
  margin: 0 8px;
}

a:link,
a:visited {
  color: rgb(25, 118, 210);
}

a:hover,
a:active {
  color: #ccc;
}
