/* === PAGE LAYOUT === */

body {
  margin: 0;
  padding: 0;
  background-color: #000;
  color: white;
  font-family: Arial, sans-serif;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;

  /* Fade-in / fade-out */
  opacity: 0;                          /* start invisible */
  transition: opacity 2.0s ease;       /* adjust fade speed here */
}

/* Put fade-out first; loaded will override it */
body.fade-out {
  opacity: 0;
}

body.loaded {
  opacity: 1 !important;               /* loaded always wins if both are present */
}

/* === CONTAINER === */

.center-container {
  position: relative;
  width: min(500px, 92vw);
  height: auto;
}

/* === LOGO === */

.logo {
  opacity: 0;
  transition: opacity 1.5s ease;
  cursor: pointer;
  width: 100%;
  height: auto;
  position: relative;
  z-index: 1;
}

.logo.visible {
  opacity: 1;
}

.logo.faded {
  opacity: 0.15;
}

.logo.visible:not(.faded):hover {
  filter: brightness(0) saturate(100%) invert(100%);
}

/* Mobile: shrink and cap the logo size */
@media (max-width: 600px) {
  .logo {
    display: block;
    margin: 0 auto;       /* center the image */
    width: auto;          /* let height cap drive size if needed */
    max-width: 80vw;      /* never wider than 80% of viewport */
    max-height: 40vh;     /* never taller than 40% of viewport */
  }
}

/* Extra small phones */
@media (max-width: 360px) {
  .logo {
    max-width: 75vw;
    max-height: 36vh;
  }
}

/* === LOGIN (username + password) === */

#password-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  width: min(340px, 90vw);             /* fit both fields nicely */
}

#password-container.show {
  opacity: 1;
  visibility: visible;
}

#password-container input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: none;
  background-color: black;
  color: white;
  outline: none;
  box-sizing: border-box;
  text-align: center;
}

/* Space between Username and Password fields */
#password-container input + input {
  margin-top: 10px;
}

/* Small UX touch for placeholders */
#password-container input::placeholder {
  color: #aaa;
}

/* Remove focus ring/box */
#password-container input:focus,
#password-container input:focus-visible {
  outline: none;
  outline-offset: 0;
  box-shadow: none;
}

.error-message {
  color: white;
  font-size: 14px;
  margin-top: 16px;
  text-align: center;
  min-height: 1.2em;                   /* reserves space to avoid layout shift */
}


