/* Login and Register Modal Styles */

.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 300ms ease;
}

.auth-modal.show {
  opacity: 1;
}

.auth-modal.hide {
  opacity: 0;
}

.auth-modal__content {
  background: var(--bg-modal);
  border-radius: 15px;
  padding: 32px;
  max-width: 384px;
  width: 90%;
  position: relative;
  transform: scale(0.9);
  transition: transform 300ms ease, background 0.2s ease;
  box-shadow: var(--auth-modal-shadow);
}

.auth-modal.show .auth-modal__content {
  transform: scale(1);
}

.auth-modal.hide .auth-modal__content {
  transform: scale(0.9);
}

.auth-modal__close {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;

  background: var(--bg-close-btn);
  border: 1px solid var(--border-close-btn);
  border-radius: 50%;
  transition: all 0.3s ease;
  color: var(--text-modal-label);
}

.auth-modal__close:hover {
  background: var(--bg-close-btn-hover);
}

.auth-modal__close img {
  width: 100%;
  height: 100%;
}

.auth-modal__header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-modal__title {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 24px;
  line-height: 28px;
  color: var(--text-modal-title);
  margin: 0 0 4px 0;
  transition: color 0.2s ease;
}

.auth-modal__security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.auth-modal__security-icon {
  width: 10px;
  height: 12px;
}

.auth-modal__security-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-modal__security-text {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 28px;
  color: var(--auth-modal-subtitle);
  margin: 0;
  transition: color 0.2s ease;
}

.auth-modal__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-modal__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-modal__label {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 20px;
  color: var(--auth-modal-label);
  padding-left: 12px;
  transition: color 0.2s ease;
}

.auth-modal__input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--auth-modal-input-bg);
  border: 1px solid var(--auth-modal-input-border);
  border-radius: 8px;
  height: 40px;
  box-shadow: 0 1px 2px 0 rgba(128, 128, 128, 0.1);
  transition: border-color 200ms ease, background 0.2s ease;
}

.auth-modal__input-wrapper:has(input:disabled) {
    background: var(--auth-modal-input-disabled-bg);
}

.auth-modal__input-wrapper:focus-within {
  border-color: var(--primary-color);
}

.auth-modal__input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 12px;
  flex-shrink: 0;
  color: var(--auth-modal-input-icon);
  transition: color 0.2s ease;
}

.auth-modal__input-icon img {
  width: 24px;
  height: 24px;
}

.auth-modal__input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 12px;
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: var(--auth-modal-input-text);
  background: transparent;
  transition: color 0.2s ease;
}

.auth-modal__input::placeholder {
  color: var(--auth-modal-input-placeholder);
  font-weight: 500;
}

.auth-modal__input-action {
  display: flex;
  align-items: center;
  padding-right: 4px;
  flex-shrink: 0;
  color: var(--auth-modal-input-icon);
}

.auth-modal__input-action img {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.auth-modal__send-code {
  background: var(--auth-modal-input-bg);
  border: 1px solid var(--auth-modal-button-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
  color: var(--auth-modal-button-text);
  cursor: pointer;
  box-shadow: 0 1px 2px 0 rgba(128, 128, 128, 0.1);
  height: 24px;
  transition: background-color 200ms ease, color 0.2s ease;
  text-transform: capitalize;
}

.auth-modal__send-code:hover:not(:disabled) {
  background-color: var(--auth-modal-button-hover);
}

.auth-modal__send-code:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.auth-modal__checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.auth-modal__checkbox-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Custom Checkbox Styles */
.auth-modal__checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
}

.auth-modal__checkbox-custom {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 1px solid var(--auth-modal-checkbox-border);
  border-radius: 6px;
  background: var(--auth-modal-checkbox-bg);
  box-shadow: 0 1px 2px 0 rgba(128, 128, 128, 0.1);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 200ms ease;
}

.auth-modal__checkbox-custom::after {
  content: '';
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-modal__checkbox:checked + .auth-modal__checkbox-custom {
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 1px 4px 0 rgba(37, 99, 235, 0.2);
}

.auth-modal__checkbox:checked + .auth-modal__checkbox-custom::after {
  display: block;
}

/* .auth-modal__checkbox:focus + .auth-modal__checkbox-custom {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
} */

.auth-modal__checkbox-custom:hover {
  border-color: var(--auth-modal-input-border);
}

.auth-modal__checkbox:checked + .auth-modal__checkbox-custom:hover {
  background: var(--primary-color-hover);
  border-color: var(--primary-color-hover);
}

.auth-modal__checkbox-label {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 20px;
  color: var(--auth-modal-text);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.auth-modal__forgot-password {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 20px;
  color: var(--primary-color);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-modal__forgot-password:hover {
  color: var(--primary-color-hover);
  text-decoration: underline;
}

.auth-modal__submit {
  background: var(--primary-color);
  border-radius: 8px;
  height: 40px;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  transition: all 200ms ease;
}

.auth-modal__submit:hover {
  background: var(--primary-color-hover);
}

.auth-modal__submit:active {
  background: var(--primary-color-active);
  transform: scale(0.95);
}

.auth-modal__cancel-btn {
  background: transparent;
  border: none;
  color: var(--auth-modal-cancel-text);
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  padding: 10px;
  text-align: center;
  transition: color 200ms ease;
}

.auth-modal__cancel-btn:hover {
  color: var(--auth-modal-cancel-hover);
  text-decoration: underline;
}

.auth-modal__divider {
  display: flex;
  align-items: center;
  gap: 20px;
}

.auth-modal__divider-line {
  flex: 1;
  height: 1px;
  background: var(--auth-modal-divider);
  transition: background 0.2s ease;
}

.auth-modal__divider-text {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: var(--auth-modal-subtitle);
  transition: color 0.2s ease;
}

.auth-modal__oauth-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-modal__google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--auth-modal-input-bg);
  border: 1px solid var(--auth-modal-button-border);
  border-radius: 8px;
  height: 40px;
  cursor: pointer;
  box-shadow: 0 1px 2px 0 rgba(128, 128, 128, 0.1);
  transition: background-color 200ms ease;
  width: 100%;
}

.auth-modal__google-btn:hover {
  background-color: var(--auth-modal-button-hover);
}

.auth-modal__google-icon {
  width: 24px;
  height: 24px;
}

.auth-modal__google-icon img {
  width: 100%;
  height: 100%;
}

.auth-modal__google-text {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  color: var(--auth-modal-text);
  transition: color 0.2s ease;
}

.auth-modal__switch {
  background: var(--auth-modal-switch-bg);
  border-radius: 15px;
  padding: 16px;
  text-align: center;
  transition: background 0.2s ease;
}

[data-theme="dark"] .auth-modal__switch {
  border: 1px solid var(--auth-modal-input-border);
}

.auth-modal__switch-text {
  font-family: 'Satoshi Variable', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--auth-modal-switch-text);
  margin: 0;
  transition: color 0.2s ease;
}

.auth-modal__switch-link {
  color: var(--primary-color);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-modal__switch-link:hover {
  color: var(--primary-color-hover);
  text-decoration: underline;
}

.auth-modal__terms-link {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 20px;
  color: var(--primary-color);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-modal__terms-link:hover {
  color: var(--primary-color-hover);
  text-decoration: underline;
}

/* Responsive Design */

/* 平板端 */
@media (max-width: 768px) {
  .auth-modal__content {
    padding: 28px 24px;
    max-width: 360px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .auth-modal__header {
    margin-bottom: 24px;
  }

  .auth-modal__title {
    font-size: 20px;
    line-height: 24px;
  }

  .auth-modal__form {
    gap: 16px;
  }

  .auth-modal__field {
    gap: 6px;
  }
}

/* 手机端 */
@media (max-width: 480px) {
  .auth-modal {
    padding: 16px;
  }

  .auth-modal__content {
    padding: 24px 20px;
    max-width: 100%;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
  }

  .auth-modal__close {
    right: 12px;
    top: 12px;
    width: 28px;
    height: 28px;
  }

  .auth-modal__header {
    margin-bottom: 20px;
  }

  .auth-modal__title {
    font-size: 18px;
    line-height: 22px;
  }

  .auth-modal__security-text {
    font-size: 11px;
    line-height: 24px;
  }

  .auth-modal__form {
    gap: 14px;
  }

  .auth-modal__field {
    gap: 6px;
  }

  .auth-modal__label {
    font-size: 11px;
    line-height: 18px;
    padding-left: 10px;
  }

  .auth-modal__input-wrapper {
    height: 38px;
  }

  .auth-modal__input {
    font-size: 13px;
    padding: 0 10px;
  }

  .auth-modal__input-icon {
    padding-left: 10px;
  }

  .auth-modal__input-icon img {
    width: 20px;
    height: 20px;
  }

  .auth-modal__input-action img {
    width: 20px;
    height: 20px;
  }

  .auth-modal__send-code {
    font-size: 12px;
    padding: 3px 6px;
    height: 22px;
  }

  .auth-modal__checkbox-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 0 6px;
  }

  .auth-modal__checkbox-custom {
    width: 18px;
    height: 18px;
  }

  .auth-modal__checkbox-custom::after {
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
  }

  .auth-modal__checkbox-label {
    font-size: 11px;
    line-height: 18px;
  }

  .auth-modal__forgot-password,
  .auth-modal__terms-link {
    align-self: flex-start;
    font-size: 11px;
    line-height: 18px;
  }

  .auth-modal__submit {
    height: 38px;
    font-size: 13px;
  }

  .auth-modal__cancel-btn {
    font-size: 13px;
    padding: 8px;
  }

  .auth-modal__divider {
    gap: 16px;
  }

  .auth-modal__divider-text {
    font-size: 11px;
  }

  .auth-modal__google-btn {
    height: 38px;
    gap: 6px;
  }

  .auth-modal__google-icon {
    width: 20px;
    height: 20px;
  }

  .auth-modal__google-text {
    font-size: 13px;
  }

  .auth-modal__switch {
    padding: 14px;
    border-radius: 12px;
  }

  .auth-modal__switch-text {
    font-size: 13px;
  }
}

/* 超小屏幕 */
@media (max-width: 360px) {
  .auth-modal {
    padding: 12px;
  }

  .auth-modal__content {
    padding: 20px 16px;
    max-height: 82vh;
  }

  .auth-modal__header {
    margin-bottom: 16px;
  }

  .auth-modal__title {
    font-size: 16px;
    line-height: 20px;
  }

  .auth-modal__form {
    gap: 12px;
  }

  .auth-modal__input-wrapper {
    height: 36px;
  }

  .auth-modal__input {
    font-size: 12px;
  }

  .auth-modal__submit {
    height: 36px;
    font-size: 12px;
  }

  .auth-modal__google-btn {
    height: 36px;
  }
}
