/* Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: #1d1d1d;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  font-size: 14px;
}

.top-button-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.container {
  background-color: #2d2d2d;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  text-align: center;
  max-width: 400px;
  width: 100%;
}

/* Typography */
h1 {
  color: white;
  margin-bottom: 20px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
}

h2 {
  color: white;
  margin-bottom: 20px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
}

/* Logo */
.logo {
  width: 120px;
  margin-bottom: 20px;
}

/* Deployment Badge */
.deployment-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  padding: 8px 15px;
  background-color: rgba(149, 117, 205, 0.15);
  border-radius: 10px;
  border: 1px solid rgba(149, 117, 205, 0.3);
}

.deployment-label {
  font-size: 16px;
  font-weight: 500;
  color: #a0a0a0;
  margin-right: 8px;
  line-height: 24px;
}

.deployment-name {
  color: #9575cd;
  font-size: 18px;
  font-weight: 600;
  display: inline-block;
  min-height: 24px;
  min-width: 80px;
  line-height: 24px;
  padding-top: 2px;
  vertical-align: middle;
}

/* Buttons */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 15px;
  text-align: center;
}

.button.primary {
  background-color: #9575cd;
  color: white;
}

.button.primary:hover {
  background-color: #7e57c2;
}

.button.secondary {
  background-color: transparent;
  color: #9575cd;
  border: 2px solid #9575cd;
}

.button.secondary:hover {
  background-color: rgba(149, 117, 205, 0.1);
  border-color: #7e57c2;
  color: #7e57c2;
}

/* Resend code button states */
.button.disabled-timer {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background-color: transparent;
  color: #666;
  border-color: #666;
}

.button.success-checkmark {
  background-color: #4caf50 !important;
  color: white !important;
  border-color: #4caf50 !important;
  pointer-events: none;
}

/* Form Elements */
input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #424242;
  border-radius: 4px;
  font-size: 16px;
  background-color: #1d1d1d;
  color: white;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

input:focus {
  outline: none;
  border-color: #9575cd;
  box-shadow: 0 0 0 2px rgba(149, 117, 205, 0.2);
}

/* Autofill styles */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: white !important;
  -webkit-box-shadow: 0 0 0 30px #2d2d2d inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Password Strength */
#passwordStrength {
  height: 5px;
  margin-bottom: 15px;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

#passwordStrengthNew {
  height: 5px;
  margin-bottom: 15px;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* Policy Text */
.policy {
  font-size: 12px;
  color: #858585;
  margin-top: 20px;
}

.policy a {
  color: #9575cd;
  text-decoration: none;
}

.policy a:hover {
  text-decoration: underline;
}

/* Password Match Message */
#passwordMatch {
  color: #ff4d4d;
  font-size: 14px;
  margin-bottom: 15px;
}

#passwordMatch.match {
  color: #4CAF50;
}

#passwordMatchNew {
  color: #ff4d4d;
  font-size: 14px;
  margin-bottom: 15px;
}

#passwordMatchNew.match {
  color: #4CAF50;
}

/* Account Created Section */
#accountCreatedSection {
  text-align: center;
}

#accountCreatedSection h2 {
  margin-bottom: 15px;
  /* Adjusted margin */
}

#accountCreatedSection p {
  margin-bottom: 20px;
  font-size: 16px;
  /* Slightly larger for emphasis */
  color: #a0a0a0;
}

/* Loading Overlay */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#loadingOverlay.hidden {
  display: none;
}

.loader {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #9575cd;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Password Reset Sections */
#resetPasswordRequestSection,
#resetPasswordSection {
  text-align: center;
}

#resetPasswordRequestSection h2,
#resetPasswordSection h2 {
  margin-bottom: 15px;
}

#resetPasswordRequestSection p,
#resetPasswordSection p {
  margin-bottom: 20px;
  font-size: 14px;
  color: #a0a0a0;
}

#forgotPasswordLink,
#backToPasswordLink {
  display: block;
  text-align: center;
  color: #9575cd;
  text-decoration: none;
  font-size: 14px;
  margin-top: 10px;
}

#forgotPasswordLink:hover,
#backToPasswordLink:hover {
  text-decoration: underline;
}

/* Admin Contact Section */
#adminContactSection {
  text-align: center;
}

#adminContactSection h2 {
  margin-bottom: 20px;
}

#adminContactSection p {
  margin-bottom: 15px;
  font-size: 16px;
  color: #a0a0a0;
}

/* Utility Classes */
.hidden {
  display: none;
}

/* Error/Success Message Area */
.error-message-area {
  border-radius: 8px;
  padding: 12px 40px 12px 16px;
  margin-bottom: 20px;
  position: relative;
  text-align: left;
  animation: messageSlideIn 0.3s ease-out;
}

.error-message-area.error-message {
  background-color: rgba(255, 77, 77, 0.15);
  border: 1px solid rgba(255, 77, 77, 0.4);
}

.error-message-area.success-message {
  background-color: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.4);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-message-area #errorMessageText {
  font-size: 14px;
  line-height: 1.4;
  display: block;
}

.error-message-area.error-message #errorMessageText {
  color: #ff6b6b;
}

.error-message-area.success-message #errorMessageText {
  color: #4CAF50;
}

.error-dismiss-button {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.error-message-area.error-message .error-dismiss-button {
  color: #ff6b6b;
}

.error-message-area.success-message .error-dismiss-button {
  color: #4CAF50;
}

.error-dismiss-button:hover {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 480px) {
  .container {
    padding: 30px 20px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }
}

/* Selection style */
::selection {
  background-color: #33006eff;
}

#signupEmailField {
  cursor: pointer;
}

/* Password email field (readonly) */
#passwordEmailField {
  background-color: #2a2a2a;
  color: #a0a0a0;
  cursor: pointer;
  border-color: #333;
}

#passwordEmailField:focus {
  border-color: #333;
  box-shadow: none;
}

/* Password email container - clickable */
#passwordEmailContainer {
  cursor: pointer;
}

#passwordEmailContainer:hover #passwordEmailField {
  background-color: #333333;
}

/* Reset password email field (readonly, non-clickable) */
#resetPasswordEmailField {
  background-color: #2a2a2a;
  color: #a0a0a0;
  cursor: not-allowed;
  border-color: #333;
}

#resetPasswordEmailField:focus {
  border-color: #333;
  box-shadow: none;
}

/* Reset password email container - not clickable */
#resetPasswordEmailContainer {
  cursor: not-allowed;
}

/* Password section layout */
#passwordSection:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.verification-email-paragraph {
  margin-bottom: 12px;
}

/* Email verification section layout */
#emailVerificationSection:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Reset Password Success Message */
#resetPasswordSuccessMessage {
  margin-bottom: 20px;
}

#resetPasswordSuccessText {
  color: #a8d5aa;
  line-height: 1.6;
  margin: 0;
}

/* Temporary Password Section */
#tempPasswordStrength {
  height: 5px;
  margin-bottom: 15px;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

#tempPasswordMatch {
  color: #ff4d4d;
  font-size: 14px;
  margin-bottom: 15px;
}

#tempPasswordMatch.match {
  color: #4CAF50;
}

/* Top bar for pages with back navigation */
.top-bar:not(.hidden) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;

  margin-bottom: 20px;
}

/* Back button */
.back-button {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #9575cd;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}

.back-button:hover {
  text-decoration: underline;
}

/* Wallet balance display */
.wallet-balance {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  background: #f5f5f5;
  padding: 8px 16px;
  border-radius: 20px;
}

/* Table loading indicator */
.table-loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #666;
}

.table-loading-indicator p {
  margin-top: 16px;
  font-size: 14px;
}

/* OAuth Providers */
#thirdPartyAuthWrapper {
  margin-bottom: 20px;
}

/* OAuth Section */
#oauthAuthSection:not(.hidden) {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.oauth-provider-container {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.oauth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  border: 1px solid #424242;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: #1d1d1d;
  color: white;
}

.oauth-button:hover {
  background-color: #2a2a2a;
  border-color: #555;
}

.oauth-button svg {
  flex-shrink: 0;
}

.microsoft-button:hover {
  background-color: #2a2a2a;
}

.github-button:hover {
  background-color: #24292e;
}

.apple-button:hover {
  background-color: #2a2a2a;
}

/* Divider do not change margin*/
.divider {
  text-align: center;
  margin: 0 0 12px 0;
  color: #666;
  position: relative;
}

.divider span {
  background: #2d2d2d;
  padding: 0 10px;
  position: relative;
  z-index: 1;
  font-size: 14px;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #424242;
  z-index: 0;
}

/* ============================================================================
   MFA Styles
   ============================================================================ */

#mfaChallengeDescription {
  margin-bottom: 20px;
}

.mfa-method-selector:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.mfa-method-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mfa-qr-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.mfa-qr-container img {
  border-radius: 8px;
  background: white;
  padding: 8px;
}

.mfa-manual-key-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 4px;
}

.mfa-manual-key {
  display: block;
  background-color: #3d3d3d;
  color: #e0e0e0;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 2px;
  word-break: break-all;
  text-align: center;
  margin-bottom: 20px;
  user-select: all;
}

.mfa-recovery-link {
  margin-top: 15px;
  text-align: center;
}

.mfa-recovery-link a {
  color: #888;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.mfa-recovery-link a:hover {
  color: #bbb;
}

.mfa-skip-link {
  display: block;
  text-align: center;
  color: #888;
  font-size: 13px;
  text-decoration: underline;
  margin-top: 15px;
  cursor: pointer;
}

.mfa-skip-link:hover {
  color: #bbb;
}
