.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s linear 0.3s, opacity 0.3s ease;
}
.auth-modal.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}
.auth-modal.is-open .auth-modal-container {
  transform: scale(1) translateY(0);
}

.auth-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 20, 25, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.auth-modal-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease;
}

.auth-modal-content {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
body.dark-mode .auth-modal-content {
  background: #112022;
  border-color: #234348;
}

.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 50%;
  transition: all 250ms ease;
  z-index: 10;
}
.auth-modal-close:hover {
  background: #f1f5f9;
  color: #1a1a1a;
}
body.dark-mode .auth-modal-close {
  color: #6b7280;
}
body.dark-mode .auth-modal-close:hover {
  background: #1a2c30;
  color: #ffffff;
}
[dir=rtl] .auth-modal-close, .rtl .auth-modal-close {
  right: auto;
  left: 1rem;
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.auth-logo-text {
  color: #1a1a1a;
}
body.dark-mode .auth-logo-text {
  color: #fff;
}

.auth-logo-zone {
  color: #20d3ee;
}

.auth-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  color: #20d3ee;
}
body.dark-mode .auth-logo-icon {
  background: linear-gradient(135deg, #1a2c30 0%, #112022 100%);
  border-color: #234348;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}
body.dark-mode .auth-tabs {
  border-bottom-color: #234348;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 250ms ease;
  position: relative;
}
.auth-tab::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 250ms ease;
}
.auth-tab:hover {
  color: #4b5563;
}
.auth-tab.active {
  color: #20d3ee;
}
.auth-tab.active::after {
  background: #20d3ee;
}
body.dark-mode .auth-tab {
  color: #6b7280;
}
body.dark-mode .auth-tab:hover {
  color: #9ca3af;
}
body.dark-mode .auth-tab.active {
  color: #20d3ee;
}

.auth-form {
  display: none;
}
.auth-form.active {
  display: block;
}

.auth-field {
  margin-bottom: 1rem;
}
.auth-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #4b5563;
  margin-bottom: 0.5rem;
}
body.dark-mode .auth-field label {
  color: #9ca3af;
}

.auth-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.auth-field-header label {
  margin-bottom: 0;
}
[dir=rtl] .auth-field-header, .rtl .auth-field-header {
  flex-direction: row-reverse;
}

.auth-forgot {
  font-size: 0.75rem;
  color: #20d3ee;
  text-decoration: none;
  transition: color 250ms ease;
}
.auth-forgot:hover {
  color: #67e8f9;
  text-decoration: underline;
}

.auth-input-wrap {
  position: relative;
}
.auth-input-wrap input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-left: 2.75rem;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  color: #1a1a1a;
  font-size: 0.9375rem;
  transition: all 250ms ease;
}
.auth-input-wrap input::placeholder {
  color: #9ca3af;
}
.auth-input-wrap input:focus {
  outline: none;
  border-color: #20d3ee;
  box-shadow: 0 0 0 3px rgba(32, 211, 238, 0.15);
}
[dir=rtl] .auth-input-wrap input, .rtl .auth-input-wrap input {
  padding-left: 1rem;
  padding-right: 2.75rem;
  text-align: right;
}
body.dark-mode .auth-input-wrap input {
  background: #1a2c30;
  border-color: #234348;
  color: #ffffff;
}
body.dark-mode .auth-input-wrap input::placeholder {
  color: #6b7280;
}
.auth-input-wrap i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1rem;
}
[dir=rtl] .auth-input-wrap i, .rtl .auth-input-wrap i {
  left: auto;
  right: 1rem;
}
body.dark-mode .auth-input-wrap i {
  color: #6b7280;
}

.auth-error {
  display: none;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.5rem;
  color: #f87171;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.auth-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: #20d3ee;
  border: none;
  border-radius: 0.5rem;
  color: #112022;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 250ms ease;
  margin-top: 0.5rem;
}
.auth-submit:hover {
  background: #67e8f9;
  transform: translateY(-1px);
}
.auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.auth-submit .spin {
  animation: spin 1s linear infinite;
}
[dir=rtl] .auth-submit, .rtl .auth-submit {
  flex-direction: row-reverse;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: #9ca3af;
  font-size: 0.8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}
body.dark-mode .auth-divider {
  color: #6b7280;
}
body.dark-mode .auth-divider::before, body.dark-mode .auth-divider::after {
  background: #234348;
}

.auth-social {
  display: flex;
  gap: 0.75rem;
}

.auth-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  color: #1a1a1a;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 250ms ease;
}
.auth-social-btn:hover {
  background: #f1f5f9;
  border-color: #d1d5db;
}
.auth-social-btn i {
  font-size: 1.125rem;
}
body.dark-mode .auth-social-btn {
  background: #1a2c30;
  border-color: #234348;
  color: #fff;
}
body.dark-mode .auth-social-btn:hover {
  background: #152629;
  border-color: #2c555b;
}
[dir=rtl] .auth-social-btn, .rtl .auth-social-btn {
  flex-direction: row-reverse;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.auth-secure {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #9ca3af;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.auth-secure i {
  color: #20d3ee;
}
body.dark-mode .auth-secure {
  color: #6b7280;
}
[dir=rtl] .auth-secure, .rtl .auth-secure {
  flex-direction: row-reverse;
}
