/* Auth Modal */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.auth-modal.active {
  opacity: 1;
  pointer-events: all;
}

.auth-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.auth-modal__content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.auth-modal.active .auth-modal__content {
  transform: translateY(0);
}

.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: color 0.2s ease;
}

.auth-modal__close:hover {
  color: #000;
}

.auth-modal__close .icon {
  width: 20px;
  height: 20px;
}

.auth-modal__tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 2px solid #e5e5e5;
}

.auth-modal__tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.auth-modal__tab:hover {
  color: #000;
}

.auth-modal__tab.active {
  color: #000;
}

.auth-modal__tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #000;
}

.auth-modal__panels {
  position: relative;
}

.auth-modal__panel {
  display: none;
}

.auth-modal__panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-modal__title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #000;
}

.auth-modal__description {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form__label {
  font-size: 14px;
  font-weight: 500;
  color: #000;
}

.auth-form__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.2s ease;
}

.auth-form__input:focus {
  outline: none;
  border-color: #000;
}

.auth-form__input.error {
  border-color: #dc2626;
}

.auth-form__input--code {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 8px;
}

.auth-form__error {
  font-size: 13px;
  color: #dc2626;
  display: none;
}

.auth-form__error.active {
  display: block;
}

.auth-form__hint {
  font-size: 13px;
  color: #666;
}

.auth-form__submit {
  width: 100%;
  padding: 14px 24px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.auth-form__submit:hover {
  background: #333;
}

.auth-form__submit:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.auth-form__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.auth-form__link {
  font-size: 14px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-form__link:hover {
  color: #000;
}

/* Success Panel */
.auth-modal__success {
  text-align: center;
  padding: 20px 0;
}

.auth-modal__success-icon {
  width: 64px;
  height: 64px;
  color: #22c55e;
  margin-bottom: 16px;
}

.auth-modal__success .auth-modal__title {
  margin-bottom: 16px;
}

/* Message */
.auth-modal__message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.auth-modal__message.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.auth-modal__message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.auth-modal__message.info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

/* Responsive */
@media (max-width: 640px) {
  .auth-modal__content {
    padding: 32px 24px;
    max-width: 95%;
  }

  .auth-modal__title {
    font-size: 20px;
  }

  .auth-modal__tab {
    font-size: 14px;
    padding: 10px 12px;
  }
}

/* Loading State */
.auth-form__submit.loading {
  position: relative;
  color: transparent;
}

.auth-form__submit.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
