*,
*::before,
*::after {

    /* apply a traditional box layout model to all elements */
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;

}

/* Colours and the font live in theme.css, which loads before this file */

html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--header-start);
  background-color: color-mix(in srgb, var(--header-start), var(--header-end));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* The login screen never scrolls or bounces: pin the body to the viewport */
body{
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background-color: var(--header-start);
  background-color: color-mix(in srgb, var(--header-start), var(--header-end));
  background-image: linear-gradient(90deg, var(--header-start) 0%, var(--header-end) 100%);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}


/* It's an app, not a document: no text selection or long-press callouts anywhere,
   except where you type */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

@keyframes rotate {
  0% {	transform: rotate(0deg) scale(1.9);		}
  25% {	transform: rotate(90deg) scale(2.2);	}
  50% {	transform: rotate(180deg) scale(1.9);	}
  75% {	transform: rotate(270deg) scale(2.2);	}
  100% {	transform: rotate(360deg) scale(1.9);	}
}

#container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  text-align: center;
  padding: 24px 16px;
  padding: calc(24px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px));
  color: var(--text-color);
}

#container > br {
  display: none;
}

#logo {
  position: relative;
  width: 100%;
  max-width: 70vw;
  max-width: min(70vw, 420px, 45vh);
  max-width: min(70vw, 420px, 45dvh);
  flex-shrink: 1;
}

/* Logo image (each skin can supply its own) */
#logo img {
  display: block;
  width: 100%;
  height: auto;
}


.header{
  position: relative;
  min-height: 48px;
  width: 100%;
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.header div {
  color: var(--text-color);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  width: 100%;
  max-width: 22em;
  margin: 0 auto;
}

.admin {
  position: relative;
  float:right;
  margin: 5px;
}

.login{
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 480px;
}

.login form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login form br {
  display: none;
}

.login input {
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.login input[type=text]{
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--outline, rgba(255,255,255,0.55));
  border-radius: 0;
  color: var(--text-color);
  font-weight: bold;
  padding: 8px 4px;
  /* 16px minimum stops iOS zooming in on focus */
  font-size: 28px;
  font-size: clamp(24px, 7.4vw, 40px);
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

/* The hint reads as a hint, not as a shouted code */
.login input[type=text]::placeholder {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.login input[type=text]::-webkit-input-placeholder {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.login input[type=text]:focus{
  outline: none;
  border-bottom-color: var(--text-color);
  background: rgba(255,255,255,0.06);
}

.login input[type=submit]{
  margin-top: 32px;
  min-height: 60px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--header-start, #4B18A9);
  font-size: 20px;
  font-weight: 700;
  border-radius: var(--radius, 14px);
  background: #FFFFFF;
  border: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.login input[type=submit]:active{
  opacity: 0.85;
  transform: scale(0.98);
}

.login input[type=password]:focus{
  outline: none;
  border: 1px solid rgba(255,255,255,0.9);
}

.login input[type=submit]:focus-visible{
  outline: 2px solid var(--text-color);
  outline-offset: 2px;
}

/* Phones in landscape: tighten up so everything still fits without scrolling */
@media (max-height: 500px) {
  #container {
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  #logo {
    max-width: min(50vw, 300px, 32vh);
    max-width: min(50vw, 300px, 32dvh);
  }

  .header {
    min-height: 28px;
    margin: 4px 0;
  }

  .login input[type=text] {
    font-size: 22px;
    padding: 4px;
  }

  .login input[type=submit] {
    margin-top: 12px;
    min-height: 48px;
    padding: 8px 16px;
    font-size: 20px;
  }
}

::-webkit-input-placeholder{
 color: var(--muted-text-color);
}

::placeholder{
 color: var(--muted-text-color);
}
