/** @license For full copyright and license information, please see the LICENSE.md file. */

/**
 * @file auth-reset.css
 * @description Modern, WCAG 2.2 AA compliant styles for authentication, password reset, and NIST SP 800-63B meters.
 */

.auth-card {
  border-radius: var(--tblr-border-radius-lg, 12px);
  border: 1px solid var(--tblr-border-color-translucent, rgba(0, 0, 0, 0.08));
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.auth-lang-picker {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.auth-lang-btn {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--tblr-bg-surface, #ffffff);
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  color: var(--tblr-body-color, #1e293b);
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.auth-lang-btn:hover {
  background-color: var(--tblr-bg-surface-secondary, #f8fafc);
  color: var(--tblr-primary, #206bc4);
  border-color: var(--tblr-primary, #206bc4);
}

.auth-info-banner {
  border-left: 3px solid var(--tblr-primary, #206bc4);
  background-color: rgba(32, 107, 196, 0.04);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.8125rem;
  color: var(--tblr-secondary, #64748b);
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.auth-info-banner__icon {
  font-size: 1.1rem;
  color: var(--tblr-primary, #206bc4);
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.auth-strength-meter {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.auth-strength-meter__track {
  height: 6px;
  background-color: var(--tblr-border-color, #e2e8f0);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.auth-strength-meter__bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.auth-strength-meter__bar--weak {
  width: 25%;
  background-color: var(--tblr-danger, #d63939);
}

.auth-strength-meter__bar--fair {
  width: 50%;
  background-color: var(--tblr-warning, #f59f00);
}

.auth-strength-meter__bar--good {
  width: 75%;
  background-color: var(--tblr-azure, #4299e1);
}

.auth-strength-meter__bar--strong {
  width: 100%;
  background-color: var(--tblr-success, #2fb344);
}

.auth-strength-meter__text {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--tblr-secondary, #64748b);
}

.auth-req-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-req-list__item {
  font-size: 0.8125rem;
  color: var(--tblr-secondary, #64748b);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.auth-req-list__icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.auth-req-list__item--valid {
  color: var(--tblr-success, #2fb344);
  font-weight: 500;
}

.auth-req-list__item--valid .auth-req-list__icon {
  color: var(--tblr-success, #2fb344);
}

.auth-password-wrapper {
  position: relative;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--tblr-secondary, #94a3b8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  font-size: 1.1rem;
  line-height: 1;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--tblr-primary, #206bc4);
  outline: none;
}

/* Modern Auth Card & Form Enhancements */
.auth-card--modern {
  border-radius: 16px;
  border: 1px solid var(--tblr-border-color-translucent, rgba(0, 0, 0, 0.08));
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.07), 0 0 1px 1px rgba(15, 23, 42, 0.04);
  background: var(--tblr-bg-surface, #ffffff);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-input-clean {
  border-radius: 10px;
  height: 44px;
  font-size: 0.9375rem;
  border-color: var(--tblr-border-color, #e2e8f0);
  background-color: var(--tblr-bg-surface, #ffffff);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-input-clean:focus {
  border-color: var(--tblr-primary, #206bc4);
  box-shadow: 0 0 0 3px rgba(32, 107, 196, 0.15);
}

/* Borderless Modern Icon-Only UI Mode Switcher */
.auth-ui-mode-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  padding: 0.45rem 0.75rem;
  background-color: var(--tblr-bg-surface-secondary, rgba(0, 0, 0, 0.025));
  border-radius: 12px;
}

.auth-ui-mode-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--tblr-secondary, #64748b);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-ui-mode-bar {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background-color: var(--tblr-border-color-translucent, rgba(0, 0, 0, 0.06));
  padding: 3px;
  border-radius: 9999px;
  border: none;
}

.auth-ui-mode-btn {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  width: 38px;
  height: 34px;
  border-radius: 9999px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tblr-secondary, #94a3b8);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

@media (pointer: coarse) {
  .auth-ui-mode-btn {
    width: 44px;
    height: 44px;
  }
}

.auth-ui-mode-btn i {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.auth-ui-mode-btn:hover {
  color: var(--tblr-body-color, #1e293b);
  background: rgba(0, 0, 0, 0.05) !important;
}

.auth-ui-mode-btn:hover i {
  transform: scale(1.12);
}

.btn-check:checked + .auth-ui-mode-btn {
  background-color: var(--tblr-bg-surface, #ffffff) !important;
  color: var(--tblr-primary, #206bc4) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.btn-check:focus-visible + .auth-ui-mode-btn {
  outline: 2px solid var(--tblr-primary, #206bc4) !important;
  outline-offset: 2px;
}

/* Modern Submit Button */
.auth-submit-btn {
  height: 44px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(32, 107, 196, 0.22);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(32, 107, 196, 0.32);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

/* Dark Mode Harmonization */
[data-bs-theme="dark"] .auth-card--modern {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .auth-ui-mode-container {
  background-color: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .auth-ui-mode-bar {
  background-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .auth-ui-mode-btn:hover {
  color: #ffffff !important;
  background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .btn-check:checked + .auth-ui-mode-btn {
  background-color: var(--tblr-primary, #206bc4) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(32, 107, 196, 0.5) !important;
}

/* Brand Auth Logo (Theme-Responsive) */
.brand-auth-logo {
  max-height: 52px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.2s ease-in-out;
}

.brand-auth-logo--light {
  display: inline-block;
}

.brand-auth-logo--dark {
  display: none !important;
}

[data-bs-theme="dark"] .brand-auth-logo--light {
  display: none !important;
}

[data-bs-theme="dark"] .brand-auth-logo--dark {
  display: inline-block !important;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.4));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme="light"]) .brand-auth-logo--light {
    display: none !important;
  }
  :root:not([data-bs-theme="light"]) .brand-auth-logo--dark {
    display: inline-block !important;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.4));
  }
}

