/* Orochi Auth Pages — signin, signup, logout */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1d21;
  color: #d1d2d3;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 16px;
  box-sizing: border-box;
}

/* Short viewport (e.g. mobile landscape 390h): stop vertical-centering so
   the logo/title don't clip above viewport when card > winHeight. */
@media (max-height: 600px) {
  body {
    align-items: flex-start;
    padding-top: 16px;
    padding-bottom: 16px;
  }
}

.auth-card {
  background: #222529;
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.auth-card .logo {
  display: block;
  margin: 0 auto 0.5rem;
  width: 80px;
  height: 80px;
  border-radius: 12px;
}
.auth-card h1 {
  text-align: center;
  margin-bottom: 0.3rem;
  color: #f8f7f5;
  font-size: 1.5rem;
}

.auth-card .subtitle {
  text-align: center;
  color: #888;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Form fields */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  color: #aaa;
  font-size: 0.85rem;
}

.form-group input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #444;
  border-radius: 4px;
  background: #1a1d21;
  color: #f8f7f5;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: #4a9eff;
}

.form-group .helptext {
  color: #666;
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

/* Password visibility toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 2.5rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem;
  line-height: 1;
}

.password-toggle:hover {
  color: #ccc;
}

.password-toggle .eye-closed {
  display: none;
}

.password-toggle.active .eye-open {
  display: none;
}

.password-toggle.active .eye-closed {
  display: block;
}

/* Buttons */
.btn {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  display: block;
  text-decoration: none;
}

.btn-primary {
  background: #4a9eff;
  color: #f8f7f5;
}

.btn-primary:hover {
  background: #3a8eef;
}

.btn-sso {
  background: #2ea44f;
  color: #f8f7f5;
  margin-bottom: 0.5rem;
}

.btn-sso:hover {
  background: #268a3e;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 1.2rem 0;
  color: #666;
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #444;
}

.divider span {
  padding: 0 0.8rem;
}

/* Social login buttons */
.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0;
}

.social-buttons form {
  margin: 0;
}

.btn-social {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
  display: block;
  text-decoration: none;
  background: #2a2d31;
  color: #d1d2d3;
}

.btn-social:hover {
  background: #353840;
  border-color: #555;
}

.btn-scitex {
  background: #2ea44f;
  color: #f8f7f5;
  border-color: #2ea44f;
}

.btn-scitex:hover {
  background: #268a3e;
}

.btn-google {
  border-color: #4285f4;
}

.btn-google:hover {
  background: #1a3a5c;
  border-color: #4285f4;
}

.btn-orcid {
  border-color: #a6ce39;
}

.btn-orcid:hover {
  background: #2a3518;
  border-color: #a6ce39;
}

/* Messages */
.error {
  background: #3b1c1c;
  color: #f44;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.success {
  background: #1c3b1c;
  color: #4f4;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

/* Footer links */
.auth-footer {
  text-align: center;
  margin-top: 1.2rem;
  color: #888;
  font-size: 0.85rem;
}

.auth-footer a {
  color: #4a9eff;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Password rules */
.password-rules {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: #666;
}

.password-rules li {
  list-style: none;
  padding: 0.1rem 0;
}

.password-rules li.unmet {
  color: #888;
}

.password-rules li.unmet::before {
  content: "\2717 ";
  color: #f44;
}

.password-rules li.met {
  color: #4f4;
}

.password-rules li.met::before {
  content: "\2713 ";
}

/* Mobile auth pages — scale cards for narrow screens */
@media (max-width: 500px) {
  body {
    padding: 16px;
    align-items: flex-start;
    padding-top: 10vh;
  }
  .auth-card {
    max-width: 100%;
    padding: 1.5rem;
    border-radius: 8px;
  }
  .auth-card .logo {
    width: 64px;
    height: 64px;
  }
  .auth-card h1 {
    font-size: 1.3rem;
  }
  .form-group input {
    padding: 0.7rem 0.8rem;
    font-size: 16px;
    min-height: 44px;
  }
  .btn {
    padding: 0.8rem;
    min-height: 44px;
    font-size: 1rem;
  }
  .btn-social {
    padding: 0.7rem;
    min-height: 44px;
  }
  .password-toggle {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
