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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  color: white;
  background: var(--bg-darkest);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* height: 100vh; */
  width: 100vw;
  overflow: hidden;
  position: fixed;
}

/* Login page styles */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
}

.login-form-container {
  display: flex;
  flex-direction: column;
  padding: 0px 1.5rem;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 450px;
  width: 100%;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(-20px);
}

.login-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 0.3rem;
  padding-bottom: 1.3rem;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.app-logo {
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin: 0;
  text-shadow: 0 1px 2px var(--black-20);
  display: flex;
  align-items: center;
  padding-right: 10px;
}

.logo-image {
  width: 220px;
  margin-bottom: 15px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  vertical-align: middle;
  margin-right: 12px;
}

.error-message {
  background: var(--red-70);
  border-left: 3px solid var(--red-alt);
  color: var(--red-alt);
  padding: 0.8rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  opacity: 1;
  max-height: 500px;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.error-message.error-hidden {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
}

.error-message i {
  margin-right: 0.5rem;
}

.success-message {
  background: var(--green-70);
  border-left: 3px solid var(--green-alt);
  color: var(--green-alt);
  padding: 0.8rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  opacity: 1;
  max-height: 500px;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.success-message.success-hidden {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
}

.success-message i {
  margin-right: 0.5rem;
}

.reset-instruction {
  text-align: center;
  margin-bottom: 1.0rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--white-80);
  margin-bottom: 2px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 1rem;
  color: var(--white-50);
  font-size: 1rem;
}

.input-with-icon input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.8rem;
  background: var(--white-10);
  border: 1px solid var(--white-20);
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--primary-purple);
  background: var(--white-15);
}

.input-with-icon input::placeholder {
  color: var(--white-40);
}

.input-with-icon input:disabled {
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--white-15);
  cursor: not-allowed;
}

/* Fix for the icon - they are siblings, not parent-child */
.input-with-icon:has(input:disabled) i {
  opacity: 0.5;
}

/* Alternative approach for browsers that don't support :has */
.input-with-icon input:disabled ~ i {
  opacity: 0.5;
}

/* .input-with-icon input:-webkit-autofill,
.input-with-icon input:-webkit-autofill:hover,
.input-with-icon input:-webkit-autofill:focus,
.input-with-icon input:-webkit-autofill:active {
  -webkit-text-fill-color: white !important;
  background-color: var(--white-10) !important;
  caret-color: white !important;
  transition: background-color 5000s ease-in-out 0s;
} */

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-background-clip: text;
    caret-color: white;
    -webkit-text-fill-color: #ffffff;
    transition: background-color 5000s ease-in-out 0s;
    box-shadow: inset 0 0 20px 20px #34343E;
}

.remember-me {
  flex-direction: row !important;
  justify-content: space-between;
  align-items: center;
  margin: 0.5rem 0;
}

.checkbox-container {
  display: flex;
  align-items: center;
  color: var(--white-70);
  font-size: 0.9rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.checkbox-container input {
  margin-right: 0.5rem;
}

.checkbox-container:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Replaced :has approach with a class-based approach for better compatibility */
.checkbox-container input:disabled ~ .checkmark {
  opacity: 0.7;
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--white-15);
}

.checkbox-container input:disabled ~ span:not(.checkmark) {
  opacity: 0.6;
  cursor: not-allowed;
}

.forgot-password {
  color: var(--primary-purple-light);
  text-decoration: none;
  font-size: 0.8rem;
  margin-bottom: 2px;
  transition: color 0.2s ease, opacity 0.2s ease, pointer-events 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.forgot-password:active {
  color: var(--primary-purple);
}

.login-button {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
}

.login-button:active {
  transform: scale(0.95);
}

.login-button:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  transform: none;
}

.button-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
}

.button-spinner i {
  font-size: 1.2rem;
}

/* Generic hidden class for non-animated elements */
.hidden {
  display: none !important;
}

/* Exception for elements that need to animate in/out */
.button-text.hidden,
.button-spinner.hidden {
  display: none !important;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--white-50);
  font-size: 0.9rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--white-20);
}

.login-divider span {
  padding: 0 1rem;
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.social-button i {
  margin-right: 0.8rem;
}

.social-button.google {
  background: var(--white-10);
  color: white;
  border: 1px solid var(--white-20);
}

.social-button:active {
  transform: scale(0.95);
}

.social-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.signup-prompt {
  margin-top: 2rem;
  margin-bottom: 0.4rem;
  text-align: center;
  color: var(--white-70);
  font-size: 0.9rem;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.signup-prompt a {
  color: var(--primary-purple-light);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease, opacity 0.2s ease, pointer-events 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.signup-prompt a:active {
  color: var(--primary-purple);
}

/* Back to home link */
.back-to-home {
  text-align: center;
  margin-top: 1.5rem;
}

.back-to-home a {
  color: var(--white-70);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

.back-to-home a:hover {
  color: white;
}

.back-to-home i {
  margin-right: 0.5rem;
  font-size: 0.8rem;
}

/* Checkbox styling */
.checkbox-container {
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: var(--white-10);
  border: 1px solid var(--white-30);
  border-radius: 4px;
}

.checkbox-container:hover input ~ .checkmark {
  background-color: var(--white-15);
}

.checkbox-container input:checked ~ .checkmark {
  background-color: var(--primary-purple);
  border-color: var(--primary-purple);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.fade-out {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.signup-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1.5rem;
}

.reset-password-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1.0rem;
}