/* ============================================================
   WWWPASS auth pages (login + signup)
   Own clean-room stylesheet — classic WWWPASS look.
   No frameworks, no icon fonts, no external dependencies.
   ============================================================ */

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

@keyframes spinner {
  0%   { transform: rotateZ(0deg); }
  100% { transform: rotateZ(359deg); }
}

body {
  font-family: "Open Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
  background: url("https://wwwpass.com/images/bg.jpg") 50% / cover fixed;
}

.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 40, 68, 0.85);
}

/* ---------- Card ---------- */
.login, .signup {
  position: relative;
  width: 90%;
  max-width: 320px;
  background: #ffffff;
  border-radius: 2px 2px 5px 5px;
  padding: 10px 20px 80px 20px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.login .title, .signup .title {
  color: #444;
  font-size: 1.2em;
  font-weight: 700;
  margin: 10px 0 30px 0;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

/* ---------- Fields ---------- */
.field {
  position: relative;
}

.login input, .signup input {
  display: block;
  width: 100%;
  padding: 15px 10px;
  margin-bottom: 4px;
  border: 1px solid #ddd;
  border-radius: 2px;
  color: #ccc;
  font: inherit;
  transition: border-width 0.2s ease;
}

.hint {
  margin: 0 2px 12px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #98a4b3;
}

.field:focus-within + .hint {
  color: #2196F3;
}

.login input:focus, .signup input:focus {
  outline: none;
  color: #444;
  border-color: #2196F3;
  border-left-width: 35px;
}

/* Icon: inline SVG, explicit box, margin-centered — no fonts, no transforms */
.field .icon {
  position: absolute;
  top: 50%;
  left: -20px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: left 0.25s ease-out, opacity 0.25s ease-out;
}

.field:focus-within .icon {
  opacity: 1;
  left: 10px;
}

/* ---------- Links ---------- */
.login a, .signup a {
  font-size: 0.8em;
  color: #2196F3;
  text-decoration: none;
}

/* ---------- Button ---------- */
.login button, .signup button {
  display: block;
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-height: 60px;
  padding: 10px;
  margin-top: 20px;
  background: #2196F3;
  color: #fff;
  border: 0 solid rgba(0, 0, 0, 0.1);
  border-bottom-width: 7px;
  border-radius: 0 0 2px 2px;
  font: inherit;
  cursor: pointer;
  transform: rotateZ(0deg);
  transition: all 0.1s ease-out;
}

.login button .spinner, .signup button .spinner {
  display: block;
  position: absolute;
  left: 50%;
  top: 0;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  margin-top: -20px;
  border: 4px solid #ffffff;
  border-top-color: rgba(255, 255, 255, 0.3);
  border-radius: 100%;
  opacity: 0;
  animation: spinner 0.6s infinite linear;
  transition: top 0.3s 0.3s ease, opacity 0.3s 0.3s ease, border-radius 0.3s ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

/* states driven by login-script.js / signup-script.js */
.login.loading button, .signup.loading button {
  max-height: 100%;
  padding-top: 50px;
}
.login.loading button .spinner, .signup.loading button .spinner {
  opacity: 1;
  top: 40%;
}
.login.ok button, .signup.ok button {
  background-color: #8bc34a;
}
.login.ok button .spinner, .signup.ok button .spinner {
  border-radius: 0;
  border-top-color: transparent;
  border-right-color: transparent;
  height: 20px;
  animation: none;
  transform: rotateZ(-45deg);
}
.login.nok button, .signup.nok button {
  background-color: #C34A4A;
}
.login.nok button .spinner, .signup.nok button .spinner {
  border-radius: 0;
  border-top-color: #fff;
  border-bottom-color: #fff;
  border-left-color: transparent;
  border-right-color: transparent;
  height: 20px;
  animation: none;
  transform: rotateZ(90deg);
}
.login:not(.loading) button:hover, .signup:not(.loading) button:hover {
  box-shadow: 0 1px 3px #2196F3;
}
.login:not(.loading) button:focus, .signup:not(.loading) button:focus {
  border-bottom-width: 4px;
}

/* ---------- Footer ---------- */
footer {
  display: block;
  padding-top: 50px;
  text-align: center;
  color: #ddd;
  font-size: 0.8em;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
}
footer a, footer a:link {
  color: #fff;
  text-decoration: none;
}
