
/* Auth Modal Styles */
.auth-modal-content {
  width: min(92vw, 520px);
  max-width: 520px;
  min-width: 0;
  padding: clamp(18px, 4vw, 30px);
}

.auth-tabs {
  display: flex;
  margin-bottom: var(--space-7);
  border-bottom: 2px solid #444;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: #aaa;
  padding: var(--space-4);
  cursor: pointer;
  font-size: 1.1em;
  font-weight: var(--font-weight-bold);
  transition: color 0.2s;
}

.auth-tab:hover {
  color: #fff;
}

.auth-tab.active {
  color: var(--color-gold);
  border-bottom: 2px solid var(--color-gold);
  margin-bottom: -2px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

.form-group label {
  color: #ccc;
  font-size: 0.9em;
  font-weight: var(--font-weight-medium);
}

.auth-submit-btn {
  margin-top: var(--space-4);
  width: 100%;
  padding: var(--space-5);
  font-size: 1.1em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-submit-btn--ready {
  animation: auth-submit-pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35), 0 4px 16px rgba(212, 175, 55, 0.35);
}

.auth-submit-btn--ready:hover:not(:disabled) {
  animation-play-state: paused;
}

@keyframes auth-submit-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35), 0 4px 16px rgba(212, 175, 55, 0.3);
    transform: translateZ(0) scale(1);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.55), 0 6px 22px rgba(212, 175, 55, 0.5);
    transform: translateZ(0) scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit-btn--ready {
    animation: none;
  }
}

.auth-form-hint {
  margin: var(--space-1) 0 0;
  color: #bdbdbd;
  font-size: 0.85em;
  text-align: center;
  line-height: 1.4;
  max-height: 60px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.auth-form-hint--hidden {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .auth-form-hint {
    transition: opacity 0.15s ease;
  }
}

.password-rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
  font-size: 0.82em;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease, margin 0.25s ease;
}

.password-rules-list--visible {
  max-height: 140px;
  opacity: 1;
  margin: 6px 0 0;
  transform: translateY(0);
}

.password-rules-list--complete {
  animation: password-rules-celebrate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes password-rules-celebrate {
  0% {
    max-height: 140px;
    opacity: 1;
    margin: 6px 0 0;
    transform: translateY(0) scale(1);
  }
  30% {
    max-height: 140px;
    opacity: 1;
    margin: 6px 0 0;
    transform: translateY(0) scale(1.04);
  }
  60% {
    max-height: 140px;
    opacity: 0.85;
    margin: 6px 0 0;
    transform: translateY(-2px) scale(1);
  }
  100% {
    max-height: 0;
    opacity: 0;
    margin: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.password-rule {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  line-height: 1.4;
  transition: color 0.2s ease;
}

.password-rule::before {
  content: '✗';
  display: inline-block;
  width: 14px;
  text-align: center;
  font-weight: var(--font-weight-bold);
}

.password-rule--met {
  color: #6ece6e;
}

.password-rule--met::before {
  content: '✓';
}

.password-rule--unmet {
  color: #e06767;
}

@media (max-width: 420px) {
  .password-rules-list {
    grid-template-columns: 1fr;
  }
  .password-rules-list--visible {
    max-height: 240px;
  }
  @keyframes password-rules-celebrate {
    0%, 30% {
      max-height: 240px;
      opacity: 1;
      margin: 6px 0 0;
    }
    60% {
      max-height: 240px;
      opacity: 0.85;
    }
    100% {
      max-height: 0;
      opacity: 0;
      margin: 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .password-rules-list,
  .password-rules-list--complete {
    transition: opacity 0.15s ease;
    animation: none;
  }
  .password-rules-list--complete {
    max-height: 0;
    opacity: 0;
    margin: 0;
  }
}

.auth-form .account-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

.auth-reset-btn {
  width: 100%;
  padding: var(--space-4);
  font-size: 0.95em;
}

/* Password field wrapper with toggle button */
.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field-wrapper .account-input {
  flex: 1;
  padding-right: 44px;
}


.password-toggle-btn {
  position: absolute;
  right: 2px;
  top: 0;
  bottom: 0;
  width: 40px;
  min-height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  color: #7a5632;
  cursor: pointer;
  font-size: 1em;
  line-height: 0;
  padding: 0;
}

.password-toggle-btn::before {
  content: '';
  width: 20px;
  height: 20px;
  display: block;
  background-color: currentColor;
  -webkit-mask-image: url('../assets/svg/eye.svg');
  mask-image: url('../assets/svg/eye.svg');
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transform: translateY(-3px);
}

.password-toggle-btn[aria-pressed='true']::before {
  -webkit-mask-image: url('../assets/svg/eye-off.svg');
  mask-image: url('../assets/svg/eye-off.svg');
}

.password-toggle-btn:hover {
  color: #5f3f22;
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Profile password form toggle buttons */
.account-password-form .password-field-wrapper {
  width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
