@import url("moepi-theme.css");

body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  min-height: 100vh;
  background: #ffffff;
  position: relative;
  overflow-x: hidden;
}

body.auth-page--tall {
  align-items: flex-start;
  padding: 48px 20px;
}

.auth-card {
  position: relative;
  z-index: 1;
  max-width: 580px;
  width: 100%;
  background: var(--moepi-surface);
  padding: 44px 48px 36px;
  border-radius: 18px;
  box-shadow: var(--moepi-shadow-md);
  border: 1px solid var(--moepi-border);
  border-top: var(--moepi-accent-top);
  overflow: hidden;
}

.auth-card--wide {
  max-width: 580px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
  line-height: 0;
}

.auth-logo img {
  height: 280px;
  width: auto;
  max-width: 100%;
  display: inline-block;
  border: none;
  outline: none;
  box-shadow: none;
  filter: none;
  background: transparent;
  vertical-align: middle;
}

.auth-title {
  text-align: center;
  margin-bottom: 8px;
  font-size: 1.5rem;
  color: var(--moepi-text);
  font-weight: 700;
}

.auth-subtitle {
  text-align: center;
  margin: 0 0 28px;
  font-size: 0.95rem;
  color: var(--moepi-text-secondary);
  line-height: 1.55;
}

.auth-subtitle strong {
  color: var(--moepi-text);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--moepi-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-wrapper {
  position: relative;
}

.form-group input[type="text"]:not(.otp-input),
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
  width: 100%;
  padding: 13px 15px;
  font-size: 0.95rem;
  border-radius: var(--moepi-radius);
  border: 1px solid var(--moepi-border);
  color: var(--moepi-text);
  background: #ffffff;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:has(.toggle-password) input {
  padding-right: 44px;
}

.form-group input:focus:not(.otp-input),
.form-group select:focus {
  outline: none;
  border-color: var(--moepi-lime);
  box-shadow: 0 0 0 4px rgba(200, 223, 22, 0.22);
}

.form-group input::placeholder {
  color: var(--moepi-text-muted);
}

.auth-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--moepi-text-muted);
  line-height: 1.4;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--moepi-text-muted);
  width: 20px;
  height: 20px;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  stroke: var(--moepi-lime-hover);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--moepi-radius-pill);
  cursor: pointer;
  border: none;
  background: var(--moepi-lime);
  color: var(--moepi-text);
  margin-top: 10px;
  font-family: inherit;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-btn:hover {
  background: var(--moepi-lime-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px var(--moepi-lime-glow);
  color: var(--moepi-text);
}

.extra-links {
  margin-top: 22px;
  text-align: center;
  padding-top: 22px;
  border-top: 1px solid var(--moepi-border);
}

.extra-links a {
  color: var(--moepi-text);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 2px solid var(--moepi-lime);
  padding-bottom: 2px;
}

.extra-links a:hover {
  color: var(--moepi-lime-hover);
  border-bottom-color: var(--moepi-lime-hover);
}

.branding {
  text-align: center;
  margin-top: 22px;
  font-size: 0.75rem;
  color: var(--moepi-text-muted);
}

.user-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 auto 22px;
  max-width: 100%;
  flex-wrap: wrap;
}

.user-toggle button {
  flex: 0 0 auto;
  min-width: 0;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--moepi-border);
  background: #ffffff;
  color: var(--moepi-text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.user-toggle button:hover:not(.active) {
  background: var(--moepi-lime-soft);
  border-color: var(--moepi-lime);
  color: var(--moepi-text);
}

.user-toggle button.active {
  color: var(--moepi-text);
  border-color: var(--moepi-lime);
  background: var(--moepi-lime);
  box-shadow: none;
}

#studentBtn.active,
#graduateBtn.active,
#adminBtn.active {
  background: var(--moepi-lime);
}

.hidden {
  display: none !important;
}

.otp-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.form-group .otp-input {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 52px;
  padding: 0;
  flex: 0 0 48px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: var(--moepi-radius);
  border: 2px solid #c8c8c8;
  color: var(--moepi-text);
  background: #ffffff;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group .otp-input:focus {
  outline: none;
  border-color: var(--moepi-lime);
  box-shadow: 0 0 0 4px rgba(200, 223, 22, 0.22);
}

.resend-link {
  margin-top: 18px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--moepi-text-secondary);
}

.resend-link button {
  color: var(--moepi-text);
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  border-bottom: 2px solid var(--moepi-lime);
}

.resend-link button:hover {
  color: var(--moepi-lime-hover);
  border-bottom-color: var(--moepi-lime-hover);
}

.auth-qr-wrap {
  text-align: center;
  margin-bottom: 22px;
}

.auth-qr-wrap img {
  max-width: 220px;
  width: 100%;
  border-radius: var(--moepi-radius);
  border: 1px solid var(--moepi-border);
  padding: 10px;
  box-shadow: var(--moepi-shadow);
}

@media (max-width: 480px) {
  .auth-card,
  .auth-card--wide {
    max-width: 100%;
    padding: 36px 26px 30px;
  }

  .auth-logo img {
    height: 200px;
  }

  .user-toggle {
    gap: 6px;
  }

  .user-toggle button {
    flex: 1 1 calc(33.333% - 6px);
    padding: 8px 10px;
    font-size: 0.75rem;
  }
}
